vidspotai-shared 1.0.82-dev.0 → 1.0.83
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 +11 -1
- package/lib/globals/aiModels/enums.d.ts.map +1 -1
- package/lib/globals/aiModels/enums.js +24 -1
- package/lib/globals/aiModels/index.d.ts.map +1 -1
- package/lib/globals/aiModels/index.js +2 -0
- package/lib/globals/aiModels/providers/anthropic.d.ts +12 -0
- package/lib/globals/aiModels/providers/anthropic.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/anthropic.js +88 -0
- package/lib/globals/aiModels/providers/google.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/google.js +115 -10
- package/lib/globals/aiModels/providers/openai.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/openai.js +63 -4
- package/lib/globals/aiModels/tierHelpers.d.ts +12 -0
- package/lib/globals/aiModels/tierHelpers.d.ts.map +1 -1
- package/lib/globals/aiModels/tierHelpers.js +83 -0
- package/lib/globals/aiModels/types.d.ts +19 -0
- package/lib/globals/aiModels/types.d.ts.map +1 -1
- package/lib/globals/types.d.ts +120 -1
- package/lib/globals/types.d.ts.map +1 -1
- package/lib/globals/types.js +135 -1
- package/lib/models/agent.model.d.ts +41 -1
- package/lib/models/agent.model.d.ts.map +1 -1
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.d.ts.map +1 -1
- package/lib/models/index.js +1 -0
- package/lib/models/social.model.d.ts +180 -0
- package/lib/models/social.model.d.ts.map +1 -0
- package/lib/models/social.model.js +2 -0
- package/lib/models/user.model.d.ts +10 -0
- package/lib/models/user.model.d.ts.map +1 -1
- package/lib/models/video.model.d.ts +6 -0
- package/lib/models/video.model.d.ts.map +1 -1
- package/lib/schemas/brief.schema.d.ts +46 -0
- package/lib/schemas/brief.schema.d.ts.map +1 -1
- package/lib/schemas/brief.schema.js +72 -1
- package/lib/schemas/index.d.ts +1 -0
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +1 -0
- package/lib/schemas/project.schema.d.ts +70 -3
- package/lib/schemas/project.schema.d.ts.map +1 -1
- package/lib/schemas/project.schema.js +12 -0
- package/lib/schemas/social.schema.d.ts +91 -0
- package/lib/schemas/social.schema.d.ts.map +1 -0
- package/lib/schemas/social.schema.js +114 -0
- package/lib/schemas/videoPlan.schema.d.ts +117 -3
- package/lib/schemas/videoPlan.schema.d.ts.map +1 -1
- package/lib/schemas/videoPlan.schema.js +141 -1
- package/lib/services/agent/chatAgent.d.ts +25 -1
- package/lib/services/agent/chatAgent.d.ts.map +1 -1
- package/lib/services/agent/chatAgent.js +145 -9
- package/lib/services/agent/costPreflight.d.ts +11 -1
- package/lib/services/agent/costPreflight.d.ts.map +1 -1
- package/lib/services/agent/costPreflight.js +18 -1
- package/lib/services/agent/covers/coverPlanner.d.ts +41 -0
- package/lib/services/agent/covers/coverPlanner.d.ts.map +1 -0
- package/lib/services/agent/covers/coverPlanner.js +278 -0
- package/lib/services/agent/covers/covers.schema.d.ts +158 -0
- package/lib/services/agent/covers/covers.schema.d.ts.map +1 -0
- package/lib/services/agent/covers/covers.schema.js +166 -0
- package/lib/services/agent/covers/index.d.ts +3 -0
- package/lib/services/agent/covers/index.d.ts.map +1 -0
- package/lib/services/agent/covers/index.js +18 -0
- package/lib/services/agent/critic.d.ts +10 -0
- package/lib/services/agent/critic.d.ts.map +1 -1
- package/lib/services/agent/critic.js +37 -1
- package/lib/services/agent/editClassifier.d.ts +4 -4
- package/lib/services/agent/editClassifier.js +2 -2
- package/lib/services/agent/editExisting/editAssembler.d.ts +78 -0
- package/lib/services/agent/editExisting/editAssembler.d.ts.map +1 -0
- package/lib/services/agent/editExisting/editAssembler.js +172 -0
- package/lib/services/agent/editExisting/editExisting.schema.d.ts +119 -0
- package/lib/services/agent/editExisting/editExisting.schema.d.ts.map +1 -0
- package/lib/services/agent/editExisting/editExisting.schema.js +157 -0
- package/lib/services/agent/editExisting/highlightPicker.d.ts +48 -0
- package/lib/services/agent/editExisting/highlightPicker.d.ts.map +1 -0
- package/lib/services/agent/editExisting/highlightPicker.js +199 -0
- package/lib/services/agent/editExisting/index.d.ts +4 -0
- package/lib/services/agent/editExisting/index.d.ts.map +1 -0
- package/lib/services/agent/editExisting/index.js +19 -0
- package/lib/services/agent/eval/recorder.d.ts +13 -1
- package/lib/services/agent/eval/recorder.d.ts.map +1 -1
- package/lib/services/agent/eval/recorder.js +59 -0
- package/lib/services/agent/eval/seedBriefs.d.ts +4 -3
- package/lib/services/agent/eval/seedBriefs.d.ts.map +1 -1
- package/lib/services/agent/eval/seedBriefs.js +283 -3
- package/lib/services/agent/eval/types.d.ts +10 -0
- package/lib/services/agent/eval/types.d.ts.map +1 -1
- package/lib/services/agent/executor/core.d.ts +70 -0
- package/lib/services/agent/executor/core.d.ts.map +1 -0
- package/lib/services/agent/executor/core.js +250 -0
- package/lib/services/agent/executor/duration.d.ts +20 -0
- package/lib/services/agent/executor/duration.d.ts.map +1 -0
- package/lib/services/agent/executor/duration.js +46 -0
- package/lib/services/agent/executor/index.d.ts +15 -0
- package/lib/services/agent/executor/index.d.ts.map +1 -0
- package/lib/services/agent/executor/index.js +32 -0
- package/lib/services/agent/executor/types.d.ts +183 -0
- package/lib/services/agent/executor/types.d.ts.map +1 -0
- package/lib/services/agent/executor/types.js +29 -0
- package/lib/services/agent/executor/visual.d.ts +32 -0
- package/lib/services/agent/executor/visual.d.ts.map +1 -0
- package/lib/services/agent/executor/visual.js +400 -0
- package/lib/services/agent/executor/voice.d.ts +17 -0
- package/lib/services/agent/executor/voice.d.ts.map +1 -0
- package/lib/services/agent/executor/voice.js +119 -0
- package/lib/services/agent/extendChain.d.ts +101 -0
- package/lib/services/agent/extendChain.d.ts.map +1 -0
- package/lib/services/agent/extendChain.js +177 -0
- package/lib/services/agent/index.d.ts +11 -1
- package/lib/services/agent/index.d.ts.map +1 -1
- package/lib/services/agent/index.js +11 -1
- package/lib/services/agent/llmCaller.d.ts +7 -8
- package/lib/services/agent/llmCaller.d.ts.map +1 -1
- package/lib/services/agent/llmCallerAnthropic.d.ts +44 -31
- package/lib/services/agent/llmCallerAnthropic.d.ts.map +1 -1
- package/lib/services/agent/llmCallerAnthropic.js +135 -60
- package/lib/services/agent/llmCallerFactory.d.ts +34 -0
- package/lib/services/agent/llmCallerFactory.d.ts.map +1 -0
- package/lib/services/agent/llmCallerFactory.js +31 -0
- package/lib/services/agent/llmCallerGemini.d.ts +62 -0
- package/lib/services/agent/llmCallerGemini.d.ts.map +1 -0
- package/lib/services/agent/llmCallerGemini.js +235 -0
- package/lib/services/agent/llmCallerOpenai.d.ts +56 -0
- package/lib/services/agent/llmCallerOpenai.d.ts.map +1 -0
- package/lib/services/agent/llmCallerOpenai.js +230 -0
- package/lib/services/agent/llmCallerRegistry.d.ts.map +1 -1
- package/lib/services/agent/llmCallerRegistry.js +7 -7
- package/lib/services/agent/llmCallerRouting.d.ts +63 -0
- package/lib/services/agent/llmCallerRouting.d.ts.map +1 -0
- package/lib/services/agent/llmCallerRouting.js +124 -0
- package/lib/services/agent/llmModelRegistry.d.ts +59 -0
- package/lib/services/agent/llmModelRegistry.d.ts.map +1 -0
- package/lib/services/agent/llmModelRegistry.js +168 -0
- package/lib/services/agent/llmRetry.d.ts +57 -0
- package/lib/services/agent/llmRetry.d.ts.map +1 -0
- package/lib/services/agent/llmRetry.js +102 -0
- package/lib/services/agent/modelRouter.d.ts +3 -3
- package/lib/services/agent/modelRouter.d.ts.map +1 -1
- package/lib/services/agent/modelRouter.js +27 -13
- package/lib/services/agent/planMutations.d.ts +54 -1
- package/lib/services/agent/planMutations.d.ts.map +1 -1
- package/lib/services/agent/planMutations.js +78 -0
- package/lib/services/agent/planner/Planner.d.ts +0 -17
- package/lib/services/agent/planner/Planner.d.ts.map +1 -1
- package/lib/services/agent/planner/Planner.js +67 -303
- package/lib/services/agent/planner/overlayRegen.d.ts +38 -0
- package/lib/services/agent/planner/overlayRegen.d.ts.map +1 -0
- package/lib/services/agent/planner/overlayRegen.js +145 -0
- package/lib/services/agent/planner/plannerMessages.d.ts +34 -0
- package/lib/services/agent/planner/plannerMessages.d.ts.map +1 -0
- package/lib/services/agent/planner/plannerMessages.js +185 -0
- package/lib/services/agent/planner/promptSections.d.ts +12 -0
- package/lib/services/agent/planner/promptSections.d.ts.map +1 -1
- package/lib/services/agent/planner/promptSections.js +57 -0
- package/lib/services/agent/planner/scriptFirstPlanner.d.ts +35 -0
- package/lib/services/agent/planner/scriptFirstPlanner.d.ts.map +1 -0
- package/lib/services/agent/planner/scriptFirstPlanner.js +140 -0
- package/lib/services/agent/planner/structuralRules.d.ts +10 -0
- package/lib/services/agent/planner/structuralRules.d.ts.map +1 -1
- package/lib/services/agent/planner/structuralRules.js +92 -9
- package/lib/services/agent/planner/validators.d.ts +18 -0
- package/lib/services/agent/planner/validators.d.ts.map +1 -1
- package/lib/services/agent/planner/validators.js +97 -0
- package/lib/services/agent/planner.d.ts +2 -1
- package/lib/services/agent/planner.d.ts.map +1 -1
- package/lib/services/agent/planner.js +5 -1
- package/lib/services/agent/priorProject.d.ts +26 -0
- package/lib/services/agent/priorProject.d.ts.map +1 -0
- package/lib/services/agent/priorProject.js +51 -0
- package/lib/services/agent/providerFallback/chains.d.ts.map +1 -1
- package/lib/services/agent/providerFallback/chains.js +27 -15
- package/lib/services/agent/repurpose/index.d.ts +3 -0
- package/lib/services/agent/repurpose/index.d.ts.map +1 -0
- package/lib/services/agent/repurpose/index.js +18 -0
- package/lib/services/agent/repurpose/repurpose.schema.d.ts +132 -0
- package/lib/services/agent/repurpose/repurpose.schema.d.ts.map +1 -0
- package/lib/services/agent/repurpose/repurpose.schema.js +144 -0
- package/lib/services/agent/repurpose/shortsPicker.d.ts +25 -0
- package/lib/services/agent/repurpose/shortsPicker.d.ts.map +1 -0
- package/lib/services/agent/repurpose/shortsPicker.js +218 -0
- package/lib/services/agent/runHelpers.d.ts +21 -2
- package/lib/services/agent/runHelpers.d.ts.map +1 -1
- package/lib/services/agent/runHelpers.js +71 -2
- package/lib/services/agent/tools/animateImage.tool.d.ts +1 -0
- package/lib/services/agent/tools/animateImage.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/animateImage.tool.js +12 -0
- package/lib/services/agent/tools/chapterOutline.tool.d.ts +42 -0
- package/lib/services/agent/tools/chapterOutline.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/chapterOutline.tool.js +115 -0
- package/lib/services/agent/tools/composeScene.tool.d.ts +65 -2
- package/lib/services/agent/tools/composeScene.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/estimateCost.tool.d.ts +28 -1
- package/lib/services/agent/tools/estimateCost.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/estimateCost.tool.js +55 -7
- package/lib/services/agent/tools/extendVideo.tool.d.ts +26 -0
- package/lib/services/agent/tools/extendVideo.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/extendVideo.tool.js +149 -0
- package/lib/services/agent/tools/generateScript.tool.d.ts +184 -0
- package/lib/services/agent/tools/generateScript.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateScript.tool.js +123 -0
- package/lib/services/agent/tools/generateVideo.tool.d.ts +1 -0
- package/lib/services/agent/tools/generateVideo.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/generateVideo.tool.js +20 -1
- package/lib/services/agent/tools/index.d.ts +4 -0
- package/lib/services/agent/tools/index.d.ts.map +1 -1
- package/lib/services/agent/tools/index.js +4 -0
- package/lib/services/agent/tools/matchBrollToScript.tool.d.ts +50 -0
- package/lib/services/agent/tools/matchBrollToScript.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/matchBrollToScript.tool.js +139 -0
- package/lib/services/agent/tools/planVideo.tool.d.ts +57 -1
- package/lib/services/agent/tools/planVideo.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/planVideo.tool.js +3 -3
- package/lib/services/agent/tools/render.tool.d.ts +22 -1
- package/lib/services/agent/tools/render.tool.d.ts.map +1 -1
- package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
- package/lib/services/aiGen/aiGenFactory.service.js +18 -3
- package/lib/services/aiGen/helpers.d.ts +8 -0
- package/lib/services/aiGen/helpers.d.ts.map +1 -1
- package/lib/services/aiGen/helpers.js +12 -0
- package/lib/services/aiGen/providers/anthropic/anthropic.service.d.ts +26 -0
- package/lib/services/aiGen/providers/anthropic/anthropic.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/anthropic/anthropic.service.js +95 -0
- package/lib/services/aiGen/providers/google/google.service.d.ts +25 -1
- package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/google/google.service.js +136 -237
- package/lib/services/aiGen/providers/google/googleApiKeys.d.ts +71 -0
- package/lib/services/aiGen/providers/google/googleApiKeys.d.ts.map +1 -0
- package/lib/services/aiGen/providers/google/googleApiKeys.js +137 -0
- package/lib/services/aiGen/providers/google/googleErrors.d.ts +13 -0
- package/lib/services/aiGen/providers/google/googleErrors.d.ts.map +1 -0
- package/lib/services/aiGen/providers/google/googleErrors.js +102 -0
- package/lib/services/aiGen/providers/google/googleFetch.d.ts +8 -0
- package/lib/services/aiGen/providers/google/googleFetch.d.ts.map +1 -0
- package/lib/services/aiGen/providers/google/googleFetch.js +96 -0
- package/lib/services/aiGen/providers/google/googleKeyPool.d.ts +52 -0
- package/lib/services/aiGen/providers/google/googleKeyPool.d.ts.map +1 -0
- package/lib/services/aiGen/providers/google/googleKeyPool.js +129 -0
- package/lib/services/aiGen/providers/google/googleMusic.d.ts +15 -0
- package/lib/services/aiGen/providers/google/googleMusic.d.ts.map +1 -0
- package/lib/services/aiGen/providers/google/googleMusic.js +77 -0
- package/lib/services/aiGen/providers/kling/kling.service.d.ts +7 -3
- package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/kling/kling.service.js +23 -367
- package/lib/services/aiGen/providers/kling/klingCredits.d.ts +9 -0
- package/lib/services/aiGen/providers/kling/klingCredits.d.ts.map +1 -0
- package/lib/services/aiGen/providers/kling/klingCredits.js +63 -0
- package/lib/services/aiGen/providers/kling/klingRequests.d.ts +32 -0
- package/lib/services/aiGen/providers/kling/klingRequests.d.ts.map +1 -0
- package/lib/services/aiGen/providers/kling/klingRequests.js +194 -0
- package/lib/services/aiGen/providers/kling/klingStatus.d.ts +16 -0
- package/lib/services/aiGen/providers/kling/klingStatus.d.ts.map +1 -0
- package/lib/services/aiGen/providers/kling/klingStatus.js +173 -0
- package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/pixverse/pixverse.service.js +7 -1
- package/lib/services/bullmq.service.d.ts +61 -0
- package/lib/services/bullmq.service.d.ts.map +1 -1
- package/lib/services/bullmq.service.js +124 -2
- package/lib/services/crypto/index.d.ts +2 -0
- package/lib/services/crypto/index.d.ts.map +1 -0
- package/lib/services/crypto/index.js +17 -0
- package/lib/services/crypto/tokenVault.d.ts +47 -0
- package/lib/services/crypto/tokenVault.d.ts.map +1 -0
- package/lib/services/crypto/tokenVault.js +179 -0
- package/lib/services/editor/captionStyleHint.d.ts +3 -0
- package/lib/services/editor/captionStyleHint.d.ts.map +1 -0
- package/lib/services/editor/captionStyleHint.js +112 -0
- package/lib/services/editor/planToProject.d.ts +7 -66
- package/lib/services/editor/planToProject.d.ts.map +1 -1
- package/lib/services/editor/planToProject.helpers.d.ts +40 -0
- package/lib/services/editor/planToProject.helpers.d.ts.map +1 -0
- package/lib/services/editor/planToProject.helpers.js +177 -0
- package/lib/services/editor/planToProject.js +197 -180
- package/lib/services/editor/planToProject.types.d.ts +94 -0
- package/lib/services/editor/planToProject.types.d.ts.map +1 -0
- package/lib/services/editor/planToProject.types.js +2 -0
- package/lib/services/firestore.service.d.ts +5 -0
- package/lib/services/firestore.service.d.ts.map +1 -1
- package/lib/services/firestore.service.js +13 -0
- package/lib/services/index.d.ts +13 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +13 -0
- package/lib/services/promptEnhancer/index.d.ts +18 -0
- package/lib/services/promptEnhancer/index.d.ts.map +1 -0
- package/lib/services/promptEnhancer/index.js +33 -0
- package/lib/services/promptEnhancer/models.d.ts +54 -0
- package/lib/services/promptEnhancer/models.d.ts.map +1 -0
- package/lib/services/promptEnhancer/models.js +37 -0
- package/lib/services/promptEnhancer/profiles/agent.profile.d.ts +14 -0
- package/lib/services/promptEnhancer/profiles/agent.profile.d.ts.map +1 -0
- package/lib/services/promptEnhancer/profiles/agent.profile.js +40 -0
- package/lib/services/promptEnhancer/profiles/avatar.profile.d.ts +13 -0
- package/lib/services/promptEnhancer/profiles/avatar.profile.d.ts.map +1 -0
- package/lib/services/promptEnhancer/profiles/avatar.profile.js +40 -0
- package/lib/services/promptEnhancer/profiles/base.d.ts +28 -0
- package/lib/services/promptEnhancer/profiles/base.d.ts.map +1 -0
- package/lib/services/promptEnhancer/profiles/base.js +35 -0
- package/lib/services/promptEnhancer/profiles/image.profile.d.ts +11 -0
- package/lib/services/promptEnhancer/profiles/image.profile.d.ts.map +1 -0
- package/lib/services/promptEnhancer/profiles/image.profile.js +42 -0
- package/lib/services/promptEnhancer/profiles/index.d.ts +12 -0
- package/lib/services/promptEnhancer/profiles/index.d.ts.map +1 -0
- package/lib/services/promptEnhancer/profiles/index.js +33 -0
- package/lib/services/promptEnhancer/profiles/video.profile.d.ts +15 -0
- package/lib/services/promptEnhancer/profiles/video.profile.d.ts.map +1 -0
- package/lib/services/promptEnhancer/profiles/video.profile.js +81 -0
- package/lib/services/promptEnhancer/promptEnhancer.service.d.ts +45 -0
- package/lib/services/promptEnhancer/promptEnhancer.service.d.ts.map +1 -0
- package/lib/services/promptEnhancer/promptEnhancer.service.js +157 -0
- package/lib/services/promptEnhancer/schema.d.ts +19 -0
- package/lib/services/promptEnhancer/schema.d.ts.map +1 -0
- package/lib/services/promptEnhancer/schema.js +43 -0
- package/lib/services/promptEnhancer/types.d.ts +112 -0
- package/lib/services/promptEnhancer/types.d.ts.map +1 -0
- package/lib/services/promptEnhancer/types.js +2 -0
- package/lib/services/rateLimiter/distributedRateLimiter.service.d.ts +60 -5
- package/lib/services/rateLimiter/distributedRateLimiter.service.d.ts.map +1 -1
- package/lib/services/rateLimiter/distributedRateLimiter.service.js +184 -16
- package/lib/services/socialAI/captionGen.d.ts +81 -0
- package/lib/services/socialAI/captionGen.d.ts.map +1 -0
- package/lib/services/socialAI/captionGen.js +206 -0
- package/lib/services/socialAI/hookScore.d.ts +85 -0
- package/lib/services/socialAI/hookScore.d.ts.map +1 -0
- package/lib/services/socialAI/hookScore.js +170 -0
- package/lib/services/socialAI/index.d.ts +3 -0
- package/lib/services/socialAI/index.d.ts.map +1 -0
- package/lib/services/socialAI/index.js +18 -0
- package/lib/services/socialAccounts/index.d.ts +2 -0
- package/lib/services/socialAccounts/index.d.ts.map +1 -0
- package/lib/services/socialAccounts/index.js +17 -0
- package/lib/services/socialAccounts/socialAccountService.d.ts +25 -0
- package/lib/services/socialAccounts/socialAccountService.d.ts.map +1 -0
- package/lib/services/socialAccounts/socialAccountService.js +105 -0
- package/lib/services/socialEngage/factory.d.ts +7 -0
- package/lib/services/socialEngage/factory.d.ts.map +1 -0
- package/lib/services/socialEngage/factory.js +25 -0
- package/lib/services/socialEngage/index.d.ts +6 -0
- package/lib/services/socialEngage/index.d.ts.map +1 -0
- package/lib/services/socialEngage/index.js +21 -0
- package/lib/services/socialEngage/meta.engage.d.ts +17 -0
- package/lib/services/socialEngage/meta.engage.d.ts.map +1 -0
- package/lib/services/socialEngage/meta.engage.js +128 -0
- package/lib/services/socialEngage/metaWebhook.d.ts +50 -0
- package/lib/services/socialEngage/metaWebhook.d.ts.map +1 -0
- package/lib/services/socialEngage/metaWebhook.js +93 -0
- package/lib/services/socialEngage/types.d.ts +72 -0
- package/lib/services/socialEngage/types.d.ts.map +1 -0
- package/lib/services/socialEngage/types.js +10 -0
- package/lib/services/socialEngage/youtube.engage.d.ts +9 -0
- package/lib/services/socialEngage/youtube.engage.d.ts.map +1 -0
- package/lib/services/socialEngage/youtube.engage.js +87 -0
- package/lib/services/socialFormat/aspectGeometry.d.ts +74 -0
- package/lib/services/socialFormat/aspectGeometry.d.ts.map +1 -0
- package/lib/services/socialFormat/aspectGeometry.js +135 -0
- package/lib/services/socialFormat/index.d.ts +2 -0
- package/lib/services/socialFormat/index.d.ts.map +1 -0
- package/lib/services/socialFormat/index.js +19 -0
- package/lib/services/socialInsights/index.d.ts +3 -0
- package/lib/services/socialInsights/index.d.ts.map +1 -0
- package/lib/services/socialInsights/index.js +18 -0
- package/lib/services/socialInsights/recommendations.d.ts +131 -0
- package/lib/services/socialInsights/recommendations.d.ts.map +1 -0
- package/lib/services/socialInsights/recommendations.js +277 -0
- package/lib/services/socialInsights/timeBuckets.d.ts +35 -0
- package/lib/services/socialInsights/timeBuckets.d.ts.map +1 -0
- package/lib/services/socialInsights/timeBuckets.js +78 -0
- package/lib/services/socialMetrics/factory.d.ts +5 -0
- package/lib/services/socialMetrics/factory.d.ts.map +1 -0
- package/lib/services/socialMetrics/factory.js +24 -0
- package/lib/services/socialMetrics/index.d.ts +6 -0
- package/lib/services/socialMetrics/index.d.ts.map +1 -0
- package/lib/services/socialMetrics/index.js +21 -0
- package/lib/services/socialMetrics/meta.metrics.d.ts +22 -0
- package/lib/services/socialMetrics/meta.metrics.d.ts.map +1 -0
- package/lib/services/socialMetrics/meta.metrics.js +137 -0
- package/lib/services/socialMetrics/tiktok.metrics.d.ts +8 -0
- package/lib/services/socialMetrics/tiktok.metrics.d.ts.map +1 -0
- package/lib/services/socialMetrics/tiktok.metrics.js +43 -0
- package/lib/services/socialMetrics/types.d.ts +54 -0
- package/lib/services/socialMetrics/types.d.ts.map +1 -0
- package/lib/services/socialMetrics/types.js +2 -0
- package/lib/services/socialMetrics/youtube.metrics.d.ts +8 -0
- package/lib/services/socialMetrics/youtube.metrics.d.ts.map +1 -0
- package/lib/services/socialMetrics/youtube.metrics.js +43 -0
- package/lib/services/socialOAuth/factory.d.ts +7 -0
- package/lib/services/socialOAuth/factory.d.ts.map +1 -0
- package/lib/services/socialOAuth/factory.js +42 -0
- package/lib/services/socialOAuth/index.d.ts +11 -0
- package/lib/services/socialOAuth/index.d.ts.map +1 -0
- package/lib/services/socialOAuth/index.js +26 -0
- package/lib/services/socialOAuth/linkedin.oauth.d.ts +14 -0
- package/lib/services/socialOAuth/linkedin.oauth.d.ts.map +1 -0
- package/lib/services/socialOAuth/linkedin.oauth.js +127 -0
- package/lib/services/socialOAuth/meta.oauth.d.ts +31 -0
- package/lib/services/socialOAuth/meta.oauth.d.ts.map +1 -0
- package/lib/services/socialOAuth/meta.oauth.js +214 -0
- package/lib/services/socialOAuth/oauthState.d.ts +14 -0
- package/lib/services/socialOAuth/oauthState.d.ts.map +1 -0
- package/lib/services/socialOAuth/oauthState.js +66 -0
- package/lib/services/socialOAuth/pinterest.oauth.d.ts +15 -0
- package/lib/services/socialOAuth/pinterest.oauth.d.ts.map +1 -0
- package/lib/services/socialOAuth/pinterest.oauth.js +126 -0
- package/lib/services/socialOAuth/threads.oauth.d.ts +14 -0
- package/lib/services/socialOAuth/threads.oauth.d.ts.map +1 -0
- package/lib/services/socialOAuth/threads.oauth.js +129 -0
- package/lib/services/socialOAuth/tiktok.oauth.d.ts +15 -0
- package/lib/services/socialOAuth/tiktok.oauth.d.ts.map +1 -0
- package/lib/services/socialOAuth/tiktok.oauth.js +151 -0
- package/lib/services/socialOAuth/types.d.ts +67 -0
- package/lib/services/socialOAuth/types.d.ts.map +1 -0
- package/lib/services/socialOAuth/types.js +2 -0
- package/lib/services/socialOAuth/x.oauth.d.ts +17 -0
- package/lib/services/socialOAuth/x.oauth.d.ts.map +1 -0
- package/lib/services/socialOAuth/x.oauth.js +134 -0
- package/lib/services/socialOAuth/youtube.oauth.d.ts +15 -0
- package/lib/services/socialOAuth/youtube.oauth.d.ts.map +1 -0
- package/lib/services/socialOAuth/youtube.oauth.js +156 -0
- package/lib/services/socialPublish/factory.d.ts +5 -0
- package/lib/services/socialPublish/factory.d.ts.map +1 -0
- package/lib/services/socialPublish/factory.js +32 -0
- package/lib/services/socialPublish/index.d.ts +10 -0
- package/lib/services/socialPublish/index.d.ts.map +1 -0
- package/lib/services/socialPublish/index.js +25 -0
- package/lib/services/socialPublish/linkedin.publish.d.ts +9 -0
- package/lib/services/socialPublish/linkedin.publish.d.ts.map +1 -0
- package/lib/services/socialPublish/linkedin.publish.js +143 -0
- package/lib/services/socialPublish/meta.publish.d.ts +28 -0
- package/lib/services/socialPublish/meta.publish.d.ts.map +1 -0
- package/lib/services/socialPublish/meta.publish.js +149 -0
- package/lib/services/socialPublish/pinterest.publish.d.ts +13 -0
- package/lib/services/socialPublish/pinterest.publish.d.ts.map +1 -0
- package/lib/services/socialPublish/pinterest.publish.js +130 -0
- package/lib/services/socialPublish/threads.publish.d.ts +12 -0
- package/lib/services/socialPublish/threads.publish.d.ts.map +1 -0
- package/lib/services/socialPublish/threads.publish.js +96 -0
- package/lib/services/socialPublish/tiktok.publish.d.ts +13 -0
- package/lib/services/socialPublish/tiktok.publish.d.ts.map +1 -0
- package/lib/services/socialPublish/tiktok.publish.js +118 -0
- package/lib/services/socialPublish/types.d.ts +47 -0
- package/lib/services/socialPublish/types.d.ts.map +1 -0
- package/lib/services/socialPublish/types.js +2 -0
- package/lib/services/socialPublish/x.publish.d.ts +12 -0
- package/lib/services/socialPublish/x.publish.d.ts.map +1 -0
- package/lib/services/socialPublish/x.publish.js +147 -0
- package/lib/services/socialPublish/youtube.publish.d.ts +9 -0
- package/lib/services/socialPublish/youtube.publish.d.ts.map +1 -0
- package/lib/services/socialPublish/youtube.publish.js +107 -0
- package/lib/services/stock/index.d.ts +2 -0
- package/lib/services/stock/index.d.ts.map +1 -0
- package/lib/services/stock/index.js +17 -0
- package/lib/services/stock/realPersonSafety.d.ts +99 -0
- package/lib/services/stock/realPersonSafety.d.ts.map +1 -0
- package/lib/services/stock/realPersonSafety.js +248 -0
- package/lib/services/translation/index.d.ts +2 -0
- package/lib/services/translation/index.d.ts.map +1 -0
- package/lib/services/translation/index.js +9 -0
- package/lib/services/translation/translation.service.d.ts +50 -0
- package/lib/services/translation/translation.service.d.ts.map +1 -0
- package/lib/services/translation/translation.service.js +211 -0
- package/lib/utils/helpers.d.ts +2 -4
- package/lib/utils/helpers.d.ts.map +1 -1
- package/lib/utils/helpers.js +9 -63
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/renderTier.d.ts +26 -0
- package/lib/utils/renderTier.d.ts.map +1 -0
- package/lib/utils/renderTier.js +34 -0
- package/package.json +1 -1
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { BaseAiGenProviderService } from "../baseAiGenProvider.service";
|
|
2
2
|
import { CreditUsageParams, VideoGenerationParams, VideoGenerationResult, VideoStatusParams, VideoStatusResult } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Kling provider. This class is the transport (JWT auth, IPv4-pinned agents,
|
|
5
|
+
* timeout/retry) plus the per-endpoint submit dispatch. Request-body building
|
|
6
|
+
* lives in ./klingRequests, status polling + result stashing in ./klingStatus,
|
|
7
|
+
* and credit math in ./klingCredits.
|
|
8
|
+
*/
|
|
3
9
|
export declare class KlingService extends BaseAiGenProviderService {
|
|
4
10
|
private readonly baseUrl;
|
|
5
11
|
private readonly generateTimeout;
|
|
@@ -21,9 +27,7 @@ export declare class KlingService extends BaseAiGenProviderService {
|
|
|
21
27
|
private generateAvatarVideo;
|
|
22
28
|
private requestWithTimeoutRetry;
|
|
23
29
|
checkVideoStatus(params: VideoStatusParams): Promise<VideoStatusResult>;
|
|
24
|
-
private checkRegularVideoStatus;
|
|
25
|
-
private checkAvatarVideoStatus;
|
|
26
30
|
encodeJwtToken(): string;
|
|
27
|
-
getCreditUsed(
|
|
31
|
+
getCreditUsed(params: CreditUsageParams): number;
|
|
28
32
|
}
|
|
29
33
|
//# sourceMappingURL=kling.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kling.service.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/kling/kling.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kling.service.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/kling/kling.service.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAsBlB;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,wBAAwB;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;IAC/D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IASxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkD;IAC9E,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmD;;YAWlE,OAAO;IAgCf,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IAoDjC;;;;OAIG;YACW,WAAW;YA6BX,iBAAiB;YA6BjB,qBAAqB;YAgCrB,eAAe;YAkDf,mBAAmB;YAgCnB,uBAAuB;IAwF/B,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAW7E,cAAc,IAAI,MAAM;IAexB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM;CAGjD"}
|
|
@@ -11,14 +11,19 @@ const https_1 = __importDefault(require("https"));
|
|
|
11
11
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
12
12
|
const aiModels_1 = require("../../../../globals/aiModels");
|
|
13
13
|
const types_1 = require("../../../../globals/types");
|
|
14
|
-
const firebase_1 = require("../../../../libs/firebase");
|
|
15
14
|
const logger_1 = require("../../../../utils/logger");
|
|
16
15
|
const helpers_1 = require("../../helpers");
|
|
17
|
-
const types_2 = require("../../types");
|
|
18
16
|
const baseAiGenProvider_service_1 = require("../baseAiGenProvider.service");
|
|
19
|
-
const helpers_2 = require("../../../../utils/helpers");
|
|
20
17
|
const errors_1 = require("../../../../utils/errors");
|
|
21
|
-
const
|
|
18
|
+
const klingRequests_1 = require("./klingRequests");
|
|
19
|
+
const klingCredits_1 = require("./klingCredits");
|
|
20
|
+
const klingStatus_1 = require("./klingStatus");
|
|
21
|
+
/**
|
|
22
|
+
* Kling provider. This class is the transport (JWT auth, IPv4-pinned agents,
|
|
23
|
+
* timeout/retry) plus the per-endpoint submit dispatch. Request-body building
|
|
24
|
+
* lives in ./klingRequests, status polling + result stashing in ./klingStatus,
|
|
25
|
+
* and credit math in ./klingCredits.
|
|
26
|
+
*/
|
|
22
27
|
class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService {
|
|
23
28
|
constructor() {
|
|
24
29
|
super();
|
|
@@ -78,67 +83,9 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
78
83
|
const modelId = aiModels_1.aiModelConfigs[params.modelKey]?.modelId;
|
|
79
84
|
if (!modelId)
|
|
80
85
|
throw new Error(`Unknown modelKey: ${params.modelKey}`);
|
|
81
|
-
// Common optional fields shared by text2video and image2video endpoints.
|
|
82
|
-
const optional = {};
|
|
83
|
-
if (params.negativePrompt)
|
|
84
|
-
optional.negative_prompt = params.negativePrompt;
|
|
85
|
-
if (params.cfgScale !== undefined)
|
|
86
|
-
optional.cfg_scale = params.cfgScale;
|
|
87
|
-
if (params.callbackUrl)
|
|
88
|
-
optional.callback_url = params.callbackUrl;
|
|
89
|
-
if (params.externalTaskId)
|
|
90
|
-
optional.external_task_id = params.externalTaskId;
|
|
91
|
-
if (params.cameraControl) {
|
|
92
|
-
const cc = (0, cameraAdapter_1.toKlingCameraControl)(params.cameraControl);
|
|
93
|
-
if (cc)
|
|
94
|
-
optional.camera_control = cc;
|
|
95
|
-
}
|
|
96
|
-
// v2.6 uses `sound: "on"|"off"` as a pricing-tier toggle. v3 uses
|
|
97
|
-
// `generate_audio: boolean` for native audio synthesis. Route by model.
|
|
98
|
-
if (params.audio !== undefined) {
|
|
99
|
-
if (params.modelKey === "kling-v3.0") {
|
|
100
|
-
optional.generate_audio = Boolean(params.audio);
|
|
101
|
-
}
|
|
102
|
-
else if (params.modelKey === "kling-v2.6") {
|
|
103
|
-
optional.sound = params.audio ? "on" : "off";
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
86
|
const isImageToVideo = !!params.inputImageUrl;
|
|
107
87
|
const endpoint = isImageToVideo ? "/v1/videos/image2video" : "/v1/videos/text2video";
|
|
108
|
-
|
|
109
|
-
if (isImageToVideo) {
|
|
110
|
-
const i2v = {
|
|
111
|
-
model_name: modelId,
|
|
112
|
-
prompt: params.prompt,
|
|
113
|
-
image: params.inputImageUrl,
|
|
114
|
-
duration: params.duration || 5,
|
|
115
|
-
mode: params.mode || types_2.EVideoMode.STANDARD,
|
|
116
|
-
...optional,
|
|
117
|
-
};
|
|
118
|
-
if (params.aspectRatio)
|
|
119
|
-
i2v.aspect_ratio = params.aspectRatio;
|
|
120
|
-
if (params.lastFrameImageUrl)
|
|
121
|
-
i2v.image_tail = params.lastFrameImageUrl;
|
|
122
|
-
if (params.staticMaskUrl)
|
|
123
|
-
i2v.static_mask = params.staticMaskUrl;
|
|
124
|
-
if (params.dynamicMasks?.length) {
|
|
125
|
-
i2v.dynamic_masks = params.dynamicMasks.slice(0, 6).map((d) => ({
|
|
126
|
-
mask: d.maskUrl,
|
|
127
|
-
trajectories: d.trajectories,
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
request = i2v;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
request = {
|
|
134
|
-
model_name: modelId,
|
|
135
|
-
prompt: params.prompt,
|
|
136
|
-
aspect_ratio: params.aspectRatio || "16:9",
|
|
137
|
-
duration: params.duration || 5,
|
|
138
|
-
mode: params.mode || types_2.EVideoMode.STANDARD,
|
|
139
|
-
...optional,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
88
|
+
const request = (0, klingRequests_1.buildVideoGenerateRequest)(params, modelId);
|
|
142
89
|
const starttime = Date.now();
|
|
143
90
|
const task = await this.requestWithTimeoutRetry(endpoint, "POST", request, 4, this.generateTimeout);
|
|
144
91
|
logger_1.logger.info("Kling generateVideo submitted", {
|
|
@@ -157,17 +104,7 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
157
104
|
if (!params.sourceTaskId) {
|
|
158
105
|
throw new Error("sourceTaskId (prior Kling task id) is required for video extension");
|
|
159
106
|
}
|
|
160
|
-
const body =
|
|
161
|
-
if (params.prompt)
|
|
162
|
-
body.prompt = params.prompt;
|
|
163
|
-
if (params.negativePrompt)
|
|
164
|
-
body.negative_prompt = params.negativePrompt;
|
|
165
|
-
if (params.cfgScale !== undefined)
|
|
166
|
-
body.cfg_scale = params.cfgScale;
|
|
167
|
-
if (params.callbackUrl)
|
|
168
|
-
body.callback_url = params.callbackUrl;
|
|
169
|
-
if (params.externalTaskId)
|
|
170
|
-
body.external_task_id = params.externalTaskId;
|
|
107
|
+
const body = (0, klingRequests_1.buildExtendBody)(params);
|
|
171
108
|
const starttime = Date.now();
|
|
172
109
|
const task = await this.requestWithTimeoutRetry("/v1/videos/video-extend", "POST", body, 4, this.generateTimeout);
|
|
173
110
|
logger_1.logger.info("Kling extendVideo submitted", {
|
|
@@ -182,51 +119,7 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
182
119
|
const modelId = aiModels_1.aiModelConfigs[params.modelKey]?.modelId;
|
|
183
120
|
if (!modelId)
|
|
184
121
|
throw new Error(`Unknown modelKey: ${params.modelKey}`);
|
|
185
|
-
const body =
|
|
186
|
-
model_name: modelId,
|
|
187
|
-
mode: params.mode || types_2.EVideoMode.STANDARD,
|
|
188
|
-
duration: String(params.duration ?? 5),
|
|
189
|
-
};
|
|
190
|
-
if (params.prompt)
|
|
191
|
-
body.prompt = params.prompt;
|
|
192
|
-
if (params.aspectRatio)
|
|
193
|
-
body.aspect_ratio = params.aspectRatio;
|
|
194
|
-
if (params.callbackUrl)
|
|
195
|
-
body.callback_url = params.callbackUrl;
|
|
196
|
-
if (params.externalTaskId)
|
|
197
|
-
body.external_task_id = params.externalTaskId;
|
|
198
|
-
if (params.audio !== undefined)
|
|
199
|
-
body.sound = params.audio ? "on" : "off";
|
|
200
|
-
// Build image_list: start frame, end frame, plain reference images.
|
|
201
|
-
const imageList = [];
|
|
202
|
-
if (params.inputImageUrl) {
|
|
203
|
-
imageList.push({ image_url: params.inputImageUrl, type: "first_frame" });
|
|
204
|
-
}
|
|
205
|
-
if (params.lastFrameImageUrl) {
|
|
206
|
-
imageList.push({ image_url: params.lastFrameImageUrl, type: "end_frame" });
|
|
207
|
-
}
|
|
208
|
-
for (const url of params.referenceImageUrls ?? []) {
|
|
209
|
-
imageList.push({ image_url: url });
|
|
210
|
-
}
|
|
211
|
-
if (imageList.length)
|
|
212
|
-
body.image_list = imageList;
|
|
213
|
-
// Build video_list: reference videos (feature type) or base videos (editing).
|
|
214
|
-
if (params.referenceVideoUrls?.length) {
|
|
215
|
-
body.video_list = params.referenceVideoUrls.map((url) => ({
|
|
216
|
-
video_url: url,
|
|
217
|
-
refer_type: "feature",
|
|
218
|
-
}));
|
|
219
|
-
}
|
|
220
|
-
// Multi-shot support. MultiShot is Shot[] directly (not { shots: Shot[] }).
|
|
221
|
-
if (params.multiShot?.length) {
|
|
222
|
-
body.multi_shot = true;
|
|
223
|
-
body.shot_type = "customize";
|
|
224
|
-
body.multi_prompt = params.multiShot.map((s, i) => ({
|
|
225
|
-
index: i + 1,
|
|
226
|
-
prompt: s.prompt,
|
|
227
|
-
...(s.duration !== undefined ? { duration: String(s.duration) } : {}),
|
|
228
|
-
}));
|
|
229
|
-
}
|
|
122
|
+
const body = (0, klingRequests_1.buildOmniVideoBody)(params, modelId);
|
|
230
123
|
const starttime = Date.now();
|
|
231
124
|
const task = await this.requestWithTimeoutRetry("/v1/videos/omni-video", "POST", body, 4, this.generateTimeout);
|
|
232
125
|
logger_1.logger.info("Kling generateOmniVideo submitted", {
|
|
@@ -246,19 +139,7 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
246
139
|
throw new Error("inputVideoUrl (motion reference video) is required for motion control");
|
|
247
140
|
}
|
|
248
141
|
const modelId = aiModels_1.aiModelConfigs[params.modelKey]?.modelId ?? "kling-v3";
|
|
249
|
-
const body =
|
|
250
|
-
model_name: modelId,
|
|
251
|
-
image_url: params.inputImageUrl,
|
|
252
|
-
video_url: params.inputVideoUrl,
|
|
253
|
-
};
|
|
254
|
-
if (params.prompt)
|
|
255
|
-
body.prompt = params.prompt;
|
|
256
|
-
if (params.mode)
|
|
257
|
-
body.mode = params.mode;
|
|
258
|
-
if (params.callbackUrl)
|
|
259
|
-
body.callback_url = params.callbackUrl;
|
|
260
|
-
if (params.externalTaskId)
|
|
261
|
-
body.external_task_id = params.externalTaskId;
|
|
142
|
+
const body = (0, klingRequests_1.buildMotionControlBody)(params, modelId);
|
|
262
143
|
const starttime = Date.now();
|
|
263
144
|
const task = await this.requestWithTimeoutRetry("/v1/videos/motion-control", "POST", body, 4, this.generateTimeout);
|
|
264
145
|
logger_1.logger.info("Kling generateMotionControl submitted", {
|
|
@@ -286,21 +167,7 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
286
167
|
}
|
|
287
168
|
// Auto-select the first detected face.
|
|
288
169
|
const face = faceResp.data.face_data[0];
|
|
289
|
-
const
|
|
290
|
-
const lipSyncBody = {
|
|
291
|
-
session_id: faceResp.data.session_id,
|
|
292
|
-
face_choose: [{
|
|
293
|
-
face_id: face.face_id,
|
|
294
|
-
sound_file: params.inputAudioUrl,
|
|
295
|
-
sound_insert_time: face.start_time,
|
|
296
|
-
sound_start_time: 0,
|
|
297
|
-
sound_end_time: audioDurationMs,
|
|
298
|
-
sound_volume: 1,
|
|
299
|
-
original_audio_volume: 1,
|
|
300
|
-
}],
|
|
301
|
-
...(params.callbackUrl ? { callback_url: params.callbackUrl } : {}),
|
|
302
|
-
...(params.externalTaskId ? { external_task_id: params.externalTaskId } : {}),
|
|
303
|
-
};
|
|
170
|
+
const lipSyncBody = (0, klingRequests_1.buildLipSyncBody)(params, faceResp.data.session_id, face);
|
|
304
171
|
const starttime = Date.now();
|
|
305
172
|
const task = await this.requestWithTimeoutRetry("/v1/videos/advanced-lip-sync", "POST", lipSyncBody, 4, this.generateTimeout);
|
|
306
173
|
logger_1.logger.info("Kling generateLipSync submitted", {
|
|
@@ -318,14 +185,7 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
318
185
|
if (!params.inputAudioUrl) {
|
|
319
186
|
throw new Error("inputAudioUrl (audio file) is required for Kling Avatar generation");
|
|
320
187
|
}
|
|
321
|
-
const request =
|
|
322
|
-
image: params.inputImageUrl,
|
|
323
|
-
sound_file: params.inputAudioUrl,
|
|
324
|
-
prompt: params.prompt,
|
|
325
|
-
mode: params.mode || "std",
|
|
326
|
-
...(params.callbackUrl ? { callback_url: params.callbackUrl } : {}),
|
|
327
|
-
...(params.externalTaskId ? { external_task_id: params.externalTaskId } : {}),
|
|
328
|
-
};
|
|
188
|
+
const request = (0, klingRequests_1.buildAvatarRequest)(params);
|
|
329
189
|
const starttime = Date.now();
|
|
330
190
|
// Use requestWithTimeoutRetry so transient Kling server slowness doesn't fail the job outright.
|
|
331
191
|
// generateTimeout (2 min) gives enough headroom; up to 4 attempts before giving up.
|
|
@@ -408,171 +268,14 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
408
268
|
throw new Error("Unreachable");
|
|
409
269
|
}
|
|
410
270
|
async checkVideoStatus(params) {
|
|
271
|
+
const deps = {
|
|
272
|
+
request: this.requestWithTimeoutRetry.bind(this),
|
|
273
|
+
generateTimeout: this.generateTimeout,
|
|
274
|
+
};
|
|
411
275
|
if (params.modelKey === "kling-avatar") {
|
|
412
|
-
return
|
|
413
|
-
}
|
|
414
|
-
return this.checkRegularVideoStatus(params);
|
|
415
|
-
}
|
|
416
|
-
async checkRegularVideoStatus({ task, outputFilename, outputFilePath = "videos", }) {
|
|
417
|
-
const startTime = Date.now();
|
|
418
|
-
// Try each Kling status endpoint in order until one returns non-404.
|
|
419
|
-
// We don't persist which endpoint was used at submit time, so we probe all of them.
|
|
420
|
-
const statusEndpoints = [
|
|
421
|
-
`/v1/videos/text2video/${task}`,
|
|
422
|
-
`/v1/videos/image2video/${task}`,
|
|
423
|
-
`/v1/videos/video-extend/${task}`,
|
|
424
|
-
`/v1/videos/omni-video/${task}`,
|
|
425
|
-
`/v1/videos/motion-control/${task}`,
|
|
426
|
-
`/v1/videos/advanced-lip-sync/${task}`,
|
|
427
|
-
];
|
|
428
|
-
let result;
|
|
429
|
-
for (const ep of statusEndpoints) {
|
|
430
|
-
try {
|
|
431
|
-
result = await this.requestWithTimeoutRetry(ep, "GET");
|
|
432
|
-
break; // found it
|
|
433
|
-
}
|
|
434
|
-
catch (err) {
|
|
435
|
-
if (err.response?.status !== 404)
|
|
436
|
-
throw err;
|
|
437
|
-
// 404 → try next endpoint
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
if (!result) {
|
|
441
|
-
return {
|
|
442
|
-
status: types_1.EVideoSceneStatus.FAILED,
|
|
443
|
-
errorMessage: `Task ${task} not found on any Kling status endpoint`,
|
|
444
|
-
};
|
|
276
|
+
return (0, klingStatus_1.checkAvatarVideoStatus)(deps, params);
|
|
445
277
|
}
|
|
446
|
-
|
|
447
|
-
if (result.data.task_status === "succeed") {
|
|
448
|
-
const videoUrl = result.data.task_result?.videos?.[0]?.url;
|
|
449
|
-
if (!videoUrl) {
|
|
450
|
-
return {
|
|
451
|
-
status: types_1.EVideoSceneStatus.FAILED,
|
|
452
|
-
errorMessage: "No video URL in response",
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
// console.log("Kling video URL:", videoUrl);
|
|
456
|
-
const filePath = `${outputFilePath}/${outputFilename}.mp4`;
|
|
457
|
-
const file = (0, firebase_1.getBucket)().file(filePath);
|
|
458
|
-
// Download video using axios — use generateTimeout since video files can be large
|
|
459
|
-
const videoResp = await axios_1.default.get(videoUrl, {
|
|
460
|
-
responseType: "arraybuffer",
|
|
461
|
-
timeout: this.generateTimeout,
|
|
462
|
-
});
|
|
463
|
-
const buffer = Buffer.from(videoResp.data);
|
|
464
|
-
await file.save(buffer, { contentType: "video/mp4" });
|
|
465
|
-
const [signedUrl] = await file.getSignedUrl({
|
|
466
|
-
action: "read",
|
|
467
|
-
expires: "03-09-2491",
|
|
468
|
-
});
|
|
469
|
-
return {
|
|
470
|
-
videoUrl: signedUrl,
|
|
471
|
-
status: types_1.EVideoSceneStatus.COMPLETED,
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
if (result.data.task_status === "failed") {
|
|
475
|
-
return {
|
|
476
|
-
status: types_1.EVideoSceneStatus.FAILED,
|
|
477
|
-
errorMessage: result.data.task_status_msg || result.message || "Kling task failed (no reason provided)",
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
return { status: types_1.EVideoSceneStatus.PENDING };
|
|
481
|
-
}
|
|
482
|
-
async checkAvatarVideoStatus({ task, outputFilename, outputFilePath = "videos", }) {
|
|
483
|
-
const startTime = Date.now();
|
|
484
|
-
const result = await this.requestWithTimeoutRetry(`/v1/videos/avatar/image2video/${task}`, "GET");
|
|
485
|
-
logger_1.logger.info("Kling checkAvatarVideoStatus polled", { task, durationMs: Date.now() - startTime, status: result?.data?.task_status, statusMsg: result?.data?.task_status_msg || undefined });
|
|
486
|
-
if (!result) {
|
|
487
|
-
return {
|
|
488
|
-
status: types_1.EVideoSceneStatus.FAILED,
|
|
489
|
-
errorMessage: "No response from Kling Avatar API",
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
if (result.data.task_status === "succeed") {
|
|
493
|
-
const videoUrl = result.data.task_result?.videos?.[0]?.url;
|
|
494
|
-
if (!videoUrl) {
|
|
495
|
-
return {
|
|
496
|
-
status: types_1.EVideoSceneStatus.FAILED,
|
|
497
|
-
errorMessage: "No video URL in avatar response",
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
// Kling task is done. Now download from Kling's CDN, push to GCS, and
|
|
501
|
-
// mint a signed URL. Any of these three can hiccup (Kling CDN slow,
|
|
502
|
-
// GCS 503, signedURL service blip) — historically the whole call threw
|
|
503
|
-
// and the outer TaskPoller burned a poll attempt re-asking Kling for a
|
|
504
|
-
// status that's already known. Wrap the post-success work in its own
|
|
505
|
-
// bounded retry so a transient blip doesn't poison the poll loop.
|
|
506
|
-
const filePath = `${outputFilePath}/${outputFilename}.mp4`;
|
|
507
|
-
const file = (0, firebase_1.getBucket)().file(filePath);
|
|
508
|
-
const maxAttempts = 3;
|
|
509
|
-
let lastErr;
|
|
510
|
-
// Force IPv4 on the download. The Kling-returned video URL frequently
|
|
511
|
-
// resolves to a CDN host where IPv6 is broken or routes us to a
|
|
512
|
-
// geo-blocked PoP, producing an AggregateError(ETIMEDOUT) where both
|
|
513
|
-
// happy-eyeballs sockets fail. Pinning v4 avoids the IPv6 dead-end.
|
|
514
|
-
const v4Http = new http_1.default.Agent({ family: 4, keepAlive: true });
|
|
515
|
-
const v4Https = new https_1.default.Agent({ family: 4, keepAlive: true });
|
|
516
|
-
// Parse host so we can log which CDN we couldn't reach.
|
|
517
|
-
let downloadHost = "unknown";
|
|
518
|
-
try {
|
|
519
|
-
downloadHost = new URL(videoUrl).host;
|
|
520
|
-
}
|
|
521
|
-
catch {
|
|
522
|
-
/* leave as unknown */
|
|
523
|
-
}
|
|
524
|
-
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
525
|
-
try {
|
|
526
|
-
const videoResp = await axios_1.default.get(videoUrl, {
|
|
527
|
-
responseType: "arraybuffer",
|
|
528
|
-
timeout: this.generateTimeout,
|
|
529
|
-
httpAgent: v4Http,
|
|
530
|
-
httpsAgent: v4Https,
|
|
531
|
-
});
|
|
532
|
-
const buffer = Buffer.from(videoResp.data);
|
|
533
|
-
await file.save(buffer, { contentType: "video/mp4" });
|
|
534
|
-
const [signedUrl] = await file.getSignedUrl({
|
|
535
|
-
action: "read",
|
|
536
|
-
expires: "03-09-2491",
|
|
537
|
-
});
|
|
538
|
-
return {
|
|
539
|
-
videoUrl: signedUrl,
|
|
540
|
-
status: types_1.EVideoSceneStatus.COMPLETED,
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
catch (err) {
|
|
544
|
-
lastErr = err;
|
|
545
|
-
const isErr = err instanceof Error;
|
|
546
|
-
logger_1.logger.warn("Kling avatar post-success stash failed", {
|
|
547
|
-
task,
|
|
548
|
-
attempt,
|
|
549
|
-
maxAttempts,
|
|
550
|
-
downloadHost,
|
|
551
|
-
errName: isErr ? err.name : typeof err,
|
|
552
|
-
errCode: isErr ? err.code : undefined,
|
|
553
|
-
httpStatus: isErr ? err.response?.status : undefined,
|
|
554
|
-
msg: isErr ? err.message : String(err),
|
|
555
|
-
});
|
|
556
|
-
if (attempt < maxAttempts) {
|
|
557
|
-
await new Promise((r) => setTimeout(r, 2000 * 2 ** (attempt - 1)));
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
// All internal retries exhausted — surface as pending so the outer
|
|
562
|
-
// TaskPoller retries the WHOLE checkVideoStatus call (with its own
|
|
563
|
-
// budget). Throwing here would burn an outer attempt with no extra
|
|
564
|
-
// signal beyond what we already logged.
|
|
565
|
-
throw lastErr instanceof Error
|
|
566
|
-
? lastErr
|
|
567
|
-
: new Error(`Kling avatar stash failed after ${maxAttempts} attempts`);
|
|
568
|
-
}
|
|
569
|
-
if (result.data.task_status === "failed") {
|
|
570
|
-
return {
|
|
571
|
-
status: types_1.EVideoSceneStatus.FAILED,
|
|
572
|
-
errorMessage: result.data.task_status_msg || result.message || "Kling avatar task failed (no reason provided)",
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
return { status: types_1.EVideoSceneStatus.PENDING };
|
|
278
|
+
return (0, klingStatus_1.checkRegularVideoStatus)(deps, params);
|
|
576
279
|
}
|
|
577
280
|
encodeJwtToken() {
|
|
578
281
|
const payload = {
|
|
@@ -586,55 +289,8 @@ class KlingService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
586
289
|
};
|
|
587
290
|
return jsonwebtoken_1.default.sign(payload, process.env.KLING_SECRET_KEY, options);
|
|
588
291
|
}
|
|
589
|
-
getCreditUsed(
|
|
590
|
-
|
|
591
|
-
const applyFloor = !multiClip;
|
|
592
|
-
// Avatar: per-second pricing based on mode. Kling lipsync bills in
|
|
593
|
-
// 5-second increments (a 7s clip is billed as 10s).
|
|
594
|
-
if (modelKey === "kling-avatar") {
|
|
595
|
-
const perSecond = modelConfig?.cost?.perMode?.[mode]?.perSecond
|
|
596
|
-
?? modelConfig?.cost?.perMode?.["std"]?.perSecond
|
|
597
|
-
?? 0.014;
|
|
598
|
-
const billedSeconds = Math.ceil(duration / 5) * 5;
|
|
599
|
-
return (0, helpers_2.getCreditsFromCost)(perSecond * billedSeconds, applyFloor);
|
|
600
|
-
}
|
|
601
|
-
// v2.6 splits cost by audio/noAudio tier (audio is 2× upcharge).
|
|
602
|
-
if (modelKey === "kling-v2.6") {
|
|
603
|
-
const branch = audio ? modelConfig?.cost?.audio : modelConfig?.cost?.noAudio;
|
|
604
|
-
const cost = branch?.table?.[mode]?.[duration];
|
|
605
|
-
if (cost === undefined || cost === null) {
|
|
606
|
-
logger_1.logger.warn(`Kling getCreditUsed: no v2.6 cost entry for mode="${mode}" duration=${duration} audio=${audio} — returning fallback`, { modelKey, mode, duration, audio });
|
|
607
|
-
return (0, helpers_2.getCreditsFromCost)(1.0, applyFloor);
|
|
608
|
-
}
|
|
609
|
-
return (0, helpers_2.getCreditsFromCost)(cost, applyFloor);
|
|
610
|
-
}
|
|
611
|
-
const baseCost = modelConfig?.cost?.table?.[mode]?.[duration];
|
|
612
|
-
if (baseCost === undefined || baseCost === null) {
|
|
613
|
-
logger_1.logger.warn(`Kling getCreditUsed: no cost entry for modelKey="${modelKey}" mode="${mode}" duration=${duration} — returning fallback`, { modelKey, mode, duration });
|
|
614
|
-
return (0, helpers_2.getCreditsFromCost)(1.0, applyFloor);
|
|
615
|
-
}
|
|
616
|
-
// Deferred-table upcharges. The cost tables hold T2V / no-audio BASE rates;
|
|
617
|
-
// Kling bills more for two cases that don't have separate table keys yet
|
|
618
|
-
// (see config comments in globals/aiModels/providers/kling.ts):
|
|
619
|
-
// • I2V (image- or video-conditioned) → 1.5× on kling-video-o1 and
|
|
620
|
-
// kling-v3-omni-video (verified 2026-05-20: std $0.084→$0.126/s).
|
|
621
|
-
// • generate_audio=true → 1.5× on kling-v3.0.
|
|
622
|
-
// Applied here so the reconciled ACTUAL cost reflects them; without this the
|
|
623
|
-
// multi-clip (agent) path under-bills these calls (single clips are covered
|
|
624
|
-
// by the per-call floor regardless).
|
|
625
|
-
const I2V_UPCHARGE_MODELS = [
|
|
626
|
-
"kling-video-o1",
|
|
627
|
-
"kling-v3-omni-video",
|
|
628
|
-
];
|
|
629
|
-
let cost = baseCost;
|
|
630
|
-
if (I2V_UPCHARGE_MODELS.includes(modelKey) &&
|
|
631
|
-
(inputType === "image" || inputType === "video")) {
|
|
632
|
-
cost *= 1.5;
|
|
633
|
-
}
|
|
634
|
-
if (modelKey === "kling-v3.0" && audio) {
|
|
635
|
-
cost *= 1.5;
|
|
636
|
-
}
|
|
637
|
-
return (0, helpers_2.getCreditsFromCost)(cost, applyFloor);
|
|
292
|
+
getCreditUsed(params) {
|
|
293
|
+
return (0, klingCredits_1.getKlingCreditUsed)(params);
|
|
638
294
|
}
|
|
639
295
|
}
|
|
640
296
|
exports.KlingService = KlingService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CreditUsageParams } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Kling credit calculation. Pure (config lookup + arithmetic) — broken out of
|
|
4
|
+
* KlingService.getCreditUsed. Handles the three pricing shapes: avatar
|
|
5
|
+
* (per-second, 5s-rounded), v2.6 (audio/noAudio tier table), and the base
|
|
6
|
+
* table with deferred I2V / generate_audio upcharges.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getKlingCreditUsed({ modelKey, mode, duration, multiClip, audio, inputType, }: CreditUsageParams): number;
|
|
9
|
+
//# sourceMappingURL=klingCredits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"klingCredits.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/kling/klingCredits.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,IAA8B,EAC9B,QAAY,EACZ,SAAiB,EACjB,KAAa,EACb,SAAS,GACV,EAAE,iBAAiB,GAAG,MAAM,CAuD5B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKlingCreditUsed = getKlingCreditUsed;
|
|
4
|
+
const aiModels_1 = require("../../../../globals/aiModels");
|
|
5
|
+
const logger_1 = require("../../../../utils/logger");
|
|
6
|
+
const helpers_1 = require("../../../../utils/helpers");
|
|
7
|
+
const types_1 = require("../../types");
|
|
8
|
+
/**
|
|
9
|
+
* Kling credit calculation. Pure (config lookup + arithmetic) — broken out of
|
|
10
|
+
* KlingService.getCreditUsed. Handles the three pricing shapes: avatar
|
|
11
|
+
* (per-second, 5s-rounded), v2.6 (audio/noAudio tier table), and the base
|
|
12
|
+
* table with deferred I2V / generate_audio upcharges.
|
|
13
|
+
*/
|
|
14
|
+
function getKlingCreditUsed({ modelKey, mode = types_1.EVideoMode.PROFESSIONAL, duration = 5, multiClip = false, audio = false, inputType, }) {
|
|
15
|
+
const modelConfig = aiModels_1.aiModelConfigs[modelKey];
|
|
16
|
+
const applyFloor = !multiClip;
|
|
17
|
+
// Avatar: per-second pricing based on mode. Kling lipsync bills in
|
|
18
|
+
// 5-second increments (a 7s clip is billed as 10s).
|
|
19
|
+
if (modelKey === "kling-avatar") {
|
|
20
|
+
const perSecond = modelConfig?.cost?.perMode?.[mode]?.perSecond
|
|
21
|
+
?? modelConfig?.cost?.perMode?.["std"]?.perSecond
|
|
22
|
+
?? 0.014;
|
|
23
|
+
const billedSeconds = Math.ceil(duration / 5) * 5;
|
|
24
|
+
return (0, helpers_1.getCreditsFromCost)(perSecond * billedSeconds, applyFloor);
|
|
25
|
+
}
|
|
26
|
+
// v2.6 splits cost by audio/noAudio tier (audio is 2× upcharge).
|
|
27
|
+
if (modelKey === "kling-v2.6") {
|
|
28
|
+
const branch = audio ? modelConfig?.cost?.audio : modelConfig?.cost?.noAudio;
|
|
29
|
+
const cost = branch?.table?.[mode]?.[duration];
|
|
30
|
+
if (cost === undefined || cost === null) {
|
|
31
|
+
logger_1.logger.warn(`Kling getCreditUsed: no v2.6 cost entry for mode="${mode}" duration=${duration} audio=${audio} — returning fallback`, { modelKey, mode, duration, audio });
|
|
32
|
+
return (0, helpers_1.getCreditsFromCost)(1.0, applyFloor);
|
|
33
|
+
}
|
|
34
|
+
return (0, helpers_1.getCreditsFromCost)(cost, applyFloor);
|
|
35
|
+
}
|
|
36
|
+
const baseCost = modelConfig?.cost?.table?.[mode]?.[duration];
|
|
37
|
+
if (baseCost === undefined || baseCost === null) {
|
|
38
|
+
logger_1.logger.warn(`Kling getCreditUsed: no cost entry for modelKey="${modelKey}" mode="${mode}" duration=${duration} — returning fallback`, { modelKey, mode, duration });
|
|
39
|
+
return (0, helpers_1.getCreditsFromCost)(1.0, applyFloor);
|
|
40
|
+
}
|
|
41
|
+
// Deferred-table upcharges. The cost tables hold T2V / no-audio BASE rates;
|
|
42
|
+
// Kling bills more for two cases that don't have separate table keys yet
|
|
43
|
+
// (see config comments in globals/aiModels/providers/kling.ts):
|
|
44
|
+
// • I2V (image- or video-conditioned) → 1.5× on kling-video-o1 and
|
|
45
|
+
// kling-v3-omni-video (verified 2026-05-20: std $0.084→$0.126/s).
|
|
46
|
+
// • generate_audio=true → 1.5× on kling-v3.0.
|
|
47
|
+
// Applied here so the reconciled ACTUAL cost reflects them; without this the
|
|
48
|
+
// multi-clip (agent) path under-bills these calls (single clips are covered
|
|
49
|
+
// by the per-call floor regardless).
|
|
50
|
+
const I2V_UPCHARGE_MODELS = [
|
|
51
|
+
"kling-video-o1",
|
|
52
|
+
"kling-v3-omni-video",
|
|
53
|
+
];
|
|
54
|
+
let cost = baseCost;
|
|
55
|
+
if (I2V_UPCHARGE_MODELS.includes(modelKey) &&
|
|
56
|
+
(inputType === "image" || inputType === "video")) {
|
|
57
|
+
cost *= 1.5;
|
|
58
|
+
}
|
|
59
|
+
if (modelKey === "kling-v3.0" && audio) {
|
|
60
|
+
cost *= 1.5;
|
|
61
|
+
}
|
|
62
|
+
return (0, helpers_1.getCreditsFromCost)(cost, applyFloor);
|
|
63
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VideoGenerationParams } from "../types";
|
|
2
|
+
import { KlingAvatarGenerateRequest, KlingImageToVideoRequest, KlingLipSyncRequest, KlingMotionControlRequest, KlingOmniVideoRequest, KlingVideoGenerateRequest } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Pure request-body builders mapping our provider-agnostic
|
|
5
|
+
* VideoGenerationParams onto Kling's per-endpoint request shapes. No I/O —
|
|
6
|
+
* KlingService calls these, then submits the result. Keeping them here makes
|
|
7
|
+
* the per-endpoint field wiring testable in isolation and the service class a
|
|
8
|
+
* thin dispatcher.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* text2video / image2video body. Routes by the presence of inputImageUrl and
|
|
12
|
+
* wires the shared optional fields (negative prompt, cfg, camera control,
|
|
13
|
+
* audio/sound tier) plus the i2v-only mask / tail-frame fields.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildVideoGenerateRequest(params: VideoGenerationParams, modelId: string): KlingVideoGenerateRequest | KlingImageToVideoRequest;
|
|
16
|
+
/** Video-extend body (continue a prior Kling task by its video_id). */
|
|
17
|
+
export declare function buildExtendBody(params: VideoGenerationParams): Record<string, unknown>;
|
|
18
|
+
/** OmniVideo body: start/end/reference frames, reference videos, multi-shot. */
|
|
19
|
+
export declare function buildOmniVideoBody(params: VideoGenerationParams, modelId: string): KlingOmniVideoRequest;
|
|
20
|
+
/** Motion-control body (character image + motion reference video). */
|
|
21
|
+
export declare function buildMotionControlBody(params: VideoGenerationParams, modelId: string): KlingMotionControlRequest;
|
|
22
|
+
/** Avatar (image+audio → lipsync video) body. */
|
|
23
|
+
export declare function buildAvatarRequest(params: VideoGenerationParams): KlingAvatarGenerateRequest;
|
|
24
|
+
/**
|
|
25
|
+
* Advanced-lip-sync body. Takes the resolved face (from identify-face) and the
|
|
26
|
+
* session id; auto-selects the first detected face's window for the audio.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildLipSyncBody(params: VideoGenerationParams, sessionId: string, face: {
|
|
29
|
+
face_id: string;
|
|
30
|
+
start_time: number;
|
|
31
|
+
}): KlingLipSyncRequest;
|
|
32
|
+
//# sourceMappingURL=klingRequests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"klingRequests.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/kling/klingRequests.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAEL,0BAA0B,EAE1B,wBAAwB,EACxB,mBAAmB,EAEnB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AAEH;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,MAAM,GACd,yBAAyB,GAAG,wBAAwB,CAmDtD;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,qBAAqB,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,MAAM,GACd,qBAAqB,CA8CvB;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,MAAM,GACd,yBAAyB,CAW3B;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,GAC5B,0BAA0B,CAS5B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,qBAAqB,EAC7B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC5C,mBAAmB,CAgBrB"}
|