vidspotai-shared 1.0.53 → 1.0.55
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/providers/alibaba.d.ts +4 -0
- package/lib/globals/aiModels/providers/alibaba.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/alibaba.js +183 -0
- package/lib/globals/aiModels/providers/elevenlabs.d.ts +13 -0
- package/lib/globals/aiModels/providers/elevenlabs.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/elevenlabs.js +25 -0
- package/lib/globals/aiModels/providers/pixverseTemplates.d.ts +36 -0
- package/lib/globals/aiModels/providers/pixverseTemplates.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/pixverseTemplates.js +42 -0
- package/lib/globals/aiModels/tierHelpers.d.ts +27 -0
- package/lib/globals/aiModels/tierHelpers.d.ts.map +1 -0
- package/lib/globals/aiModels/tierHelpers.js +73 -0
- package/lib/globals/ttsModels/providers/minimax.d.ts +8 -0
- package/lib/globals/ttsModels/providers/minimax.d.ts.map +1 -0
- package/lib/globals/ttsModels/providers/minimax.js +18 -0
- package/lib/globals/ttsModels/providers/openai.d.ts +8 -0
- package/lib/globals/ttsModels/providers/openai.d.ts.map +1 -0
- package/lib/globals/ttsModels/providers/openai.js +18 -0
- package/lib/globals/types.d.ts +2 -1
- package/lib/globals/types.d.ts.map +1 -1
- package/lib/globals/types.js +1 -0
- package/lib/models/agent.model.d.ts +117 -0
- package/lib/models/agent.model.d.ts.map +1 -0
- package/lib/models/agent.model.js +13 -0
- package/lib/models/analytics.model.d.ts +4 -0
- package/lib/models/analytics.model.d.ts.map +1 -1
- package/lib/models/cachedAsset.model.d.ts +18 -0
- package/lib/models/cachedAsset.model.d.ts.map +1 -0
- package/lib/models/cachedAsset.model.js +2 -0
- package/lib/models/cachedRawAsset.model.d.ts +20 -0
- package/lib/models/cachedRawAsset.model.d.ts.map +1 -0
- package/lib/models/cachedRawAsset.model.js +2 -0
- package/lib/models/video.model.d.ts +1 -0
- package/lib/models/video.model.d.ts.map +1 -1
- package/lib/schemas/agentPersona.schema.d.ts +10 -0
- package/lib/schemas/agentPersona.schema.d.ts.map +1 -0
- package/lib/schemas/agentPersona.schema.js +11 -0
- package/lib/schemas/brandKit.schema.d.ts +101 -0
- package/lib/schemas/brandKit.schema.d.ts.map +1 -0
- package/lib/schemas/brandKit.schema.js +46 -0
- package/lib/schemas/brief.schema.d.ts +216 -0
- package/lib/schemas/brief.schema.d.ts.map +1 -0
- package/lib/schemas/brief.schema.js +118 -0
- package/lib/schemas/index.d.ts +6 -0
- package/lib/schemas/index.d.ts.map +1 -0
- package/lib/schemas/index.js +21 -0
- package/lib/schemas/project.schema.d.ts +1005 -0
- package/lib/schemas/project.schema.d.ts.map +1 -0
- package/lib/schemas/project.schema.js +238 -0
- package/lib/schemas/videoPlan.schema.d.ts +145 -0
- package/lib/schemas/videoPlan.schema.d.ts.map +1 -0
- package/lib/schemas/videoPlan.schema.js +109 -0
- package/lib/services/agent/beatSnap.d.ts +10 -0
- package/lib/services/agent/beatSnap.d.ts.map +1 -0
- package/lib/services/agent/beatSnap.js +128 -0
- package/lib/services/agent/costPreflight.d.ts +22 -0
- package/lib/services/agent/costPreflight.d.ts.map +1 -0
- package/lib/services/agent/costPreflight.js +75 -0
- package/lib/services/agent/critic.d.ts +103 -0
- package/lib/services/agent/critic.d.ts.map +1 -0
- package/lib/services/agent/critic.js +132 -0
- package/lib/services/agent/eval/index.d.ts +5 -0
- package/lib/services/agent/eval/index.d.ts.map +1 -0
- package/lib/services/agent/eval/index.js +20 -0
- package/lib/services/agent/eval/judge.d.ts +14 -0
- package/lib/services/agent/eval/judge.d.ts.map +1 -0
- package/lib/services/agent/eval/judge.js +95 -0
- package/lib/services/agent/eval/recorder.d.ts +17 -0
- package/lib/services/agent/eval/recorder.d.ts.map +1 -0
- package/lib/services/agent/eval/recorder.js +65 -0
- package/lib/services/agent/eval/seedBriefs.d.ts +16 -0
- package/lib/services/agent/eval/seedBriefs.d.ts.map +1 -0
- package/lib/services/agent/eval/seedBriefs.js +1188 -0
- package/lib/services/agent/eval/types.d.ts +196 -0
- package/lib/services/agent/eval/types.d.ts.map +1 -0
- package/lib/services/agent/eval/types.js +65 -0
- package/lib/services/agent/executor.d.ts +50 -0
- package/lib/services/agent/executor.d.ts.map +1 -0
- package/lib/services/agent/executor.js +188 -0
- package/lib/services/agent/index.d.ts +15 -0
- package/lib/services/agent/index.d.ts.map +1 -0
- package/lib/services/agent/index.js +30 -0
- package/lib/services/agent/llmCaller.d.ts +77 -0
- package/lib/services/agent/llmCaller.d.ts.map +1 -0
- package/lib/services/agent/llmCaller.js +16 -0
- package/lib/services/agent/llmCallerGateway.d.ts +39 -0
- package/lib/services/agent/llmCallerGateway.d.ts.map +1 -0
- package/lib/services/agent/llmCallerGateway.js +246 -0
- package/lib/services/agent/llmCallerRegistry.d.ts +4 -0
- package/lib/services/agent/llmCallerRegistry.d.ts.map +1 -0
- package/lib/services/agent/llmCallerRegistry.js +19 -0
- package/lib/services/agent/modelRouter.d.ts +41 -0
- package/lib/services/agent/modelRouter.d.ts.map +1 -0
- package/lib/services/agent/modelRouter.js +57 -0
- package/lib/services/agent/musicSelect.d.ts +23 -0
- package/lib/services/agent/musicSelect.d.ts.map +1 -0
- package/lib/services/agent/musicSelect.js +65 -0
- package/lib/services/agent/personas.d.ts +60 -0
- package/lib/services/agent/personas.d.ts.map +1 -0
- package/lib/services/agent/personas.js +156 -0
- package/lib/services/agent/planner.d.ts +56 -0
- package/lib/services/agent/planner.d.ts.map +1 -0
- package/lib/services/agent/planner.js +237 -0
- package/lib/services/agent/toolRegistry.d.ts +64 -0
- package/lib/services/agent/toolRegistry.d.ts.map +1 -0
- package/lib/services/agent/toolRegistry.js +78 -0
- package/lib/services/agent/tools/analyzeReference.tool.d.ts +36 -0
- package/lib/services/agent/tools/analyzeReference.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/analyzeReference.tool.js +44 -0
- package/lib/services/agent/tools/animateImage.tool.d.ts +23 -0
- package/lib/services/agent/tools/animateImage.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/animateImage.tool.js +58 -0
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.d.ts +30 -0
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.js +90 -0
- package/lib/services/agent/tools/composeScene.tool.d.ts +948 -0
- package/lib/services/agent/tools/composeScene.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/composeScene.tool.js +90 -0
- package/lib/services/agent/tools/estimateCost.tool.d.ts +342 -0
- package/lib/services/agent/tools/estimateCost.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/estimateCost.tool.js +62 -0
- package/lib/services/agent/tools/generateAvatarVideo.tool.d.ts +32 -0
- package/lib/services/agent/tools/generateAvatarVideo.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateAvatarVideo.tool.js +112 -0
- package/lib/services/agent/tools/generateImage.tool.d.ts +28 -0
- package/lib/services/agent/tools/generateImage.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateImage.tool.js +97 -0
- package/lib/services/agent/tools/generateVideo.tool.d.ts +30 -0
- package/lib/services/agent/tools/generateVideo.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateVideo.tool.js +84 -0
- package/lib/services/agent/tools/generateVoiceover.tool.d.ts +18 -0
- package/lib/services/agent/tools/generateVoiceover.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateVoiceover.tool.js +72 -0
- package/lib/services/agent/tools/index.d.ts +19 -0
- package/lib/services/agent/tools/index.d.ts.map +1 -0
- package/lib/services/agent/tools/index.js +34 -0
- package/lib/services/agent/tools/planVideo.tool.d.ts +191 -0
- package/lib/services/agent/tools/planVideo.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/planVideo.tool.js +46 -0
- package/lib/services/agent/tools/render.tool.d.ts +357 -0
- package/lib/services/agent/tools/render.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/render.tool.js +48 -0
- package/lib/services/agent/tools/searchMusic.tool.d.ts +49 -0
- package/lib/services/agent/tools/searchMusic.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/searchMusic.tool.js +74 -0
- package/lib/services/agent/tools/searchStock.tool.d.ts +37 -0
- package/lib/services/agent/tools/searchStock.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/searchStock.tool.js +101 -0
- package/lib/services/agent/tools/searchUserLibrary.tool.d.ts +59 -0
- package/lib/services/agent/tools/searchUserLibrary.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/searchUserLibrary.tool.js +58 -0
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts +31 -0
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts.map +1 -0
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.js +2 -0
- package/lib/services/aiGen/canonicalAdapters/index.d.ts +3 -0
- package/lib/services/aiGen/canonicalAdapters/index.d.ts.map +1 -0
- package/lib/services/aiGen/canonicalAdapters/index.js +18 -0
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts +23 -0
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts.map +1 -0
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.js +12 -0
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.d.ts +18 -0
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.js +100 -0
- package/lib/services/aiGen/providers/fal/falImage.service.d.ts +9 -0
- package/lib/services/aiGen/providers/fal/falImage.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/fal/falImage.service.js +102 -0
- package/lib/services/aiGen/providers/fal/index.d.ts +2 -0
- package/lib/services/aiGen/providers/fal/index.d.ts.map +1 -0
- package/lib/services/aiGen/providers/fal/index.js +17 -0
- package/lib/services/aiGen/providers/kling/cameraAdapter.d.ts +4 -0
- package/lib/services/aiGen/providers/kling/cameraAdapter.d.ts.map +1 -0
- package/lib/services/aiGen/providers/kling/cameraAdapter.js +53 -0
- package/lib/services/aiGen/providers/pexels/index.d.ts +2 -0
- package/lib/services/aiGen/providers/pexels/index.d.ts.map +1 -0
- package/lib/services/aiGen/providers/pexels/index.js +17 -0
- package/lib/services/aiGen/providers/pexels/pexels.service.d.ts +11 -0
- package/lib/services/aiGen/providers/pexels/pexels.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/pexels/pexels.service.js +118 -0
- package/lib/services/aiGen/providers/runway/cameraAdapter.d.ts +3 -0
- package/lib/services/aiGen/providers/runway/cameraAdapter.d.ts.map +1 -0
- package/lib/services/aiGen/providers/runway/cameraAdapter.js +46 -0
- package/lib/services/analytics.service.d.ts +10 -0
- package/lib/services/analytics.service.d.ts.map +1 -1
- package/lib/services/analytics.service.js +27 -0
- package/lib/services/asr/assemblyai.service.d.ts +72 -0
- package/lib/services/asr/assemblyai.service.d.ts.map +1 -0
- package/lib/services/asr/assemblyai.service.js +89 -0
- package/lib/services/asr/index.d.ts +2 -0
- package/lib/services/asr/index.d.ts.map +1 -0
- package/lib/services/asr/index.js +17 -0
- package/lib/services/assetCache.service.d.ts +54 -0
- package/lib/services/assetCache.service.d.ts.map +1 -0
- package/lib/services/assetCache.service.js +96 -0
- package/lib/services/audioAnalysis/index.d.ts +2 -0
- package/lib/services/audioAnalysis/index.d.ts.map +1 -0
- package/lib/services/audioAnalysis/index.js +17 -0
- package/lib/services/audioAnalysis/onsetDetection.service.d.ts +50 -0
- package/lib/services/audioAnalysis/onsetDetection.service.d.ts.map +1 -0
- package/lib/services/audioAnalysis/onsetDetection.service.js +136 -0
- package/lib/services/editor/designToProject.d.ts +60 -0
- package/lib/services/editor/designToProject.d.ts.map +1 -0
- package/lib/services/editor/designToProject.js +194 -0
- package/lib/services/musicGen/index.d.ts +6 -0
- package/lib/services/musicGen/index.d.ts.map +1 -0
- package/lib/services/musicGen/index.js +26 -0
- package/lib/services/musicGen/musicSearchFactory.service.d.ts +14 -0
- package/lib/services/musicGen/musicSearchFactory.service.d.ts.map +1 -0
- package/lib/services/musicGen/musicSearchFactory.service.js +59 -0
- package/lib/services/musicGen/providers/curated.service.d.ts +22 -0
- package/lib/services/musicGen/providers/curated.service.d.ts.map +1 -0
- package/lib/services/musicGen/providers/curated.service.js +171 -0
- package/lib/services/musicGen/providers/jamendo.service.d.ts +8 -0
- package/lib/services/musicGen/providers/jamendo.service.d.ts.map +1 -0
- package/lib/services/musicGen/providers/jamendo.service.js +93 -0
- package/lib/services/musicGen/providers/mubert.service.d.ts +9 -0
- package/lib/services/musicGen/providers/mubert.service.d.ts.map +1 -0
- package/lib/services/musicGen/providers/mubert.service.js +113 -0
- package/lib/services/musicGen/types.d.ts +42 -0
- package/lib/services/musicGen/types.d.ts.map +1 -0
- package/lib/services/musicGen/types.js +10 -0
- package/lib/services/tts/providers/minimax.service.d.ts +14 -0
- package/lib/services/tts/providers/minimax.service.d.ts.map +1 -0
- package/lib/services/tts/providers/minimax.service.js +78 -0
- package/lib/services/tts/providers/openai.service.d.ts +14 -0
- package/lib/services/tts/providers/openai.service.d.ts.map +1 -0
- package/lib/services/tts/providers/openai.service.js +71 -0
- package/lib/utils/helpers.d.ts +1 -0
- package/lib/utils/helpers.d.ts.map +1 -1
- package/lib/utils/helpers.js +26 -12
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ToolDefinition } from "../toolRegistry";
|
|
3
|
+
declare const InputSchema: z.ZodObject<{
|
|
4
|
+
prompt: z.ZodString;
|
|
5
|
+
modelKey: z.ZodDefault<z.ZodEnum<{
|
|
6
|
+
"fal-flux-1.1-pro": "fal-flux-1.1-pro";
|
|
7
|
+
"fal-flux-1.1-pro-ultra": "fal-flux-1.1-pro-ultra";
|
|
8
|
+
"fal-flux-schnell": "fal-flux-schnell";
|
|
9
|
+
}>>;
|
|
10
|
+
aspectRatio: z.ZodDefault<z.ZodEnum<{
|
|
11
|
+
"9:16": "9:16";
|
|
12
|
+
"16:9": "16:9";
|
|
13
|
+
"1:1": "1:1";
|
|
14
|
+
"4:5": "4:5";
|
|
15
|
+
}>>;
|
|
16
|
+
dimensions: z.ZodOptional<z.ZodString>;
|
|
17
|
+
inputImageUrl: z.ZodOptional<z.ZodString>;
|
|
18
|
+
negativePrompt: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
declare const OutputSchema: z.ZodObject<{
|
|
21
|
+
imageUrl: z.ZodString;
|
|
22
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
providerRequestId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export declare const generateImageTool: ToolDefinition<typeof InputSchema, typeof OutputSchema>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=generateImage.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateImage.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/generateImage.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;iBAyBf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;iBAKhB,CAAC;AAQH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C,OAAO,WAAW,EAClB,OAAO,YAAY,CAwDpB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateImageTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const falImage_service_1 = require("../../aiGen/providers/fal/falImage.service");
|
|
6
|
+
const assetCache_service_1 = require("../../assetCache.service");
|
|
7
|
+
const toolRegistry_1 = require("../toolRegistry");
|
|
8
|
+
const InputSchema = zod_1.z.object({
|
|
9
|
+
prompt: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.min(1)
|
|
12
|
+
.describe("Detailed visual prompt. Lighting, lens, camera angle, mood — the more specific, the more on-brief the result."),
|
|
13
|
+
modelKey: zod_1.z
|
|
14
|
+
.enum(["fal-flux-1.1-pro", "fal-flux-1.1-pro-ultra", "fal-flux-schnell"])
|
|
15
|
+
.default("fal-flux-1.1-pro")
|
|
16
|
+
.describe("fal-flux-schnell: cheapest, ~1s. fal-flux-1.1-pro: balanced. fal-flux-1.1-pro-ultra: highest quality, slowest."),
|
|
17
|
+
aspectRatio: zod_1.z.enum(["9:16", "1:1", "4:5", "16:9"]).default("9:16"),
|
|
18
|
+
dimensions: zod_1.z
|
|
19
|
+
.string()
|
|
20
|
+
.regex(/^\d+x\d+$/)
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Explicit "WxH" override. Overrides aspectRatio.'),
|
|
23
|
+
inputImageUrl: zod_1.z
|
|
24
|
+
.string()
|
|
25
|
+
.url()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Optional source image for image-to-image edits."),
|
|
28
|
+
negativePrompt: zod_1.z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
const OutputSchema = zod_1.z.object({
|
|
31
|
+
imageUrl: zod_1.z.string().url(),
|
|
32
|
+
width: zod_1.z.number().optional(),
|
|
33
|
+
height: zod_1.z.number().optional(),
|
|
34
|
+
providerRequestId: zod_1.z.string().optional(),
|
|
35
|
+
});
|
|
36
|
+
const COST_BY_MODEL = {
|
|
37
|
+
"fal-flux-schnell": 1,
|
|
38
|
+
"fal-flux-1.1-pro": 4,
|
|
39
|
+
"fal-flux-1.1-pro-ultra": 6,
|
|
40
|
+
};
|
|
41
|
+
exports.generateImageTool = {
|
|
42
|
+
name: "generate_image",
|
|
43
|
+
description: [
|
|
44
|
+
"Generate a still image from a text prompt (T1 tier — costs credits but",
|
|
45
|
+
"much cheaper than video generation). Use for scene b-roll, product shots,",
|
|
46
|
+
"or as the source frame for animate_image / animate-to-video.",
|
|
47
|
+
"Do NOT use for: stock-grade generic visuals (use search_stock — free) or",
|
|
48
|
+
"scenes that fundamentally need motion (use generate_video).",
|
|
49
|
+
"Examples:",
|
|
50
|
+
' { prompt: "cinematic golden-hour ocean cliff, slow dolly", aspectRatio: "9:16" }',
|
|
51
|
+
' { prompt: "minimalist white skincare bottle on marble", modelKey: "fal-flux-1.1-pro-ultra" }',
|
|
52
|
+
].join(" "),
|
|
53
|
+
inputSchema: InputSchema,
|
|
54
|
+
outputSchema: OutputSchema,
|
|
55
|
+
idempotent: true,
|
|
56
|
+
estimateCost: async (input) => COST_BY_MODEL[input.modelKey] ?? 4,
|
|
57
|
+
handler: async (input, ctx) => {
|
|
58
|
+
const cacheParts = {
|
|
59
|
+
provider: `fal:${input.modelKey}`,
|
|
60
|
+
input: {
|
|
61
|
+
prompt: input.prompt,
|
|
62
|
+
aspectRatio: input.aspectRatio,
|
|
63
|
+
dimensions: input.dimensions,
|
|
64
|
+
inputImageUrl: input.inputImageUrl,
|
|
65
|
+
negativePrompt: input.negativePrompt,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
const hit = await assetCache_service_1.AssetCacheService.lookup(cacheParts);
|
|
69
|
+
if (hit) {
|
|
70
|
+
return {
|
|
71
|
+
imageUrl: hit.url,
|
|
72
|
+
width: hit.width,
|
|
73
|
+
height: hit.height,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const provider = new falImage_service_1.FalImageProviderService();
|
|
77
|
+
const result = await provider.generateImage({
|
|
78
|
+
prompt: input.prompt,
|
|
79
|
+
modelKey: input.modelKey,
|
|
80
|
+
aspectRatio: input.aspectRatio,
|
|
81
|
+
dimensions: input.dimensions,
|
|
82
|
+
inputImageUrl: input.inputImageUrl,
|
|
83
|
+
negativePrompt: input.negativePrompt,
|
|
84
|
+
idempotencyKey: ctx.idempotencyKey,
|
|
85
|
+
});
|
|
86
|
+
await assetCache_service_1.AssetCacheService.store(cacheParts, {
|
|
87
|
+
provider: `fal:${input.modelKey}`,
|
|
88
|
+
kind: "image",
|
|
89
|
+
url: result.imageUrl,
|
|
90
|
+
width: result.width,
|
|
91
|
+
height: result.height,
|
|
92
|
+
originalCreditsSpent: COST_BY_MODEL[input.modelKey],
|
|
93
|
+
});
|
|
94
|
+
return result;
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
(0, toolRegistry_1.registerTool)(exports.generateImageTool);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EVideoGenModels } from "../../../globals/aiModels";
|
|
3
|
+
import { ToolDefinition } from "../toolRegistry";
|
|
4
|
+
declare const InputSchema: z.ZodObject<{
|
|
5
|
+
prompt: z.ZodString;
|
|
6
|
+
modelKey: z.ZodEnum<typeof EVideoGenModels>;
|
|
7
|
+
durationSec: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
aspectRatio: z.ZodDefault<z.ZodEnum<{
|
|
9
|
+
"9:16": "9:16";
|
|
10
|
+
"16:9": "16:9";
|
|
11
|
+
"1:1": "1:1";
|
|
12
|
+
"4:5": "4:5";
|
|
13
|
+
}>>;
|
|
14
|
+
resolution: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
"720p": "720p";
|
|
16
|
+
"1080p": "1080p";
|
|
17
|
+
"4k": "4k";
|
|
18
|
+
}>>;
|
|
19
|
+
inputImageUrl: z.ZodOptional<z.ZodString>;
|
|
20
|
+
audio: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
negativePrompt: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
declare const OutputSchema: z.ZodObject<{
|
|
24
|
+
status: z.ZodLiteral<"triggered">;
|
|
25
|
+
taskId: z.ZodString;
|
|
26
|
+
raw: z.ZodUnknown;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const generateVideoTool: ToolDefinition<typeof InputSchema, typeof OutputSchema>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=generateVideo.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateVideo.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/generateVideo.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBA8Bf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;iBAIhB,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C,OAAO,WAAW,EAClB,OAAO,YAAY,CAgDpB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateVideoTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const aiModels_1 = require("../../../globals/aiModels");
|
|
6
|
+
const aiGenFactory_service_1 = require("../../aiGen/aiGenFactory.service");
|
|
7
|
+
const toolRegistry_1 = require("../toolRegistry");
|
|
8
|
+
const InputSchema = zod_1.z.object({
|
|
9
|
+
prompt: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.min(1)
|
|
12
|
+
.describe("Detailed motion + visual prompt. Describe subject, camera move, mood, lighting."),
|
|
13
|
+
modelKey: zod_1.z
|
|
14
|
+
.nativeEnum(aiModels_1.EVideoGenModels)
|
|
15
|
+
.describe("Pick by tier: T3 cinematic = google-veo-3.1, runway-gen4.5; balanced = kling-v2.6, bytedance-seedance-1.5-pro; cheap fast = minimax-hailuo-2.3-fast, pixverse-v5.6."),
|
|
16
|
+
durationSec: zod_1.z
|
|
17
|
+
.number()
|
|
18
|
+
.int()
|
|
19
|
+
.min(2)
|
|
20
|
+
.max(20)
|
|
21
|
+
.default(5)
|
|
22
|
+
.describe("Clip length in seconds (model-capped)."),
|
|
23
|
+
aspectRatio: zod_1.z.enum(["9:16", "16:9", "1:1", "4:5"]).default("9:16"),
|
|
24
|
+
resolution: zod_1.z.enum(["720p", "1080p", "4k"]).optional(),
|
|
25
|
+
inputImageUrl: zod_1.z
|
|
26
|
+
.string()
|
|
27
|
+
.url()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Source image for image-to-video. If set, this is an animate_image-style call."),
|
|
30
|
+
audio: zod_1.z.boolean().optional().describe("Whether the model should generate audio."),
|
|
31
|
+
negativePrompt: zod_1.z.string().optional(),
|
|
32
|
+
});
|
|
33
|
+
const OutputSchema = zod_1.z.object({
|
|
34
|
+
status: zod_1.z.literal("triggered"),
|
|
35
|
+
taskId: zod_1.z.string().describe("Provider task id — pass to monitor/poll layer."),
|
|
36
|
+
raw: zod_1.z.unknown(),
|
|
37
|
+
});
|
|
38
|
+
exports.generateVideoTool = {
|
|
39
|
+
name: "generate_video",
|
|
40
|
+
description: [
|
|
41
|
+
"Trigger AI video generation (T2 image-to-video or T3 text-to-video tier).",
|
|
42
|
+
"Returns immediately with a provider task id; the executor must poll status",
|
|
43
|
+
"via the existing job monitor — DO NOT block on completion in the tool.",
|
|
44
|
+
"Use sparingly: this is the most expensive tool. Prefer search_stock for",
|
|
45
|
+
"generic b-roll and animate_image (image-to-video) for product/scene shots",
|
|
46
|
+
"where a still + motion is enough.",
|
|
47
|
+
"Examples:",
|
|
48
|
+
' { prompt: "slow dolly into a steaming espresso cup, warm light", modelKey: "kling-v2.6", durationSec: 5 }',
|
|
49
|
+
' { prompt: "subject turns to camera, smiles", modelKey: "runway-gen4-turbo", inputImageUrl: "https://...", durationSec: 5 }',
|
|
50
|
+
].join(" "),
|
|
51
|
+
inputSchema: InputSchema,
|
|
52
|
+
outputSchema: OutputSchema,
|
|
53
|
+
idempotent: false,
|
|
54
|
+
estimateCost: async (input) => {
|
|
55
|
+
// Rough per-second tier estimate; precise pricing comes from aiModelConfigs.
|
|
56
|
+
const isPremium = input.modelKey.startsWith("google-veo-3") ||
|
|
57
|
+
input.modelKey.startsWith("runway-gen4") ||
|
|
58
|
+
input.modelKey.startsWith("openai-sora");
|
|
59
|
+
return Math.ceil(input.durationSec * (isPremium ? 12 : 4));
|
|
60
|
+
},
|
|
61
|
+
handler: async (input) => {
|
|
62
|
+
const provider = (0, aiGenFactory_service_1.getAiGenProviderService)(input.modelKey);
|
|
63
|
+
const result = await provider.generateVideo({
|
|
64
|
+
prompt: input.prompt,
|
|
65
|
+
modelKey: input.modelKey,
|
|
66
|
+
duration: input.durationSec,
|
|
67
|
+
aspectRatio: input.aspectRatio,
|
|
68
|
+
resolution: input.resolution,
|
|
69
|
+
inputImageUrl: input.inputImageUrl,
|
|
70
|
+
audio: input.audio,
|
|
71
|
+
negativePrompt: input.negativePrompt,
|
|
72
|
+
type: input.inputImageUrl ? "image-to-video" : "text-to-video",
|
|
73
|
+
});
|
|
74
|
+
const taskId = result.task?.taskId ??
|
|
75
|
+
result.task?.id ??
|
|
76
|
+
"unknown";
|
|
77
|
+
return {
|
|
78
|
+
status: "triggered",
|
|
79
|
+
taskId,
|
|
80
|
+
raw: result.task,
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
(0, toolRegistry_1.registerTool)(exports.generateVideoTool);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ToolDefinition } from "../toolRegistry";
|
|
3
|
+
declare const InputSchema: z.ZodObject<{
|
|
4
|
+
text: z.ZodString;
|
|
5
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
6
|
+
elevenlabs: "elevenlabs";
|
|
7
|
+
}>>;
|
|
8
|
+
voiceId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
languageCode: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
declare const OutputSchema: z.ZodObject<{
|
|
12
|
+
audioBase64: z.ZodString;
|
|
13
|
+
mimeType: z.ZodString;
|
|
14
|
+
extension: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const generateVoiceoverTool: ToolDefinition<typeof InputSchema, typeof OutputSchema>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=generateVoiceover.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateVoiceover.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/generateVoiceover.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAO/D,QAAA,MAAM,WAAW;;;;;;;iBAUf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;iBAMhB,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAChD,OAAO,WAAW,EAClB,OAAO,YAAY,CAkDpB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateVoiceoverTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const assetCache_service_1 = require("../../assetCache.service");
|
|
6
|
+
const ttsFactory_service_1 = require("../../tts/ttsFactory.service");
|
|
7
|
+
const toolRegistry_1 = require("../toolRegistry");
|
|
8
|
+
// Firestore docs are capped at ~1MB. Base64 inflates ~33%, so a 700KB
|
|
9
|
+
// payload limit keeps us safely under for the doc + metadata. Anything
|
|
10
|
+
// larger (long monologues at high bitrate) skips the cache write.
|
|
11
|
+
const VO_CACHE_MAX_BYTES = 700000;
|
|
12
|
+
const InputSchema = zod_1.z.object({
|
|
13
|
+
text: zod_1.z.string().min(1).describe("VO line to synthesize. One scene's worth."),
|
|
14
|
+
provider: zod_1.z.enum(["elevenlabs"]).default("elevenlabs"),
|
|
15
|
+
voiceId: zod_1.z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Provider-specific voice id. Omit to use the project default; the brand kit's voice id is auto-injected by the executor."),
|
|
19
|
+
languageCode: zod_1.z.string().optional().describe('Locale, e.g. "en", "fr-FR".'),
|
|
20
|
+
});
|
|
21
|
+
const OutputSchema = zod_1.z.object({
|
|
22
|
+
audioBase64: zod_1.z
|
|
23
|
+
.string()
|
|
24
|
+
.describe("Base64-encoded audio bytes — host uploads to GCS and swaps for url."),
|
|
25
|
+
mimeType: zod_1.z.string(),
|
|
26
|
+
extension: zod_1.z.string(),
|
|
27
|
+
});
|
|
28
|
+
exports.generateVoiceoverTool = {
|
|
29
|
+
name: "generate_voiceover",
|
|
30
|
+
description: [
|
|
31
|
+
"Generate a TTS voiceover line. One call per scene; do NOT batch multi-scene",
|
|
32
|
+
"scripts in one call — per-scene calls give the editor clean cut points and",
|
|
33
|
+
"the asset cache deduplicates retries.",
|
|
34
|
+
"Examples:",
|
|
35
|
+
' { text: "Try our new vitamin C serum — visibly brighter in 7 days." }',
|
|
36
|
+
' { text: "Bonjour", languageCode: "fr-FR" }',
|
|
37
|
+
].join(" "),
|
|
38
|
+
inputSchema: InputSchema,
|
|
39
|
+
outputSchema: OutputSchema,
|
|
40
|
+
idempotent: true,
|
|
41
|
+
estimateCost: async (input) => Math.max(1, Math.ceil(input.text.length / 200)),
|
|
42
|
+
handler: async (input) => {
|
|
43
|
+
const cacheParts = {
|
|
44
|
+
provider: `tts:${input.provider}`,
|
|
45
|
+
kind: "voiceover",
|
|
46
|
+
input: {
|
|
47
|
+
text: input.text,
|
|
48
|
+
voiceId: input.voiceId,
|
|
49
|
+
languageCode: input.languageCode,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const hit = await assetCache_service_1.RawAssetCacheService.lookup(cacheParts);
|
|
53
|
+
if (hit)
|
|
54
|
+
return hit;
|
|
55
|
+
const provider = (0, ttsFactory_service_1.getTtsProviderService)(input.provider);
|
|
56
|
+
const result = await provider.generate({
|
|
57
|
+
text: input.text,
|
|
58
|
+
voiceId: input.voiceId,
|
|
59
|
+
languageCode: input.languageCode,
|
|
60
|
+
});
|
|
61
|
+
const payload = {
|
|
62
|
+
audioBase64: result.audioBuffer.toString("base64"),
|
|
63
|
+
mimeType: result.mimeType,
|
|
64
|
+
extension: result.extension,
|
|
65
|
+
};
|
|
66
|
+
if (payload.audioBase64.length <= VO_CACHE_MAX_BYTES) {
|
|
67
|
+
void assetCache_service_1.RawAssetCacheService.store(cacheParts, payload).catch(() => undefined);
|
|
68
|
+
}
|
|
69
|
+
return payload;
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
(0, toolRegistry_1.registerTool)(exports.generateVoiceoverTool);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing this file registers every built-in tool with the toolRegistry.
|
|
3
|
+
* Host apps (Express server, Firebase Functions) import this once at boot.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./searchStock.tool";
|
|
6
|
+
export * from "./generateImage.tool";
|
|
7
|
+
export * from "./generateVideo.tool";
|
|
8
|
+
export * from "./generateVoiceover.tool";
|
|
9
|
+
export * from "./animateImage.tool";
|
|
10
|
+
export * from "./animateImageWithMotionBrush.tool";
|
|
11
|
+
export * from "./generateAvatarVideo.tool";
|
|
12
|
+
export * from "./planVideo.tool";
|
|
13
|
+
export * from "./composeScene.tool";
|
|
14
|
+
export * from "./render.tool";
|
|
15
|
+
export * from "./analyzeReference.tool";
|
|
16
|
+
export * from "./searchUserLibrary.tool";
|
|
17
|
+
export * from "./searchMusic.tool";
|
|
18
|
+
export * from "./estimateCost.tool";
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* Importing this file registers every built-in tool with the toolRegistry.
|
|
19
|
+
* Host apps (Express server, Firebase Functions) import this once at boot.
|
|
20
|
+
*/
|
|
21
|
+
__exportStar(require("./searchStock.tool"), exports);
|
|
22
|
+
__exportStar(require("./generateImage.tool"), exports);
|
|
23
|
+
__exportStar(require("./generateVideo.tool"), exports);
|
|
24
|
+
__exportStar(require("./generateVoiceover.tool"), exports);
|
|
25
|
+
__exportStar(require("./animateImage.tool"), exports);
|
|
26
|
+
__exportStar(require("./animateImageWithMotionBrush.tool"), exports);
|
|
27
|
+
__exportStar(require("./generateAvatarVideo.tool"), exports);
|
|
28
|
+
__exportStar(require("./planVideo.tool"), exports);
|
|
29
|
+
__exportStar(require("./composeScene.tool"), exports);
|
|
30
|
+
__exportStar(require("./render.tool"), exports);
|
|
31
|
+
__exportStar(require("./analyzeReference.tool"), exports);
|
|
32
|
+
__exportStar(require("./searchUserLibrary.tool"), exports);
|
|
33
|
+
__exportStar(require("./searchMusic.tool"), exports);
|
|
34
|
+
__exportStar(require("./estimateCost.tool"), exports);
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { LlmCaller } from "../llmCaller";
|
|
3
|
+
import { ToolDefinition } from "../toolRegistry";
|
|
4
|
+
export declare function setPlannerLlmCaller(llm: LlmCaller): void;
|
|
5
|
+
declare const InputSchema: z.ZodObject<{
|
|
6
|
+
brief: z.ZodObject<{
|
|
7
|
+
rawPrompt: z.ZodString;
|
|
8
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
9
|
+
niche: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
"ugc-ad": "ugc-ad";
|
|
11
|
+
"faceless-yt": "faceless-yt";
|
|
12
|
+
"product-demo": "product-demo";
|
|
13
|
+
"talking-head": "talking-head";
|
|
14
|
+
"social-recap": "social-recap";
|
|
15
|
+
"real-estate": "real-estate";
|
|
16
|
+
recipe: "recipe";
|
|
17
|
+
travel: "travel";
|
|
18
|
+
fitness: "fitness";
|
|
19
|
+
"podcast-clip": "podcast-clip";
|
|
20
|
+
education: "education";
|
|
21
|
+
news: "news";
|
|
22
|
+
other: "other";
|
|
23
|
+
}>>;
|
|
24
|
+
audience: z.ZodOptional<z.ZodString>;
|
|
25
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
energetic: "energetic";
|
|
27
|
+
calm: "calm";
|
|
28
|
+
cinematic: "cinematic";
|
|
29
|
+
playful: "playful";
|
|
30
|
+
casual: "casual";
|
|
31
|
+
professional: "professional";
|
|
32
|
+
edgy: "edgy";
|
|
33
|
+
warm: "warm";
|
|
34
|
+
informational: "informational";
|
|
35
|
+
}>>;
|
|
36
|
+
hookStyle: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
question: "question";
|
|
38
|
+
"bold-claim": "bold-claim";
|
|
39
|
+
"pattern-interrupt": "pattern-interrupt";
|
|
40
|
+
story: "story";
|
|
41
|
+
stat: "stat";
|
|
42
|
+
demo: "demo";
|
|
43
|
+
"voiceover-only": "voiceover-only";
|
|
44
|
+
}>>;
|
|
45
|
+
pacing: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
medium: "medium";
|
|
47
|
+
fast: "fast";
|
|
48
|
+
slow: "slow";
|
|
49
|
+
"very-fast": "very-fast";
|
|
50
|
+
}>>;
|
|
51
|
+
durationSec: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
aspect: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
"9:16": "9:16";
|
|
54
|
+
"16:9": "16:9";
|
|
55
|
+
"1:1": "1:1";
|
|
56
|
+
"4:5": "4:5";
|
|
57
|
+
}>>;
|
|
58
|
+
voice: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
gender: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
female: "female";
|
|
61
|
+
male: "male";
|
|
62
|
+
neutral: "neutral";
|
|
63
|
+
}>>;
|
|
64
|
+
ageRange: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
child: "child";
|
|
66
|
+
teen: "teen";
|
|
67
|
+
"young-adult": "young-adult";
|
|
68
|
+
adult: "adult";
|
|
69
|
+
senior: "senior";
|
|
70
|
+
}>>;
|
|
71
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
72
|
+
language: z.ZodDefault<z.ZodString>;
|
|
73
|
+
voiceId: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
music: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
moods: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
77
|
+
energetic: "energetic";
|
|
78
|
+
calm: "calm";
|
|
79
|
+
cinematic: "cinematic";
|
|
80
|
+
uplifting: "uplifting";
|
|
81
|
+
tense: "tense";
|
|
82
|
+
dreamy: "dreamy";
|
|
83
|
+
dark: "dark";
|
|
84
|
+
playful: "playful";
|
|
85
|
+
}>>>;
|
|
86
|
+
bpmMin: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
bpmMax: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
cta: z.ZodOptional<z.ZodString>;
|
|
90
|
+
claims: z.ZodDefault<z.ZodObject<{
|
|
91
|
+
allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
92
|
+
block: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
references: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
95
|
+
url: z.ZodString;
|
|
96
|
+
analyzed: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
durationMs: z.ZodNumber;
|
|
98
|
+
sceneCount: z.ZodNumber;
|
|
99
|
+
hookMs: z.ZodNumber;
|
|
100
|
+
cutsPerSecond: z.ZodNumber;
|
|
101
|
+
bpm: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
transcriptExcerpt: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
|
+
tierBudget: z.ZodDefault<z.ZodEnum<{
|
|
106
|
+
T0: "T0";
|
|
107
|
+
T1: "T1";
|
|
108
|
+
T2: "T2";
|
|
109
|
+
T3: "T3";
|
|
110
|
+
}>>;
|
|
111
|
+
confidence: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
declare const OutputSchema: z.ZodObject<{
|
|
115
|
+
plan: z.ZodObject<{
|
|
116
|
+
briefId: z.ZodOptional<z.ZodString>;
|
|
117
|
+
persona: z.ZodEnum<{
|
|
118
|
+
"ugc-ad": "ugc-ad";
|
|
119
|
+
"faceless-yt": "faceless-yt";
|
|
120
|
+
"product-demo": "product-demo";
|
|
121
|
+
"talking-head": "talking-head";
|
|
122
|
+
"social-recap": "social-recap";
|
|
123
|
+
}>;
|
|
124
|
+
aspect: z.ZodEnum<{
|
|
125
|
+
"9:16": "9:16";
|
|
126
|
+
"16:9": "16:9";
|
|
127
|
+
"1:1": "1:1";
|
|
128
|
+
"4:5": "4:5";
|
|
129
|
+
}>;
|
|
130
|
+
totalDurationMs: z.ZodNumber;
|
|
131
|
+
totalEstimatedCredits: z.ZodNumber;
|
|
132
|
+
scenes: z.ZodArray<z.ZodObject<{
|
|
133
|
+
sceneIndex: z.ZodNumber;
|
|
134
|
+
intent: z.ZodString;
|
|
135
|
+
strategy: z.ZodEnum<{
|
|
136
|
+
"stock-video": "stock-video";
|
|
137
|
+
"stock-image-ken-burns": "stock-image-ken-burns";
|
|
138
|
+
"ai-image-static": "ai-image-static";
|
|
139
|
+
"ai-image-motion": "ai-image-motion";
|
|
140
|
+
"ai-image-to-video": "ai-image-to-video";
|
|
141
|
+
"ai-text-to-video": "ai-text-to-video";
|
|
142
|
+
"user-asset": "user-asset";
|
|
143
|
+
"talking-head-avatar": "talking-head-avatar";
|
|
144
|
+
}>;
|
|
145
|
+
tier: z.ZodEnum<{
|
|
146
|
+
T0: "T0";
|
|
147
|
+
T1: "T1";
|
|
148
|
+
T2: "T2";
|
|
149
|
+
T3: "T3";
|
|
150
|
+
}>;
|
|
151
|
+
preferredProvider: z.ZodOptional<z.ZodString>;
|
|
152
|
+
preferredModel: z.ZodOptional<z.ZodString>;
|
|
153
|
+
prompt: z.ZodString;
|
|
154
|
+
durationMs: z.ZodNumber;
|
|
155
|
+
voiceoverLine: z.ZodOptional<z.ZodString>;
|
|
156
|
+
onScreenText: z.ZodOptional<z.ZodString>;
|
|
157
|
+
transitionIn: z.ZodDefault<z.ZodEnum<{
|
|
158
|
+
none: "none";
|
|
159
|
+
fade: "fade";
|
|
160
|
+
crossfade: "crossfade";
|
|
161
|
+
wipe: "wipe";
|
|
162
|
+
whipPan: "whipPan";
|
|
163
|
+
dipToBlack: "dipToBlack";
|
|
164
|
+
dipToWhite: "dipToWhite";
|
|
165
|
+
cut: "cut";
|
|
166
|
+
}>>;
|
|
167
|
+
estimatedCredits: z.ZodNumber;
|
|
168
|
+
avatarFaceUrl: z.ZodOptional<z.ZodString>;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
music: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
strategy: z.ZodEnum<{
|
|
172
|
+
none: "none";
|
|
173
|
+
"stock-track": "stock-track";
|
|
174
|
+
generated: "generated";
|
|
175
|
+
}>;
|
|
176
|
+
query: z.ZodOptional<z.ZodString>;
|
|
177
|
+
moodTag: z.ZodOptional<z.ZodString>;
|
|
178
|
+
bpm: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
url: z.ZodOptional<z.ZodString>;
|
|
180
|
+
durationSec: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
source: z.ZodOptional<z.ZodString>;
|
|
182
|
+
attribution: z.ZodOptional<z.ZodString>;
|
|
183
|
+
onsets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
voiceId: z.ZodOptional<z.ZodString>;
|
|
186
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
export declare const planVideoTool: ToolDefinition<typeof InputSchema, typeof OutputSchema>;
|
|
190
|
+
export {};
|
|
191
|
+
//# sourceMappingURL=planVideo.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planVideo.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/planVideo.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQ/D,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAExD;AAED,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEhB,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,cAAc,CACxC,OAAO,WAAW,EAClB,OAAO,YAAY,CAuBpB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planVideoTool = void 0;
|
|
4
|
+
exports.setPlannerLlmCaller = setPlannerLlmCaller;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const brief_schema_1 = require("../../../schemas/brief.schema");
|
|
7
|
+
const videoPlan_schema_1 = require("../../../schemas/videoPlan.schema");
|
|
8
|
+
const planner_1 = require("../planner");
|
|
9
|
+
const toolRegistry_1 = require("../toolRegistry");
|
|
10
|
+
/**
|
|
11
|
+
* The Planner needs an LlmCaller, which is host-wired (Vercel AI Gateway /
|
|
12
|
+
* OpenRouter). The tool layer is host-agnostic, so we expose a setter that
|
|
13
|
+
* the host calls once at boot. Until set, the tool errors loudly.
|
|
14
|
+
*/
|
|
15
|
+
let injectedLlm = null;
|
|
16
|
+
function setPlannerLlmCaller(llm) {
|
|
17
|
+
injectedLlm = llm;
|
|
18
|
+
}
|
|
19
|
+
const InputSchema = zod_1.z.object({
|
|
20
|
+
brief: brief_schema_1.VideoBriefSchema.describe("Structured brief produced by the intent-capture stage."),
|
|
21
|
+
});
|
|
22
|
+
const OutputSchema = zod_1.z.object({
|
|
23
|
+
plan: videoPlan_schema_1.VideoPlanSchema,
|
|
24
|
+
});
|
|
25
|
+
exports.planVideoTool = {
|
|
26
|
+
name: "plan_video",
|
|
27
|
+
description: [
|
|
28
|
+
"Turn a structured VideoBrief into a scene-by-scene VideoPlan with per-scene",
|
|
29
|
+
"tier, prompt, voiceover line, and estimated credits. Always run this BEFORE",
|
|
30
|
+
"any generate_* tool — the storyboard preview gate depends on a valid plan.",
|
|
31
|
+
"Do NOT call this multiple times for the same brief in one run; if the user",
|
|
32
|
+
"edits a scene, mutate the existing plan rather than re-planning from scratch.",
|
|
33
|
+
].join(" "),
|
|
34
|
+
inputSchema: InputSchema,
|
|
35
|
+
outputSchema: OutputSchema,
|
|
36
|
+
idempotent: false,
|
|
37
|
+
handler: async (input) => {
|
|
38
|
+
if (!injectedLlm) {
|
|
39
|
+
throw new Error("plan_video: no LlmCaller wired. Host must call setPlannerLlmCaller() at boot.");
|
|
40
|
+
}
|
|
41
|
+
const planner = new planner_1.Planner({ llm: injectedLlm });
|
|
42
|
+
const plan = await planner.plan(input.brief);
|
|
43
|
+
return { plan };
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
(0, toolRegistry_1.registerTool)(exports.planVideoTool);
|