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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VoiceStyle } from "../../../schemas/brief.schema";
|
|
2
|
+
export declare function sanitizeVoiceId(voiceId: string | undefined): string | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* AG-31: map a brief-level voice style adjective to ElevenLabs voice_settings.
|
|
5
|
+
* `style` is the exaggeration param (use sparingly above 0.5 — artifacts);
|
|
6
|
+
* `stability` is the consistency knob (low = more emotive, high = monotone);
|
|
7
|
+
* `speed` is rate (0.7-1.2). Defaults match ElevenLabs' own (style=0,
|
|
8
|
+
* stability=0.5, speed=1.0). Tuning per persona is conservative — we'd rather
|
|
9
|
+
* be slightly flat than artifact-laden.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveVoiceSettings(style: VoiceStyle | undefined): {
|
|
12
|
+
style?: number;
|
|
13
|
+
stability?: number;
|
|
14
|
+
speed?: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function normalizeVoiceStyle(raw: string | undefined): VoiceStyle | undefined;
|
|
17
|
+
//# sourceMappingURL=voice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/executor/voice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAkB3D,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAU/E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,UAAU,GAAG,SAAS,GAC5B;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyBxD;AAgDD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,UAAU,GAAG,SAAS,CAKxB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sanitizeVoiceId = sanitizeVoiceId;
|
|
4
|
+
exports.resolveVoiceSettings = resolveVoiceSettings;
|
|
5
|
+
exports.normalizeVoiceStyle = normalizeVoiceStyle;
|
|
6
|
+
const voices_1 = require("../../../globals/ttsModels/voices");
|
|
7
|
+
const logger_1 = require("../../../utils/logger");
|
|
8
|
+
/**
|
|
9
|
+
* Voice resolution helpers for the executor's TTS step: strip hallucinated
|
|
10
|
+
* voice IDs, map a (normalized) voice-style adjective onto ElevenLabs
|
|
11
|
+
* voice_settings, and canonicalise freeform style synonyms.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* AG-37: planners (LLMs) keep inventing voice IDs like "female-young-adult-en"
|
|
15
|
+
* or "narrator-1" that look reasonable but don't exist in any catalog. When
|
|
16
|
+
* those flow into ElevenLabs the API returns a 400 and the silent-fail VO
|
|
17
|
+
* outcome path drops the VO entirely — final video ships muted. Strip
|
|
18
|
+
* unknown IDs here so the provider falls back to its default voice instead.
|
|
19
|
+
*/
|
|
20
|
+
const ELEVENLABS_VOICE_IDS = new Set(voices_1.ELEVENLABS_VOICES.map((v) => v.id));
|
|
21
|
+
function sanitizeVoiceId(voiceId) {
|
|
22
|
+
if (!voiceId)
|
|
23
|
+
return undefined;
|
|
24
|
+
if (ELEVENLABS_VOICE_IDS.has(voiceId))
|
|
25
|
+
return voiceId;
|
|
26
|
+
// Heuristic for non-ElevenLabs providers (openai = "alloy"/"echo"/..., minimax = "male-qn-qingse").
|
|
27
|
+
// Only strip strings that look like LLM-invented descriptive labels (contain a hyphen + recognisable word).
|
|
28
|
+
if (/^(female|male|narrator|presenter|voice)[-_]/i.test(voiceId)) {
|
|
29
|
+
logger_1.logger.warn("executor: stripping invalid voiceId (LLM hallucination)", { voiceId });
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
return voiceId;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* AG-31: map a brief-level voice style adjective to ElevenLabs voice_settings.
|
|
36
|
+
* `style` is the exaggeration param (use sparingly above 0.5 — artifacts);
|
|
37
|
+
* `stability` is the consistency knob (low = more emotive, high = monotone);
|
|
38
|
+
* `speed` is rate (0.7-1.2). Defaults match ElevenLabs' own (style=0,
|
|
39
|
+
* stability=0.5, speed=1.0). Tuning per persona is conservative — we'd rather
|
|
40
|
+
* be slightly flat than artifact-laden.
|
|
41
|
+
*/
|
|
42
|
+
function resolveVoiceSettings(style) {
|
|
43
|
+
switch (style) {
|
|
44
|
+
case "calm":
|
|
45
|
+
return { style: 0.15, stability: 0.7, speed: 0.95 };
|
|
46
|
+
case "warm":
|
|
47
|
+
return { style: 0.25, stability: 0.6, speed: 1.0 };
|
|
48
|
+
case "casual":
|
|
49
|
+
return { style: 0.3, stability: 0.5, speed: 1.0 };
|
|
50
|
+
case "excited":
|
|
51
|
+
return { style: 0.55, stability: 0.35, speed: 1.05 };
|
|
52
|
+
case "energetic":
|
|
53
|
+
return { style: 0.6, stability: 0.35, speed: 1.08 };
|
|
54
|
+
case "happy":
|
|
55
|
+
return { style: 0.5, stability: 0.4, speed: 1.05 };
|
|
56
|
+
case "serious":
|
|
57
|
+
return { style: 0.2, stability: 0.75, speed: 0.95 };
|
|
58
|
+
case "dramatic":
|
|
59
|
+
return { style: 0.65, stability: 0.4, speed: 0.95 };
|
|
60
|
+
case "whisper":
|
|
61
|
+
return { style: 0.2, stability: 0.85, speed: 0.9 };
|
|
62
|
+
case "neutral":
|
|
63
|
+
case undefined:
|
|
64
|
+
default:
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* AG-4: canonical VoiceStyle values that resolveVoiceSettings actually maps.
|
|
70
|
+
* Anything outside this set falls through to `{}` (flat delivery).
|
|
71
|
+
*/
|
|
72
|
+
const CANONICAL_VOICE_STYLES = new Set([
|
|
73
|
+
"neutral", "calm", "warm", "casual", "excited",
|
|
74
|
+
"energetic", "happy", "serious", "dramatic", "whisper",
|
|
75
|
+
]);
|
|
76
|
+
/**
|
|
77
|
+
* AG-4: map a freeform voice-style adjective onto the canonical VoiceStyle
|
|
78
|
+
* vocabulary so per-scene emotional beats actually reach voice_settings.
|
|
79
|
+
* The planner is prompted to emit canonical values, but LLMs drift toward
|
|
80
|
+
* synonyms ('whispered', 'authoritative', 'frustrated', 'curious'); without
|
|
81
|
+
* this they silently no-op to default delivery. Unknown words → undefined
|
|
82
|
+
* (same as today). Case/whitespace-insensitive.
|
|
83
|
+
*/
|
|
84
|
+
const VOICE_STYLE_SYNONYMS = {
|
|
85
|
+
// whisper
|
|
86
|
+
whispered: "whisper", hushed: "whisper", soft: "whisper",
|
|
87
|
+
quiet: "whisper", intimate: "whisper", reflective: "whisper",
|
|
88
|
+
// calm
|
|
89
|
+
thoughtful: "calm", curious: "calm", intrigued: "calm", sad: "calm",
|
|
90
|
+
somber: "calm", melancholy: "calm", contemplative: "calm", gentle: "calm",
|
|
91
|
+
// warm
|
|
92
|
+
reassuring: "warm", friendly: "warm", soothing: "warm", inviting: "warm",
|
|
93
|
+
// casual
|
|
94
|
+
conversational: "casual", relaxed: "casual", chill: "casual",
|
|
95
|
+
informal: "casual", "laid-back": "casual",
|
|
96
|
+
// serious
|
|
97
|
+
authoritative: "serious", confident: "serious", assertive: "serious",
|
|
98
|
+
skeptical: "serious", professional: "serious", commanding: "serious",
|
|
99
|
+
// dramatic
|
|
100
|
+
frustrated: "dramatic", urgent: "dramatic", intense: "dramatic",
|
|
101
|
+
tense: "dramatic", angry: "dramatic",
|
|
102
|
+
// energetic
|
|
103
|
+
enthusiastic: "energetic", hyped: "energetic", lively: "energetic",
|
|
104
|
+
upbeat: "energetic", peppy: "energetic",
|
|
105
|
+
// happy
|
|
106
|
+
joyful: "happy", playful: "happy", cheerful: "happy", delighted: "happy",
|
|
107
|
+
// excited
|
|
108
|
+
thrilled: "excited", eager: "excited", animated: "excited",
|
|
109
|
+
// neutral
|
|
110
|
+
monotone: "neutral", deadpan: "neutral", flat: "neutral", robotic: "neutral",
|
|
111
|
+
};
|
|
112
|
+
function normalizeVoiceStyle(raw) {
|
|
113
|
+
if (!raw)
|
|
114
|
+
return undefined;
|
|
115
|
+
const key = raw.trim().toLowerCase();
|
|
116
|
+
if (CANONICAL_VOICE_STYLES.has(key))
|
|
117
|
+
return key;
|
|
118
|
+
return VOICE_STYLE_SYNONYMS[key];
|
|
119
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { RunToolFn } from "./executor";
|
|
2
|
+
import { ToolContext } from "./toolRegistry";
|
|
3
|
+
/** One extension step in a chain (the source clip is implicit / step 0). */
|
|
4
|
+
export interface ExtendChainStep {
|
|
5
|
+
/**
|
|
6
|
+
* Seconds to extend by. The provider clamps to its native increment, so this
|
|
7
|
+
* drives cost + the time-window split, not a frame-exact length.
|
|
8
|
+
*/
|
|
9
|
+
extraDurationSec: number;
|
|
10
|
+
/**
|
|
11
|
+
* Optional continuation prompt. Omitted by default so the provider continues
|
|
12
|
+
* the source clip's motion naturally (a fresh prompt risks a visible cut).
|
|
13
|
+
*/
|
|
14
|
+
prompt?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Output of `planExtendChain` — how to build a too-long scene's visual. */
|
|
17
|
+
export interface ExtendChainPlan {
|
|
18
|
+
/** Seconds for the initial clip (the model's max legal single-clip length). */
|
|
19
|
+
initialDurationSec: number;
|
|
20
|
+
/** Ordered extension segments fired after the initial clip completes. */
|
|
21
|
+
segments: ExtendChainStep[];
|
|
22
|
+
}
|
|
23
|
+
/** A resolved visual sub-clip (source or one extension), in render order. */
|
|
24
|
+
export interface SceneClip {
|
|
25
|
+
/** Final asset URL for this sub-clip. */
|
|
26
|
+
visualUrl: string;
|
|
27
|
+
/** Provider task id this clip came from (trace / reuse). */
|
|
28
|
+
taskId?: string;
|
|
29
|
+
/** Nominal seconds for this sub-clip; drives the planToProject window split. */
|
|
30
|
+
durationSec: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Decide whether a video scene needs an extend chain, and slice the extra
|
|
34
|
+
* seconds into provider-legal extension steps. Returns `null` when:
|
|
35
|
+
* - the model has no declared duration constraint (unconstrained → one clip),
|
|
36
|
+
* - the target already fits one clip (within snap tolerance), or
|
|
37
|
+
* - the model has no native extension endpoint (caller clamps as before — a
|
|
38
|
+
* non-extend model can't continue a clip, so the extra seconds are dropped
|
|
39
|
+
* by the existing capability/snap path).
|
|
40
|
+
*
|
|
41
|
+
* `targetDurationSec` is the scene's full requested length (scene.durationMs/1000).
|
|
42
|
+
*/
|
|
43
|
+
export declare function planExtendChain(modelKey: string, targetDurationSec: number): ExtendChainPlan | null;
|
|
44
|
+
/** Poll result shape the host's TaskPoller wrapper returns. */
|
|
45
|
+
export interface ExtendPollResult {
|
|
46
|
+
status: "completed" | "failed" | "timed-out";
|
|
47
|
+
videoUrl?: string;
|
|
48
|
+
errorMessage?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Injected capabilities resolveExtendChain needs (host wires real impls). */
|
|
51
|
+
export interface ExtendChainDeps {
|
|
52
|
+
/** Tool dispatcher (same one the executor uses) — runs `extend_video`. */
|
|
53
|
+
runTool: RunToolFn;
|
|
54
|
+
/** Polls a single provider task to completion (TaskPoller wrapper host-side). */
|
|
55
|
+
pollTask: (args: {
|
|
56
|
+
ref: string;
|
|
57
|
+
taskId: string;
|
|
58
|
+
modelKey: string;
|
|
59
|
+
outputFilename?: string;
|
|
60
|
+
}) => Promise<ExtendPollResult>;
|
|
61
|
+
}
|
|
62
|
+
export interface ResolveExtendChainArgs {
|
|
63
|
+
sceneIndex: number;
|
|
64
|
+
/** Extend-capable model the whole chain runs on (no cross-provider fallback). */
|
|
65
|
+
modelKey: string;
|
|
66
|
+
/** Task id of the already-triggered initial clip. */
|
|
67
|
+
initialTaskId: string;
|
|
68
|
+
/** Nominal seconds of the initial clip (from planExtendChain.initialDurationSec). */
|
|
69
|
+
initialDurationSec: number;
|
|
70
|
+
/** Ordered extension segments (from planExtendChain.segments). */
|
|
71
|
+
segments: ExtendChainStep[];
|
|
72
|
+
/** Tool context for the extend_video calls. */
|
|
73
|
+
ctx: ToolContext;
|
|
74
|
+
/** Filename hint prefix for the poller (e.g. `${projectId}-scene${i}`). */
|
|
75
|
+
outputFilenamePrefix?: string;
|
|
76
|
+
}
|
|
77
|
+
export type ResolveExtendChainResult = {
|
|
78
|
+
ok: true;
|
|
79
|
+
clips: SceneClip[];
|
|
80
|
+
} | {
|
|
81
|
+
ok: false;
|
|
82
|
+
/** Clips that DID resolve before the failure (may be empty). */
|
|
83
|
+
clips: SceneClip[];
|
|
84
|
+
error: {
|
|
85
|
+
code: string;
|
|
86
|
+
message: string;
|
|
87
|
+
failedTaskId?: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Run an extend chain to completion, enforcing source-task ordering: poll the
|
|
92
|
+
* current task → on completion, fire the next extension → poll that → repeat.
|
|
93
|
+
* Returns the source + extension clips in render order.
|
|
94
|
+
*
|
|
95
|
+
* Failure is partial-tolerant: if a mid-chain task fails/times out we stop and
|
|
96
|
+
* return the clips resolved so far with ok:false, so the caller can decide to
|
|
97
|
+
* ship a shorter scene rather than lose the whole thing. A failed SOURCE clip
|
|
98
|
+
* (no clips resolved) is a hard scene failure.
|
|
99
|
+
*/
|
|
100
|
+
export declare function resolveExtendChain(deps: ExtendChainDeps, args: ResolveExtendChainArgs): Promise<ResolveExtendChainResult>;
|
|
101
|
+
//# sourceMappingURL=extendChain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extendChain.d.ts","sourceRoot":"","sources":["../../../src/services/agent/extendChain.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAgD7C,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,6EAA6E;AAC7E,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,MAAM,GACxB,eAAe,GAAG,IAAI,CA2BxB;AAED,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,OAAO,EAAE,SAAS,CAAC;IACnB,iFAAiF;IACjF,QAAQ,EAAE,CAAC,IAAI,EAAE;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,+CAA+C;IAC/C,GAAG,EAAE,WAAW,CAAC;IACjB,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,wBAAwB,GAChC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE,GAChC;IACE,EAAE,EAAE,KAAK,CAAC;IACV,gEAAgE;IAChE,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE,CAAC;AAEN;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,wBAAwB,CAAC,CAiFnC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planExtendChain = planExtendChain;
|
|
4
|
+
exports.resolveExtendChain = resolveExtendChain;
|
|
5
|
+
const logger_1 = require("../../utils/logger");
|
|
6
|
+
const tierHelpers_1 = require("../../globals/aiModels/tierHelpers");
|
|
7
|
+
const extendVideo_tool_1 = require("./tools/extendVideo.tool");
|
|
8
|
+
/**
|
|
9
|
+
* AG-2 / Stream L (L-4) — extend-chain orchestration.
|
|
10
|
+
*
|
|
11
|
+
* A single scene can ask for more seconds than the chosen video model emits in
|
|
12
|
+
* one clip (e.g. a 16s continuous establishing shot on Kling, whose max single
|
|
13
|
+
* clip is ~10s). For extend-capable providers (Kling / Pixverse) we don't drop
|
|
14
|
+
* the extra seconds or fall back to a different provider (which would visibly
|
|
15
|
+
* change the look) — we generate the initial clip at the model's max legal
|
|
16
|
+
* length, then call the provider's NATIVE extension endpoint N times, each
|
|
17
|
+
* continuing the PREVIOUS provider task.
|
|
18
|
+
*
|
|
19
|
+
* The hard part is ordering: `extend_video` takes a `previousTaskId` that must
|
|
20
|
+
* already be COMPLETE on the provider before the extension can start. The agent
|
|
21
|
+
* executor is otherwise fire-and-forget (it triggers every scene's generation
|
|
22
|
+
* in parallel and returns `pendingTaskId`s for the host to poll afterwards), so
|
|
23
|
+
* the chain can't live in that parallel fan-out.
|
|
24
|
+
*
|
|
25
|
+
* Split of responsibilities:
|
|
26
|
+
* - `planExtendChain` (pure) — decides whether a scene needs a chain
|
|
27
|
+
* and how to slice the extra seconds. The
|
|
28
|
+
* executor calls this at trigger time and
|
|
29
|
+
* emits the segments on the SceneOutcome.
|
|
30
|
+
* - `resolveExtendChain` (injected) — runs the chain SEQUENTIALLY: poll the
|
|
31
|
+
* source → fire one extend → poll it →
|
|
32
|
+
* repeat. The host injects `pollTask`
|
|
33
|
+
* (a TaskPoller wrapper) + `runTool`.
|
|
34
|
+
*
|
|
35
|
+
* Keeping both here (in `shared`) rather than in the node worker means the
|
|
36
|
+
* decision logic is unit-testable and exercised by the eval harness's executor.
|
|
37
|
+
*/
|
|
38
|
+
/** Provider extension request bounds (mirror extendVideo.tool's InputSchema). */
|
|
39
|
+
const EXTEND_MIN_SEC = 2;
|
|
40
|
+
const EXTEND_MAX_SEC = 10;
|
|
41
|
+
/** Preferred per-extension increment (Kling ~4-5s, Pixverse ~5-8s natively). */
|
|
42
|
+
const PREFERRED_STEP_SEC = 5;
|
|
43
|
+
/**
|
|
44
|
+
* Hard cap on extensions per scene. A mis-planned 60s "scene" should not fan
|
|
45
|
+
* into a dozen paid provider calls — beyond this we get as close as we can and
|
|
46
|
+
* log the shortfall. maxClip + MAX_EXTENSIONS×EXTEND_MAX covers ~70s, well past
|
|
47
|
+
* any sane single continuous shot.
|
|
48
|
+
*/
|
|
49
|
+
const MAX_EXTENSIONS = 6;
|
|
50
|
+
/** Don't chain for a sub-second overflow — snapping absorbs it. */
|
|
51
|
+
const CHAIN_TOLERANCE_SEC = 0.5;
|
|
52
|
+
/**
|
|
53
|
+
* Decide whether a video scene needs an extend chain, and slice the extra
|
|
54
|
+
* seconds into provider-legal extension steps. Returns `null` when:
|
|
55
|
+
* - the model has no declared duration constraint (unconstrained → one clip),
|
|
56
|
+
* - the target already fits one clip (within snap tolerance), or
|
|
57
|
+
* - the model has no native extension endpoint (caller clamps as before — a
|
|
58
|
+
* non-extend model can't continue a clip, so the extra seconds are dropped
|
|
59
|
+
* by the existing capability/snap path).
|
|
60
|
+
*
|
|
61
|
+
* `targetDurationSec` is the scene's full requested length (scene.durationMs/1000).
|
|
62
|
+
*/
|
|
63
|
+
function planExtendChain(modelKey, targetDurationSec) {
|
|
64
|
+
const allowed = (0, tierHelpers_1.getModelAllowedDurations)(modelKey);
|
|
65
|
+
if (!allowed || allowed.length === 0)
|
|
66
|
+
return null; // unconstrained
|
|
67
|
+
const maxClip = allowed[allowed.length - 1]; // getModelAllowedDurations sorts ascending
|
|
68
|
+
const remaining = targetDurationSec - maxClip;
|
|
69
|
+
if (remaining <= CHAIN_TOLERANCE_SEC)
|
|
70
|
+
return null; // fits one clip
|
|
71
|
+
if (!(0, extendVideo_tool_1.modelSupportsExtend)(modelKey))
|
|
72
|
+
return null; // can't extend on this model
|
|
73
|
+
let n = Math.ceil(remaining / PREFERRED_STEP_SEC);
|
|
74
|
+
n = Math.min(Math.max(n, 1), MAX_EXTENSIONS);
|
|
75
|
+
const per = clamp(Math.round(remaining / n), EXTEND_MIN_SEC, EXTEND_MAX_SEC);
|
|
76
|
+
const segments = Array.from({ length: n }, () => ({
|
|
77
|
+
extraDurationSec: per,
|
|
78
|
+
}));
|
|
79
|
+
const achievable = maxClip + n * per;
|
|
80
|
+
if (achievable + CHAIN_TOLERANCE_SEC < targetDurationSec) {
|
|
81
|
+
logger_1.logger.warn("extendChain: requested duration exceeds chain ceiling — clamping", {
|
|
82
|
+
modelKey,
|
|
83
|
+
targetDurationSec,
|
|
84
|
+
maxClip,
|
|
85
|
+
extensions: n,
|
|
86
|
+
perSec: per,
|
|
87
|
+
achievableSec: achievable,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return { initialDurationSec: maxClip, segments };
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Run an extend chain to completion, enforcing source-task ordering: poll the
|
|
94
|
+
* current task → on completion, fire the next extension → poll that → repeat.
|
|
95
|
+
* Returns the source + extension clips in render order.
|
|
96
|
+
*
|
|
97
|
+
* Failure is partial-tolerant: if a mid-chain task fails/times out we stop and
|
|
98
|
+
* return the clips resolved so far with ok:false, so the caller can decide to
|
|
99
|
+
* ship a shorter scene rather than lose the whole thing. A failed SOURCE clip
|
|
100
|
+
* (no clips resolved) is a hard scene failure.
|
|
101
|
+
*/
|
|
102
|
+
async function resolveExtendChain(deps, args) {
|
|
103
|
+
const { runTool, pollTask } = deps;
|
|
104
|
+
const { sceneIndex, modelKey, segments, ctx } = args;
|
|
105
|
+
const prefix = args.outputFilenamePrefix ?? `scene${sceneIndex}`;
|
|
106
|
+
const clips = [];
|
|
107
|
+
let currentTaskId = args.initialTaskId;
|
|
108
|
+
let currentDurationSec = args.initialDurationSec;
|
|
109
|
+
// Step 0 is the source clip; steps 1..N are the extensions. We poll the
|
|
110
|
+
// current task, record its clip, then (if more remain) fire the next extend.
|
|
111
|
+
for (let step = 0; step <= segments.length; step++) {
|
|
112
|
+
const poll = await pollTask({
|
|
113
|
+
ref: `${sceneIndex}.${step}`,
|
|
114
|
+
taskId: currentTaskId,
|
|
115
|
+
modelKey,
|
|
116
|
+
outputFilename: `${prefix}-ext${step}`,
|
|
117
|
+
});
|
|
118
|
+
if (poll.status !== "completed" || !poll.videoUrl) {
|
|
119
|
+
logger_1.logger.warn("extendChain: chain task did not complete — stopping", {
|
|
120
|
+
sceneIndex,
|
|
121
|
+
step,
|
|
122
|
+
status: poll.status,
|
|
123
|
+
taskId: currentTaskId,
|
|
124
|
+
error: poll.errorMessage,
|
|
125
|
+
});
|
|
126
|
+
return {
|
|
127
|
+
ok: false,
|
|
128
|
+
clips,
|
|
129
|
+
error: {
|
|
130
|
+
code: step === 0 ? "EXTEND_SOURCE_FAILED" : "EXTEND_STEP_FAILED",
|
|
131
|
+
message: `Extend chain ${step === 0 ? "source" : `step ${step}`} ${poll.status}` +
|
|
132
|
+
(poll.errorMessage ? `: ${poll.errorMessage}` : ""),
|
|
133
|
+
failedTaskId: currentTaskId,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
clips.push({
|
|
138
|
+
visualUrl: poll.videoUrl,
|
|
139
|
+
taskId: currentTaskId,
|
|
140
|
+
durationSec: currentDurationSec,
|
|
141
|
+
});
|
|
142
|
+
// All steps resolved — done.
|
|
143
|
+
if (step === segments.length)
|
|
144
|
+
break;
|
|
145
|
+
// Fire the next extension, continuing the task we just confirmed complete.
|
|
146
|
+
const seg = segments[step];
|
|
147
|
+
const extendOut = await runTool("extend_video", {
|
|
148
|
+
previousTaskId: currentTaskId,
|
|
149
|
+
modelKey,
|
|
150
|
+
extraDurationSec: seg.extraDurationSec,
|
|
151
|
+
...(seg.prompt ? { prompt: seg.prompt } : {}),
|
|
152
|
+
}, { ...ctx, idempotencyKey: `${ctx.idempotencyKey ?? ctx.agentRunId}:ext${step + 1}` });
|
|
153
|
+
if (!extendOut.ok) {
|
|
154
|
+
logger_1.logger.warn("extendChain: extend_video call failed — stopping", {
|
|
155
|
+
sceneIndex,
|
|
156
|
+
step: step + 1,
|
|
157
|
+
sourceTaskId: currentTaskId,
|
|
158
|
+
error: extendOut.error,
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
ok: false,
|
|
162
|
+
clips,
|
|
163
|
+
error: {
|
|
164
|
+
code: "EXTEND_TRIGGER_FAILED",
|
|
165
|
+
message: `extend_video step ${step + 1} failed: ${extendOut.error?.message ?? extendOut.error?.code ?? "unknown"}`,
|
|
166
|
+
failedTaskId: currentTaskId,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
currentTaskId = extendOut.output.taskId;
|
|
171
|
+
currentDurationSec = seg.extraDurationSec;
|
|
172
|
+
}
|
|
173
|
+
return { ok: true, clips };
|
|
174
|
+
}
|
|
175
|
+
function clamp(v, lo, hi) {
|
|
176
|
+
return Math.max(lo, Math.min(hi, v));
|
|
177
|
+
}
|
|
@@ -2,13 +2,19 @@ export * from "./toolRegistry";
|
|
|
2
2
|
export * from "./tools";
|
|
3
3
|
export * from "./modelRouter";
|
|
4
4
|
export * from "./llmCaller";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./llmRetry";
|
|
6
|
+
export * from "./llmModelRegistry";
|
|
6
7
|
export * from "./llmCallerAnthropic";
|
|
8
|
+
export * from "./llmCallerOpenai";
|
|
9
|
+
export * from "./llmCallerGemini";
|
|
10
|
+
export * from "./llmCallerRouting";
|
|
11
|
+
export * from "./llmCallerFactory";
|
|
7
12
|
export * from "./personas";
|
|
8
13
|
export * from "./llmCallerRegistry";
|
|
9
14
|
export * from "./costPreflight";
|
|
10
15
|
export * from "./planner";
|
|
11
16
|
export * from "./planMutations";
|
|
17
|
+
export * from "./priorProject";
|
|
12
18
|
export * from "./bibleBuilder";
|
|
13
19
|
export * from "./referenceImageRenderer";
|
|
14
20
|
export * from "./bibleImageVision";
|
|
@@ -16,6 +22,10 @@ export * from "./sceneLayoutVision";
|
|
|
16
22
|
export * from "./beatSnap";
|
|
17
23
|
export * from "./musicSelect";
|
|
18
24
|
export * from "./executor";
|
|
25
|
+
export * from "./extendChain";
|
|
26
|
+
export * from "./editExisting";
|
|
27
|
+
export * from "./repurpose";
|
|
28
|
+
export * from "./covers";
|
|
19
29
|
export * from "./providerTaskCache";
|
|
20
30
|
export * from "./planDiff";
|
|
21
31
|
export * from "./taskPoller";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -18,13 +18,19 @@ __exportStar(require("./toolRegistry"), exports);
|
|
|
18
18
|
__exportStar(require("./tools"), exports);
|
|
19
19
|
__exportStar(require("./modelRouter"), exports);
|
|
20
20
|
__exportStar(require("./llmCaller"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./llmRetry"), exports);
|
|
22
|
+
__exportStar(require("./llmModelRegistry"), exports);
|
|
22
23
|
__exportStar(require("./llmCallerAnthropic"), exports);
|
|
24
|
+
__exportStar(require("./llmCallerOpenai"), exports);
|
|
25
|
+
__exportStar(require("./llmCallerGemini"), exports);
|
|
26
|
+
__exportStar(require("./llmCallerRouting"), exports);
|
|
27
|
+
__exportStar(require("./llmCallerFactory"), exports);
|
|
23
28
|
__exportStar(require("./personas"), exports);
|
|
24
29
|
__exportStar(require("./llmCallerRegistry"), exports);
|
|
25
30
|
__exportStar(require("./costPreflight"), exports);
|
|
26
31
|
__exportStar(require("./planner"), exports);
|
|
27
32
|
__exportStar(require("./planMutations"), exports);
|
|
33
|
+
__exportStar(require("./priorProject"), exports);
|
|
28
34
|
__exportStar(require("./bibleBuilder"), exports);
|
|
29
35
|
__exportStar(require("./referenceImageRenderer"), exports);
|
|
30
36
|
__exportStar(require("./bibleImageVision"), exports);
|
|
@@ -32,6 +38,10 @@ __exportStar(require("./sceneLayoutVision"), exports);
|
|
|
32
38
|
__exportStar(require("./beatSnap"), exports);
|
|
33
39
|
__exportStar(require("./musicSelect"), exports);
|
|
34
40
|
__exportStar(require("./executor"), exports);
|
|
41
|
+
__exportStar(require("./extendChain"), exports);
|
|
42
|
+
__exportStar(require("./editExisting"), exports);
|
|
43
|
+
__exportStar(require("./repurpose"), exports);
|
|
44
|
+
__exportStar(require("./covers"), exports);
|
|
35
45
|
__exportStar(require("./providerTaskCache"), exports);
|
|
36
46
|
__exportStar(require("./planDiff"), exports);
|
|
37
47
|
__exportStar(require("./taskPoller"), exports);
|
|
@@ -2,9 +2,10 @@ import { z } from "zod";
|
|
|
2
2
|
import { ModelChoice } from "./modelRouter";
|
|
3
3
|
/**
|
|
4
4
|
* Provider-agnostic LLM caller. The host (Express server / Firebase Functions)
|
|
5
|
-
* wires a concrete implementation
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* wires a concrete implementation — the native ProviderRoutingLlmCaller, which
|
|
6
|
+
* dispatches per request to a provider's own SDK (Anthropic / OpenAI / Gemini).
|
|
7
|
+
* Agent code only ever sees this interface, which keeps it portable and lets us
|
|
8
|
+
* A/B-test models against the eval set without code changes.
|
|
8
9
|
*/
|
|
9
10
|
export interface LlmCaller {
|
|
10
11
|
/** Free-form chat completion. */
|
|
@@ -30,11 +31,9 @@ export interface LlmCaller {
|
|
|
30
31
|
* emitting the final structured payload.
|
|
31
32
|
*
|
|
32
33
|
* Only implemented by callers that natively support tool-use loops (today:
|
|
33
|
-
* `AnthropicLlmCaller
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* a custom-tools-only variant on the gateway (e.g. Tavily passed as a
|
|
37
|
-
* regular OpenAI-format tool) — see deferred work in `llmCallerAnthropic.ts`.
|
|
34
|
+
* `AnthropicLlmCaller`, for Anthropic's built-in server tools). The
|
|
35
|
+
* dispatcher routes structuredWithTools to the Anthropic caller and throws
|
|
36
|
+
* if a non-Anthropic provider is asked for it. OpenAI/Gemini callers omit it.
|
|
38
37
|
*/
|
|
39
38
|
structuredWithTools?<T extends z.ZodTypeAny>(req: StructuredWithToolsRequest<T>): Promise<StructuredResponse<T>>;
|
|
40
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llmCaller.d.ts","sourceRoot":"","sources":["../../../src/services/agent/llmCaller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"llmCaller.d.ts","sourceRoot":"","sources":["../../../src/services/agent/llmCaller.ts"],"names":[],"mappings":"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"}
|