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
|
@@ -75,6 +75,14 @@ export declare const EvalBriefSchema: z.ZodObject<{
|
|
|
75
75
|
"4:5": "4:5";
|
|
76
76
|
"16:9": "16:9";
|
|
77
77
|
}>>;
|
|
78
|
+
lengthTier: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
S1: "S1";
|
|
80
|
+
S2: "S2";
|
|
81
|
+
M1: "M1";
|
|
82
|
+
L1: "L1";
|
|
83
|
+
L2: "L2";
|
|
84
|
+
L3: "L3";
|
|
85
|
+
}>>;
|
|
78
86
|
voice: z.ZodOptional<z.ZodObject<{
|
|
79
87
|
gender: z.ZodOptional<z.ZodEnum<{
|
|
80
88
|
male: "male";
|
|
@@ -134,12 +142,14 @@ export declare const EvalBriefSchema: z.ZodObject<{
|
|
|
134
142
|
transcriptExcerpt: z.ZodOptional<z.ZodString>;
|
|
135
143
|
}, z.core.$strip>>;
|
|
136
144
|
}, z.core.$strip>>>;
|
|
145
|
+
preferredModelKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
146
|
tierBudget: z.ZodDefault<z.ZodEnum<{
|
|
138
147
|
T0: "T0";
|
|
139
148
|
T1: "T1";
|
|
140
149
|
T2: "T2";
|
|
141
150
|
T3: "T3";
|
|
142
151
|
}>>;
|
|
152
|
+
maxSpendUSD: z.ZodOptional<z.ZodNumber>;
|
|
143
153
|
videoStrategy: z.ZodOptional<z.ZodEnum<{
|
|
144
154
|
auto: "auto";
|
|
145
155
|
direct: "direct";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/eval/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;GAUG;AAEH,4CAA4C;AAC5C,eAAO,MAAM,gBAAgB;;;;;;;iBAQ3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/eval/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;GAUG;AAEH,4CAA4C;AAC5C,eAAO,MAAM,gBAAgB;;;;;;;iBAQ3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;iBAY9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB;;;;iBAI5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;iBAQ1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { VideoPlan } from "../../../schemas/videoPlan.schema";
|
|
2
|
+
import { ToolContext } from "../toolRegistry";
|
|
3
|
+
import { ExecutorOptions, SceneOutcome } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Executor — turns an approved VideoPlan into per-scene asset results.
|
|
6
|
+
*
|
|
7
|
+
* Plan-then-execute split (not free-form ReAct): the executor does NOT pick
|
|
8
|
+
* tools. The plan dictates which tool runs per scene; the executor only does
|
|
9
|
+
* the dispatch + per-scene parallelism + idempotency-key generation.
|
|
10
|
+
*
|
|
11
|
+
* Returns a SceneOutcome per scene, leaving composition (compose_scene),
|
|
12
|
+
* critique (Critic.review), and render to the orchestrator above. The
|
|
13
|
+
* per-scene VISUAL strategy switch lives in ./visual (runVisual); the voice
|
|
14
|
+
* resolution helpers in ./voice; the public types in ./types.
|
|
15
|
+
*/
|
|
16
|
+
export declare class Executor {
|
|
17
|
+
private readonly concurrency;
|
|
18
|
+
private readonly runTool;
|
|
19
|
+
private readonly onSceneComplete?;
|
|
20
|
+
private readonly taskCache?;
|
|
21
|
+
private readonly onTaskMint?;
|
|
22
|
+
private readonly frozenVisualScenes?;
|
|
23
|
+
private readonly frozenVoiceoverScenes?;
|
|
24
|
+
/**
|
|
25
|
+
* AG-11b: per-run registry of each scene's generated identity still image,
|
|
26
|
+
* keyed by sceneIndex. One deferred per scene, created in run() before the
|
|
27
|
+
* worker pool starts. A scene that produces an identity image (image-* and
|
|
28
|
+
* the i2v first frame) resolves its own entry as soon as the image lands; a
|
|
29
|
+
* dependent scene (scene.characterAnchorSceneIndex set) awaits its anchor's
|
|
30
|
+
* entry and threads the URL in as an inputImage for image-to-image identity
|
|
31
|
+
* transfer. Every entry is settled (→ undefined if no image) when the scene
|
|
32
|
+
* completes, so a dependent never hangs on a stock/t2v/avatar/failed anchor.
|
|
33
|
+
*
|
|
34
|
+
* Deadlock-free: anchors point to EARLIER scenes (first appearance) and the
|
|
35
|
+
* queue is pulled in sceneIndex order, so a dependent's anchor is always
|
|
36
|
+
* already in-flight or done by the time the dependent is picked up.
|
|
37
|
+
*/
|
|
38
|
+
private identityImages?;
|
|
39
|
+
constructor(opts?: ExecutorOptions);
|
|
40
|
+
/**
|
|
41
|
+
* AG-11b: publish a scene's generated identity image so dependent scenes can
|
|
42
|
+
* anchor off it. Idempotent — first call wins (the still image is produced
|
|
43
|
+
* once per scene). No-op when the registry isn't initialised (e.g. runVisual
|
|
44
|
+
* driven outside run(), such as single-scene regen).
|
|
45
|
+
*/
|
|
46
|
+
private publishIdentityImage;
|
|
47
|
+
/**
|
|
48
|
+
* AG-11b: resolve the generated identity image of this scene's character
|
|
49
|
+
* anchor, or undefined when there's no anchor / no registry / the anchor
|
|
50
|
+
* produced no usable still (stock, pure t2v, avatar, or a failed scene).
|
|
51
|
+
* Self-references are ignored.
|
|
52
|
+
*/
|
|
53
|
+
private resolveAnchorIdentityImage;
|
|
54
|
+
/**
|
|
55
|
+
* Stage 7 slice 1 helper. Returns cached pending-task output if the
|
|
56
|
+
* upstream input hash matches and entry is within TTL; null otherwise.
|
|
57
|
+
* Logs the hit so trace shows where $$ was saved.
|
|
58
|
+
*/
|
|
59
|
+
private checkTaskCache;
|
|
60
|
+
/**
|
|
61
|
+
* Best-effort mint. Swallows callback errors — a Firestore blip must not
|
|
62
|
+
* fail the scene (the tool already succeeded and produced a real taskId).
|
|
63
|
+
*/
|
|
64
|
+
private mintTaskCache;
|
|
65
|
+
/** Bundle the bound helpers runVisual needs (see VisualDeps). */
|
|
66
|
+
private visualDeps;
|
|
67
|
+
run(plan: VideoPlan, ctx: ToolContext): Promise<SceneOutcome[]>;
|
|
68
|
+
private runScene;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/executor/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EAA6B,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAczE,OAAO,EAAE,eAAe,EAAa,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAqC;IACtE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAgC;IAC5D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAsB;IAC1D,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAsB;IAE7D;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,cAAc,CAAC,CAGrB;gBAEU,IAAI,GAAE,eAAoB;IAUtC;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;OAKG;YACW,0BAA0B;IAiBxC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAmBtB;;;OAGG;YACW,aAAa;IAe3B,iEAAiE;IACjE,OAAO,CAAC,UAAU;IAcZ,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YAiDvD,QAAQ;CA+GvB"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Executor = void 0;
|
|
4
|
+
const logger_1 = require("../../../utils/logger");
|
|
5
|
+
const toolRegistry_1 = require("../toolRegistry");
|
|
6
|
+
const ttsDuration_1 = require("../ttsDuration");
|
|
7
|
+
const providerTaskCache_1 = require("../providerTaskCache");
|
|
8
|
+
const voice_1 = require("./voice");
|
|
9
|
+
const visual_1 = require("./visual");
|
|
10
|
+
/**
|
|
11
|
+
* Executor — turns an approved VideoPlan into per-scene asset results.
|
|
12
|
+
*
|
|
13
|
+
* Plan-then-execute split (not free-form ReAct): the executor does NOT pick
|
|
14
|
+
* tools. The plan dictates which tool runs per scene; the executor only does
|
|
15
|
+
* the dispatch + per-scene parallelism + idempotency-key generation.
|
|
16
|
+
*
|
|
17
|
+
* Returns a SceneOutcome per scene, leaving composition (compose_scene),
|
|
18
|
+
* critique (Critic.review), and render to the orchestrator above. The
|
|
19
|
+
* per-scene VISUAL strategy switch lives in ./visual (runVisual); the voice
|
|
20
|
+
* resolution helpers in ./voice; the public types in ./types.
|
|
21
|
+
*/
|
|
22
|
+
class Executor {
|
|
23
|
+
constructor(opts = {}) {
|
|
24
|
+
this.concurrency = opts.concurrency ?? 4;
|
|
25
|
+
this.runTool = opts.runTool ?? toolRegistry_1.runTool;
|
|
26
|
+
this.onSceneComplete = opts.onSceneComplete;
|
|
27
|
+
this.taskCache = opts.taskCache;
|
|
28
|
+
this.onTaskMint = opts.onTaskMint;
|
|
29
|
+
this.frozenVisualScenes = opts.frozenVisualScenes;
|
|
30
|
+
this.frozenVoiceoverScenes = opts.frozenVoiceoverScenes;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* AG-11b: publish a scene's generated identity image so dependent scenes can
|
|
34
|
+
* anchor off it. Idempotent — first call wins (the still image is produced
|
|
35
|
+
* once per scene). No-op when the registry isn't initialised (e.g. runVisual
|
|
36
|
+
* driven outside run(), such as single-scene regen).
|
|
37
|
+
*/
|
|
38
|
+
publishIdentityImage(sceneIndex, url) {
|
|
39
|
+
this.identityImages?.get(sceneIndex)?.resolve(url);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* AG-11b: resolve the generated identity image of this scene's character
|
|
43
|
+
* anchor, or undefined when there's no anchor / no registry / the anchor
|
|
44
|
+
* produced no usable still (stock, pure t2v, avatar, or a failed scene).
|
|
45
|
+
* Self-references are ignored.
|
|
46
|
+
*/
|
|
47
|
+
async resolveAnchorIdentityImage(scene) {
|
|
48
|
+
const anchorIdx = scene.characterAnchorSceneIndex;
|
|
49
|
+
if (anchorIdx == null || anchorIdx === scene.sceneIndex)
|
|
50
|
+
return undefined;
|
|
51
|
+
const entry = this.identityImages?.get(anchorIdx);
|
|
52
|
+
if (!entry)
|
|
53
|
+
return undefined;
|
|
54
|
+
const url = await entry.promise;
|
|
55
|
+
if (url) {
|
|
56
|
+
logger_1.logger.info("executor: AG-11b anchoring scene to character reference", {
|
|
57
|
+
sceneIndex: scene.sceneIndex,
|
|
58
|
+
anchorSceneIndex: anchorIdx,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return url;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Stage 7 slice 1 helper. Returns cached pending-task output if the
|
|
65
|
+
* upstream input hash matches and entry is within TTL; null otherwise.
|
|
66
|
+
* Logs the hit so trace shows where $$ was saved.
|
|
67
|
+
*/
|
|
68
|
+
checkTaskCache(clipId, tool, input) {
|
|
69
|
+
const inputsHash = (0, providerTaskCache_1.hashTaskInputs)(input);
|
|
70
|
+
const hit = (0, providerTaskCache_1.getCachedTask)(this.taskCache, clipId, inputsHash);
|
|
71
|
+
if (hit) {
|
|
72
|
+
logger_1.logger.info("executor: task-cache hit", {
|
|
73
|
+
clipId,
|
|
74
|
+
tool,
|
|
75
|
+
modelKey: hit.modelKey,
|
|
76
|
+
taskId: hit.taskId,
|
|
77
|
+
ageMs: Date.now() - hit.createdAt,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return { hit, inputsHash };
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Best-effort mint. Swallows callback errors — a Firestore blip must not
|
|
84
|
+
* fail the scene (the tool already succeeded and produced a real taskId).
|
|
85
|
+
*/
|
|
86
|
+
async mintTaskCache(clipId, entry) {
|
|
87
|
+
if (!this.onTaskMint)
|
|
88
|
+
return;
|
|
89
|
+
try {
|
|
90
|
+
await this.onTaskMint(clipId, entry);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
logger_1.logger.warn("executor: onTaskMint callback threw — swallowed", {
|
|
94
|
+
clipId,
|
|
95
|
+
err: err.message,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/** Bundle the bound helpers runVisual needs (see VisualDeps). */
|
|
100
|
+
visualDeps() {
|
|
101
|
+
return {
|
|
102
|
+
runTool: this.runTool,
|
|
103
|
+
frozenVisualScenes: this.frozenVisualScenes,
|
|
104
|
+
checkTaskCache: (clipId, tool, input) => this.checkTaskCache(clipId, tool, input),
|
|
105
|
+
mintTaskCache: (clipId, entry) => this.mintTaskCache(clipId, entry),
|
|
106
|
+
publishIdentityImage: (sceneIndex, url) => this.publishIdentityImage(sceneIndex, url),
|
|
107
|
+
resolveAnchorIdentityImage: (scene) => this.resolveAnchorIdentityImage(scene),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
async run(plan, ctx) {
|
|
111
|
+
const queue = [...plan.scenes];
|
|
112
|
+
const results = new Array(plan.scenes.length);
|
|
113
|
+
const workers = [];
|
|
114
|
+
let cursor = 0;
|
|
115
|
+
// AG-11b: stand up one identity-image deferred per scene before the workers
|
|
116
|
+
// start, so a dependent scene can await its anchor's still even if the
|
|
117
|
+
// anchor hasn't produced it yet.
|
|
118
|
+
this.identityImages = new Map();
|
|
119
|
+
for (const scene of queue) {
|
|
120
|
+
let resolve;
|
|
121
|
+
const promise = new Promise((r) => {
|
|
122
|
+
resolve = r;
|
|
123
|
+
});
|
|
124
|
+
this.identityImages.set(scene.sceneIndex, { promise, resolve });
|
|
125
|
+
}
|
|
126
|
+
const worker = async () => {
|
|
127
|
+
while (true) {
|
|
128
|
+
const i = cursor++;
|
|
129
|
+
if (i >= queue.length)
|
|
130
|
+
return;
|
|
131
|
+
const scene = queue[i];
|
|
132
|
+
const outcome = await this.runScene(scene, ctx, plan.aspect, plan);
|
|
133
|
+
// AG-11b: ensure this scene's identity deferred is settled (→ undefined
|
|
134
|
+
// for strategies that never published an image) so dependents on it
|
|
135
|
+
// never hang.
|
|
136
|
+
this.publishIdentityImage(scene.sceneIndex, undefined);
|
|
137
|
+
results[i] = outcome;
|
|
138
|
+
if (this.onSceneComplete) {
|
|
139
|
+
try {
|
|
140
|
+
await this.onSceneComplete(scene.sceneIndex, outcome);
|
|
141
|
+
}
|
|
142
|
+
catch (err) {
|
|
143
|
+
logger_1.logger.warn("executor: onSceneComplete callback threw — swallowed", {
|
|
144
|
+
sceneIndex: scene.sceneIndex,
|
|
145
|
+
err: err.message,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
for (let i = 0; i < Math.min(this.concurrency, queue.length); i++) {
|
|
152
|
+
workers.push(worker());
|
|
153
|
+
}
|
|
154
|
+
await Promise.all(workers);
|
|
155
|
+
return results;
|
|
156
|
+
}
|
|
157
|
+
async runScene(scene, ctx, aspect, plan) {
|
|
158
|
+
const start = Date.now();
|
|
159
|
+
const idempotencyKey = `${ctx.agentRunId}:scene-${scene.sceneIndex}`;
|
|
160
|
+
const sceneCtx = { ...ctx, idempotencyKey };
|
|
161
|
+
const visualOutcome = await (0, visual_1.runVisual)(this.visualDeps(), scene, sceneCtx, aspect, plan);
|
|
162
|
+
if (!visualOutcome.ok) {
|
|
163
|
+
return {
|
|
164
|
+
scene,
|
|
165
|
+
ok: false,
|
|
166
|
+
error: visualOutcome.error,
|
|
167
|
+
durationMs: Date.now() - start,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
let voiceoverAudioBase64;
|
|
171
|
+
let voiceoverEstimateMs;
|
|
172
|
+
let voiceoverOverBudget = false;
|
|
173
|
+
// Gap #1 follow-up — skip-generation. VO preserved verbatim from a prior
|
|
174
|
+
// run: planToProject injects the frozen audio clip, so re-running TTS here
|
|
175
|
+
// just burns ElevenLabs credits for a result we discard.
|
|
176
|
+
const voiceoverFrozen = this.frozenVoiceoverScenes?.has(scene.sceneIndex) ?? false;
|
|
177
|
+
if (voiceoverFrozen) {
|
|
178
|
+
logger_1.logger.info("executor: skip-gen — voiceover frozen (preserved), no TTS call", {
|
|
179
|
+
sceneIndex: scene.sceneIndex,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// talking-head-avatar bakes the VO into the rendered MP4; running TTS again
|
|
183
|
+
// here would just waste credits and create a duplicate audio track.
|
|
184
|
+
if (scene.voiceoverLine && scene.strategy !== "talking-head-avatar" && !voiceoverFrozen) {
|
|
185
|
+
// AG-31: brief.voice.style → ElevenLabs voice_settings.
|
|
186
|
+
// AG-28: if estimated VO > scene.durationMs, speed up TTS within natural
|
|
187
|
+
// limits (≤1.15× extra over style.speed) before falling back to a
|
|
188
|
+
// freeze-frame-pad signal for the stitcher.
|
|
189
|
+
// AG-44: per-scene voiceStyle wins over plan-level when present, so the
|
|
190
|
+
// emotional arc can shift across the timeline (frustrated → curious → excited).
|
|
191
|
+
// AG-4: normalize freeform adjectives ('whispered', 'frustrated', …) onto
|
|
192
|
+
// the canonical VoiceStyle set before mapping to voice_settings, so the
|
|
193
|
+
// planned emotional arc isn't silently dropped on synonym drift.
|
|
194
|
+
const effectiveVoiceStyle = (0, voice_1.normalizeVoiceStyle)(scene.voiceStyle ?? plan.voiceStyle);
|
|
195
|
+
const baseSettings = (0, voice_1.resolveVoiceSettings)(effectiveVoiceStyle);
|
|
196
|
+
const baseSpeed = baseSettings.speed ?? 1.0;
|
|
197
|
+
const rawEstMs = (0, ttsDuration_1.estimateTtsMs)(scene.voiceoverLine);
|
|
198
|
+
const budgetMs = scene.durationMs * 1.05;
|
|
199
|
+
// Adjusted speed: only kick in if natural speech would overrun. Cap the
|
|
200
|
+
// speedup multiplier at 1.15× style-base; faster than that sounds rushed.
|
|
201
|
+
let speed = baseSpeed;
|
|
202
|
+
if (rawEstMs > budgetMs) {
|
|
203
|
+
const needed = rawEstMs / budgetMs;
|
|
204
|
+
const cappedMultiplier = Math.min(1.15, needed);
|
|
205
|
+
speed = +(baseSpeed * cappedMultiplier).toFixed(2);
|
|
206
|
+
}
|
|
207
|
+
const adjustedEstMs = rawEstMs * (baseSpeed / speed);
|
|
208
|
+
voiceoverEstimateMs = Math.round(adjustedEstMs);
|
|
209
|
+
voiceoverOverBudget = adjustedEstMs > budgetMs;
|
|
210
|
+
const voInput = {
|
|
211
|
+
text: scene.voiceoverLine,
|
|
212
|
+
...baseSettings,
|
|
213
|
+
// Override speed when AG-28 budget forced an adjustment.
|
|
214
|
+
speed: +Math.max(0.7, Math.min(1.2, speed)).toFixed(2),
|
|
215
|
+
};
|
|
216
|
+
const sanitized = (0, voice_1.sanitizeVoiceId)(plan.voiceId);
|
|
217
|
+
if (sanitized)
|
|
218
|
+
voInput.voiceId = sanitized;
|
|
219
|
+
const voOutcome = await this.runTool("generate_voiceover", voInput, { ...sceneCtx, idempotencyKey: `${idempotencyKey}:vo` });
|
|
220
|
+
if (voOutcome.ok) {
|
|
221
|
+
voiceoverAudioBase64 = voOutcome.output.audioBase64;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
// AG-37: don't swallow silently — final video shipping muted with no
|
|
225
|
+
// log was the original bug. Surface the error in the result so the
|
|
226
|
+
// trace shows WHY VO is missing.
|
|
227
|
+
logger_1.logger.warn("executor: voiceover tool failed", {
|
|
228
|
+
sceneIndex: scene.sceneIndex,
|
|
229
|
+
error: voOutcome.error,
|
|
230
|
+
voiceIdRequested: plan.voiceId,
|
|
231
|
+
voiceIdSent: sanitized,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
// Don't fail the whole scene on VO miss — host can re-run just the VO.
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
scene,
|
|
238
|
+
ok: true,
|
|
239
|
+
result: {
|
|
240
|
+
...visualOutcome.output,
|
|
241
|
+
voiceoverAudioBase64,
|
|
242
|
+
voiceoverEstimateMs,
|
|
243
|
+
voiceoverOverBudget,
|
|
244
|
+
idempotencyKey,
|
|
245
|
+
},
|
|
246
|
+
durationMs: Date.now() - start,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
exports.Executor = Executor;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OD-T7 / AG-42 — give the planner's `preferredModel` a chance to actually run
|
|
3
|
+
* when the scene duration is just slightly off from what the model accepts.
|
|
4
|
+
*
|
|
5
|
+
* Decision tree:
|
|
6
|
+
* 1. Model has no duration constraint → use planned duration
|
|
7
|
+
* 2. Planned duration already legal → use planned duration
|
|
8
|
+
* 3. Nearest legal is within snap tolerance → snap, log info
|
|
9
|
+
* 4. Outside tolerance + explicit preferredModel → log warn ("dropping
|
|
10
|
+
* planner pick — too far from any allowed value"); use planned duration
|
|
11
|
+
* anyway so the capability filter drops it and the chain fallback runs
|
|
12
|
+
* (the withFallback warn AG-42 also logs there now)
|
|
13
|
+
*
|
|
14
|
+
* We intentionally do NOT throw — throwing would crash a scene mid-run and
|
|
15
|
+
* lose all the other planner output. The graceful fallback chain already
|
|
16
|
+
* exists; this helper just keeps the planner's pick alive when the drift is
|
|
17
|
+
* small, and makes the drop visible when it isn't.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveDurationForPreferredModel(modelKey: string, plannedDurationSec: number, explicit: boolean, sceneIndex: number): number;
|
|
20
|
+
//# sourceMappingURL=duration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/executor/duration.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAsBR"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveDurationForPreferredModel = resolveDurationForPreferredModel;
|
|
4
|
+
const logger_1 = require("../../../utils/logger");
|
|
5
|
+
const chains_1 = require("../providerFallback/chains");
|
|
6
|
+
/**
|
|
7
|
+
* OD-T7 / AG-42 — give the planner's `preferredModel` a chance to actually run
|
|
8
|
+
* when the scene duration is just slightly off from what the model accepts.
|
|
9
|
+
*
|
|
10
|
+
* Decision tree:
|
|
11
|
+
* 1. Model has no duration constraint → use planned duration
|
|
12
|
+
* 2. Planned duration already legal → use planned duration
|
|
13
|
+
* 3. Nearest legal is within snap tolerance → snap, log info
|
|
14
|
+
* 4. Outside tolerance + explicit preferredModel → log warn ("dropping
|
|
15
|
+
* planner pick — too far from any allowed value"); use planned duration
|
|
16
|
+
* anyway so the capability filter drops it and the chain fallback runs
|
|
17
|
+
* (the withFallback warn AG-42 also logs there now)
|
|
18
|
+
*
|
|
19
|
+
* We intentionally do NOT throw — throwing would crash a scene mid-run and
|
|
20
|
+
* lose all the other planner output. The graceful fallback chain already
|
|
21
|
+
* exists; this helper just keeps the planner's pick alive when the drift is
|
|
22
|
+
* small, and makes the drop visible when it isn't.
|
|
23
|
+
*/
|
|
24
|
+
function resolveDurationForPreferredModel(modelKey, plannedDurationSec, explicit, sceneIndex) {
|
|
25
|
+
const snap = (0, chains_1.snapDurationForModel)(modelKey, plannedDurationSec);
|
|
26
|
+
if (!snap) {
|
|
27
|
+
if (explicit) {
|
|
28
|
+
logger_1.logger.warn("executor: preferredModel duration outside snap tolerance — chain fallback will pick", {
|
|
29
|
+
sceneIndex,
|
|
30
|
+
modelKey,
|
|
31
|
+
plannedDurationSec,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return plannedDurationSec;
|
|
35
|
+
}
|
|
36
|
+
if (snap.driftSec > 0.01) {
|
|
37
|
+
logger_1.logger.info("executor: snapped duration to fit preferredModel", {
|
|
38
|
+
sceneIndex,
|
|
39
|
+
modelKey,
|
|
40
|
+
from: snap.requestedSec,
|
|
41
|
+
to: snap.snappedSec,
|
|
42
|
+
driftSec: Number(snap.driftSec.toFixed(2)),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return snap.snappedSec;
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executor — turns an approved VideoPlan into per-scene asset results. Split:
|
|
3
|
+
* - core.ts — the Executor class (run loop, scene dispatch, task cache,
|
|
4
|
+
* AG-11b identity-image registry)
|
|
5
|
+
* - visual.ts — runVisual: the per-scene VISUAL strategy switch
|
|
6
|
+
* - voice.ts — TTS voice-id sanitising + voice-style → voice_settings
|
|
7
|
+
* - duration.ts — preferredModel duration snapping
|
|
8
|
+
* - types.ts — SceneAssetResult / SceneOutcome / ExecutorOptions /
|
|
9
|
+
* RunToolFn / classifySceneFailure
|
|
10
|
+
*
|
|
11
|
+
* Public surface is unchanged from the former single-file module.
|
|
12
|
+
*/
|
|
13
|
+
export * from "./types";
|
|
14
|
+
export { Executor } from "./core";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/executor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Executor = void 0;
|
|
18
|
+
/**
|
|
19
|
+
* Executor — turns an approved VideoPlan into per-scene asset results. Split:
|
|
20
|
+
* - core.ts — the Executor class (run loop, scene dispatch, task cache,
|
|
21
|
+
* AG-11b identity-image registry)
|
|
22
|
+
* - visual.ts — runVisual: the per-scene VISUAL strategy switch
|
|
23
|
+
* - voice.ts — TTS voice-id sanitising + voice-style → voice_settings
|
|
24
|
+
* - duration.ts — preferredModel duration snapping
|
|
25
|
+
* - types.ts — SceneAssetResult / SceneOutcome / ExecutorOptions /
|
|
26
|
+
* RunToolFn / classifySceneFailure
|
|
27
|
+
*
|
|
28
|
+
* Public surface is unchanged from the former single-file module.
|
|
29
|
+
*/
|
|
30
|
+
__exportStar(require("./types"), exports);
|
|
31
|
+
var core_1 = require("./core");
|
|
32
|
+
Object.defineProperty(exports, "Executor", { enumerable: true, get: function () { return core_1.Executor; } });
|