vidspotai-shared 1.0.124 → 1.0.125

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.
Files changed (145) hide show
  1. package/lib/globals/aiModels/enums.d.ts +38 -0
  2. package/lib/globals/aiModels/enums.d.ts.map +1 -1
  3. package/lib/globals/aiModels/enums.js +49 -1
  4. package/lib/globals/aiModels/index.d.ts.map +1 -1
  5. package/lib/globals/aiModels/index.js +2 -0
  6. package/lib/globals/aiModels/providers/alibaba.d.ts.map +1 -1
  7. package/lib/globals/aiModels/providers/alibaba.js +460 -53
  8. package/lib/globals/aiModels/providers/bytedance.d.ts.map +1 -1
  9. package/lib/globals/aiModels/providers/bytedance.js +221 -39
  10. package/lib/globals/aiModels/providers/google.d.ts.map +1 -1
  11. package/lib/globals/aiModels/providers/google.js +178 -32
  12. package/lib/globals/aiModels/providers/kling.d.ts.map +1 -1
  13. package/lib/globals/aiModels/providers/kling.js +86 -12
  14. package/lib/globals/aiModels/providers/minimax.d.ts.map +1 -1
  15. package/lib/globals/aiModels/providers/minimax.js +77 -0
  16. package/lib/globals/aiModels/providers/openai.d.ts.map +1 -1
  17. package/lib/globals/aiModels/providers/openai.js +12 -0
  18. package/lib/globals/aiModels/providers/pixverse.d.ts.map +1 -1
  19. package/lib/globals/aiModels/providers/pixverse.js +101 -28
  20. package/lib/globals/aiModels/providers/runway.d.ts.map +1 -1
  21. package/lib/globals/aiModels/providers/runway.js +450 -24
  22. package/lib/globals/aiModels/providers/xai.d.ts +4 -0
  23. package/lib/globals/aiModels/providers/xai.d.ts.map +1 -0
  24. package/lib/globals/aiModels/providers/xai.js +72 -0
  25. package/lib/globals/aiModels/tierHelpers.d.ts +10 -0
  26. package/lib/globals/aiModels/tierHelpers.d.ts.map +1 -1
  27. package/lib/globals/aiModels/tierHelpers.js +48 -7
  28. package/lib/globals/aiModels/types.d.ts +21 -0
  29. package/lib/globals/aiModels/types.d.ts.map +1 -1
  30. package/lib/models/image.model.d.ts +24 -0
  31. package/lib/models/image.model.d.ts.map +1 -1
  32. package/lib/models/image.model.js +12 -0
  33. package/lib/models/index.d.ts +1 -0
  34. package/lib/models/index.d.ts.map +1 -1
  35. package/lib/models/index.js +1 -0
  36. package/lib/models/klingElement.model.d.ts +52 -0
  37. package/lib/models/klingElement.model.d.ts.map +1 -0
  38. package/lib/models/klingElement.model.js +24 -0
  39. package/lib/models/video.model.d.ts +11 -0
  40. package/lib/models/video.model.d.ts.map +1 -1
  41. package/lib/schemas/videoPlan.schema.d.ts +88 -0
  42. package/lib/schemas/videoPlan.schema.d.ts.map +1 -1
  43. package/lib/schemas/videoPlan.schema.js +27 -1
  44. package/lib/services/agent/executor/visual.d.ts.map +1 -1
  45. package/lib/services/agent/executor/visual.js +40 -2
  46. package/lib/services/agent/mentionedRefs.d.ts.map +1 -1
  47. package/lib/services/agent/mentionedRefs.js +4 -1
  48. package/lib/services/agent/planner/structuralRules.d.ts.map +1 -1
  49. package/lib/services/agent/planner/structuralRules.js +8 -3
  50. package/lib/services/agent/poster/posterAgent.schema.d.ts +3 -3
  51. package/lib/services/agent/providerFallback/chains.d.ts +25 -0
  52. package/lib/services/agent/providerFallback/chains.d.ts.map +1 -1
  53. package/lib/services/agent/providerFallback/chains.js +59 -5
  54. package/lib/services/agent/repair/strategies/llmRepair.strategy.d.ts.map +1 -1
  55. package/lib/services/agent/repair/strategies/llmRepair.strategy.js +2 -0
  56. package/lib/services/agent/tools/animateImage.tool.d.ts +31 -0
  57. package/lib/services/agent/tools/animateImage.tool.d.ts.map +1 -1
  58. package/lib/services/agent/tools/animateImage.tool.js +10 -3
  59. package/lib/services/agent/tools/generateImage.tool.d.ts +8 -4
  60. package/lib/services/agent/tools/generateImage.tool.d.ts.map +1 -1
  61. package/lib/services/agent/tools/generateImage.tool.js +24 -7
  62. package/lib/services/agent/tools/generateVideo.tool.d.ts +32 -0
  63. package/lib/services/agent/tools/generateVideo.tool.d.ts.map +1 -1
  64. package/lib/services/agent/tools/generateVideo.tool.js +37 -9
  65. package/lib/services/agent/tools/planVideo.tool.d.ts +19 -0
  66. package/lib/services/agent/tools/planVideo.tool.d.ts.map +1 -1
  67. package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
  68. package/lib/services/aiGen/aiGenFactory.service.js +40 -0
  69. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts +6 -3
  70. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts.map +1 -1
  71. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.js +35 -0
  72. package/lib/services/aiGen/canonicalAdapters/cameraDirection.d.ts +36 -0
  73. package/lib/services/aiGen/canonicalAdapters/cameraDirection.d.ts.map +1 -0
  74. package/lib/services/aiGen/canonicalAdapters/cameraDirection.js +168 -0
  75. package/lib/services/aiGen/canonicalAdapters/index.d.ts +1 -0
  76. package/lib/services/aiGen/canonicalAdapters/index.d.ts.map +1 -1
  77. package/lib/services/aiGen/canonicalAdapters/index.js +1 -0
  78. package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts +3 -2
  79. package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts.map +1 -1
  80. package/lib/services/aiGen/helpers.d.ts +40 -0
  81. package/lib/services/aiGen/helpers.d.ts.map +1 -1
  82. package/lib/services/aiGen/helpers.js +48 -2
  83. package/lib/services/aiGen/index.d.ts +1 -0
  84. package/lib/services/aiGen/index.d.ts.map +1 -1
  85. package/lib/services/aiGen/index.js +3 -0
  86. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts +13 -1
  87. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts.map +1 -1
  88. package/lib/services/aiGen/providers/alibaba/alibaba.js +313 -33
  89. package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts +29 -1
  90. package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
  91. package/lib/services/aiGen/providers/bytedance/bytedance.service.js +371 -54
  92. package/lib/services/aiGen/providers/google/google.service.d.ts +16 -0
  93. package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
  94. package/lib/services/aiGen/providers/google/google.service.js +331 -114
  95. package/lib/services/aiGen/providers/google/googleKeyPool.d.ts +6 -0
  96. package/lib/services/aiGen/providers/google/googleKeyPool.d.ts.map +1 -1
  97. package/lib/services/aiGen/providers/google/googleKeyPool.js +8 -0
  98. package/lib/services/aiGen/providers/kling/kling.service.d.ts +17 -1
  99. package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -1
  100. package/lib/services/aiGen/providers/kling/kling.service.js +59 -3
  101. package/lib/services/aiGen/providers/kling/klingCredits.d.ts +1 -1
  102. package/lib/services/aiGen/providers/kling/klingCredits.d.ts.map +1 -1
  103. package/lib/services/aiGen/providers/kling/klingCredits.js +19 -1
  104. package/lib/services/aiGen/providers/kling/klingRequests.d.ts +37 -7
  105. package/lib/services/aiGen/providers/kling/klingRequests.d.ts.map +1 -1
  106. package/lib/services/aiGen/providers/kling/klingRequests.js +191 -13
  107. package/lib/services/aiGen/providers/kling/types.d.ts +78 -0
  108. package/lib/services/aiGen/providers/kling/types.d.ts.map +1 -1
  109. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts +11 -2
  110. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts.map +1 -1
  111. package/lib/services/aiGen/providers/minimax/minimax.service.js +168 -2
  112. package/lib/services/aiGen/providers/minimax/types.d.ts +63 -0
  113. package/lib/services/aiGen/providers/minimax/types.d.ts.map +1 -1
  114. package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts +12 -0
  115. package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts.map +1 -1
  116. package/lib/services/aiGen/providers/pixverse/pixverse.service.js +131 -17
  117. package/lib/services/aiGen/providers/runway/hostedModels.d.ts +84 -0
  118. package/lib/services/aiGen/providers/runway/hostedModels.d.ts.map +1 -0
  119. package/lib/services/aiGen/providers/runway/hostedModels.js +266 -0
  120. package/lib/services/aiGen/providers/runway/index.d.ts +1 -0
  121. package/lib/services/aiGen/providers/runway/index.d.ts.map +1 -1
  122. package/lib/services/aiGen/providers/runway/index.js +1 -0
  123. package/lib/services/aiGen/providers/runway/runway.service.d.ts +1 -1
  124. package/lib/services/aiGen/providers/runway/runway.service.d.ts.map +1 -1
  125. package/lib/services/aiGen/providers/runway/runway.service.js +118 -21
  126. package/lib/services/aiGen/providers/runway/types.d.ts +18 -3
  127. package/lib/services/aiGen/providers/runway/types.d.ts.map +1 -1
  128. package/lib/services/aiGen/providers/runway/types.js +31 -3
  129. package/lib/services/aiGen/providers/types.d.ts +55 -0
  130. package/lib/services/aiGen/providers/types.d.ts.map +1 -1
  131. package/lib/services/aiGen/providers/xai/xai.service.d.ts +19 -0
  132. package/lib/services/aiGen/providers/xai/xai.service.d.ts.map +1 -0
  133. package/lib/services/aiGen/providers/xai/xai.service.js +205 -0
  134. package/lib/services/firestore.service.d.ts +4 -0
  135. package/lib/services/firestore.service.d.ts.map +1 -1
  136. package/lib/services/firestore.service.js +5 -0
  137. package/lib/services/index.d.ts +1 -0
  138. package/lib/services/index.d.ts.map +1 -1
  139. package/lib/services/index.js +1 -0
  140. package/lib/services/klingElements/klingElementLibrary.service.d.ts +37 -0
  141. package/lib/services/klingElements/klingElementLibrary.service.d.ts.map +1 -0
  142. package/lib/services/klingElements/klingElementLibrary.service.js +179 -0
  143. package/lib/utils/helpers.d.ts.map +1 -1
  144. package/lib/utils/helpers.js +5 -1
  145. package/package.json +1 -1
@@ -5,6 +5,8 @@ const zod_1 = require("zod");
5
5
  const aiModels_1 = require("../../../globals/aiModels");
6
6
  const logger_1 = require("../../../utils/logger");
7
7
  const aiGenFactory_service_1 = require("../../aiGen/aiGenFactory.service");
8
+ const cameraDirection_1 = require("../../aiGen/canonicalAdapters/cameraDirection");
9
+ const videoPlan_schema_1 = require("../../../schemas/videoPlan.schema");
8
10
  const rateLimiter_1 = require("../../rateLimiter");
9
11
  const toolRegistry_1 = require("../toolRegistry");
10
12
  const chains_1 = require("../providerFallback/chains");
@@ -14,8 +16,9 @@ function pickChain(modelKey, isI2V) {
14
16
  modelKey === aiModels_1.EVideoGenModels.KLING_V2_6 ||
15
17
  modelKey === aiModels_1.EVideoGenModels.RUNWAY_GEN4_5 ||
16
18
  modelKey === aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_5 ||
17
- modelKey === aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0 ||
18
- modelKey.startsWith("openai-sora");
19
+ modelKey === aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0;
20
+ // REMOVED FOR v2 — kept for reference: Sora 2 shut down upstream 2026-09-24.
21
+ // || modelKey.startsWith("openai-sora");
19
22
  if (isI2V)
20
23
  return isPremium ? chains_1.T3_IMAGE_TO_VIDEO_CHAIN : chains_1.T2_IMAGE_TO_VIDEO_CHAIN;
21
24
  return isPremium ? chains_1.T3_TEXT_TO_VIDEO_CHAIN : chains_1.T2_TEXT_TO_VIDEO_CHAIN;
@@ -51,11 +54,20 @@ const InputSchema = zod_1.z.object({
51
54
  "animates FROM inputImageUrl (first frame) TO this image (last frame), the " +
52
55
  "cleanest way to get reliable directed motion between two specific " +
53
56
  "compositions. REQUIRES inputImageUrl (the first frame). Only " +
54
- "FLF-capable models accept it (google-veo-3.1/-fast, kling, runway-gen4-turbo, " +
55
- "alibaba-wan); the capability gate skips models that don't, and the chain " +
57
+ "FLF-capable models accept it (google-veo-3.1/-fast, kling, alibaba-wan); the capability gate skips models that don't, and the chain " +
56
58
  "falls back. Omit for normal single-image animation."),
57
59
  audio: zod_1.z.boolean().optional().describe("Whether the model should generate audio."),
58
60
  negativePrompt: zod_1.z.string().optional(),
61
+ cameraControl: videoPlan_schema_1.CameraControlSchema.optional().describe("Camera move (preset like dolly_in / pan_left / orbit_right / static, optional 0..1 intensity). " +
62
+ "Translated per model: MiniMax [Pan left] commands, a camera sentence in the prompt elsewhere."),
63
+ referenceImageUrls: zod_1.z
64
+ .array(zod_1.z.string().url())
65
+ .max(9)
66
+ .optional()
67
+ .describe("Identity / style reference images (NOT the first frame) — a character or product the clip " +
68
+ "must show. Models that take refs natively (google-veo-3.1 ≤3, kling-video-o1 / kling-v3-omni-video ≤7) " +
69
+ "are tried first; a fallback without ref support drops them."),
70
+ seed: zod_1.z.number().int().optional(),
59
71
  });
60
72
  const OutputSchema = zod_1.z.object({
61
73
  status: zod_1.z.literal("triggered"),
@@ -84,8 +96,9 @@ exports.generateVideoTool = {
84
96
  estimateCost: async (input) => {
85
97
  // Rough per-second tier estimate; precise pricing comes from aiModelConfigs.
86
98
  const isPremium = input.modelKey.startsWith("google-veo-3") ||
87
- input.modelKey.startsWith("runway-gen4") ||
88
- input.modelKey.startsWith("openai-sora");
99
+ input.modelKey.startsWith("runway-gen4");
100
+ // REMOVED FOR v2 — kept for reference: Sora 2 shut down upstream 2026-09-24.
101
+ // || input.modelKey.startsWith("openai-sora");
89
102
  return Math.ceil(input.durationSec * (isPremium ? 12 : 4));
90
103
  },
91
104
  handler: async (input) => {
@@ -97,7 +110,10 @@ exports.generateVideoTool = {
97
110
  logger_1.logger.warn("generate_video: lastFrameImageUrl ignored — no inputImageUrl (first frame) supplied", { modelKey: input.modelKey });
98
111
  }
99
112
  const lastFrameImageUrl = isI2V ? input.lastFrameImageUrl : undefined;
100
- const chain = (0, chains_1.buildVideoChain)(input.modelKey, pickChain(input.modelKey, isI2V));
113
+ const refs = input.referenceImageUrls ?? [];
114
+ // Reference images are a soft capability: a model that takes them goes
115
+ // first, one that doesn't stays in the chain as a last resort.
116
+ const chain = (0, chains_1.rankVideoChainByPreference)((0, chains_1.buildVideoChain)(input.modelKey, pickChain(input.modelKey, isI2V)), { referenceImages: refs.length });
101
117
  const outcome = await (0, withFallback_1.withProviderFallback)({
102
118
  providers: chain,
103
119
  capable: (m) => (0, chains_1.isVideoModelCapable)(m, {
@@ -130,7 +146,14 @@ exports.generateVideoTool = {
130
146
  let heldSlot = true;
131
147
  try {
132
148
  const provider = (0, aiGenFactory_service_1.getAiGenProviderService)(modelKey);
133
- const result = await provider.generateVideo({
149
+ const refLimit = (0, chains_1.modelReferenceImageLimit)(modelKey);
150
+ if (refs.length && refLimit === 0) {
151
+ logger_1.logger.warn("generate_video: model takes no reference images — dropping them", {
152
+ modelKey,
153
+ dropped: refs.length,
154
+ });
155
+ }
156
+ const result = await provider.generateVideo((0, cameraDirection_1.applyCameraDirection)({
134
157
  prompt: input.prompt,
135
158
  modelKey,
136
159
  duration: input.durationSec,
@@ -140,8 +163,13 @@ exports.generateVideoTool = {
140
163
  lastFrameImageUrl,
141
164
  audio: input.audio,
142
165
  negativePrompt: input.negativePrompt,
166
+ seed: input.seed,
167
+ cameraControl: input.cameraControl,
168
+ ...(refs.length && refLimit > 0
169
+ ? { referenceImageUrls: refs.slice(0, refLimit) }
170
+ : {}),
143
171
  type: isI2V ? "image-to-video" : "text-to-video",
144
- });
172
+ }));
145
173
  const taskId = result.task?.taskId ??
146
174
  result.task?.id ??
147
175
  (typeof result.task === "string" ? result.task : "unknown");
@@ -315,6 +315,25 @@ declare const OutputSchema: z.ZodObject<{
315
315
  characterAnchorSceneIndex: z.ZodOptional<z.ZodNumber>;
316
316
  bibleEntityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
317
317
  lastFramePrompt: z.ZodOptional<z.ZodString>;
318
+ cameraPreset: z.ZodOptional<z.ZodEnum<{
319
+ static: "static";
320
+ pan_left: "pan_left";
321
+ pan_right: "pan_right";
322
+ tilt_up: "tilt_up";
323
+ tilt_down: "tilt_down";
324
+ zoom_in: "zoom_in";
325
+ zoom_out: "zoom_out";
326
+ dolly_in: "dolly_in";
327
+ dolly_out: "dolly_out";
328
+ orbit_left: "orbit_left";
329
+ orbit_right: "orbit_right";
330
+ roll_left: "roll_left";
331
+ roll_right: "roll_right";
332
+ tracking: "tracking";
333
+ handheld: "handheld";
334
+ push_in: "push_in";
335
+ pull_out: "pull_out";
336
+ }>>;
318
337
  allowTrailingSilence: z.ZodOptional<z.ZodBoolean>;
319
338
  layout: z.ZodOptional<z.ZodObject<{
320
339
  composition: z.ZodEnum<{
@@ -1 +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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"aiGenFactory.service.d.ts","sourceRoot":"","sources":["../../../src/services/aiGen/aiGenFactory.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EACL,iBAAiB,EAEjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,qBAAqB,EAErB,qBAAqB,EAErB,eAAe,EACf,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAehC,KAAK,uBAAuB,GAAG,UAAU,wBAAwB,CAAC;AASlE,eAAO,MAAM,gBAAgB,EAAE,OAAO,CACpC,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAkEjD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,iBAAiB,EACjB,uBAAuB,CA2CxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,eAAe,EACf,uBAAuB,CAMxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,aAAa,EACb,uBAAuB,CAGxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAsBzE,CAAC;AAEJ;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,qBAAqB,EACrB,uBAAuB,CAGxB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,qBAAqB,EACrB,uBAAuB,CAGxB,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,qBAAqB,GAC9B,wBAAwB,CAM1B;AAED,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,qBAAqB,GAC9B,wBAAwB,CAM1B;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,WAAW,GACpB,wBAAwB,CAmB1B"}
1
+ {"version":3,"file":"aiGenFactory.service.d.ts","sourceRoot":"","sources":["../../../src/services/aiGen/aiGenFactory.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EACL,iBAAiB,EAEjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,qBAAqB,EAErB,qBAAqB,EAErB,eAAe,EACf,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAgBhC,KAAK,uBAAuB,GAAG,UAAU,wBAAwB,CAAC;AASlE,eAAO,MAAM,gBAAgB,EAAE,OAAO,CACpC,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC,CA+FjD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,iBAAiB,EACjB,uBAAuB,CAsDxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,eAAe,EACf,uBAAuB,CAMxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,aAAa,EACb,uBAAuB,CAGxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAsBzE,CAAC;AAEJ;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,qBAAqB,EACrB,uBAAuB,CAGxB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,qBAAqB,EACrB,uBAAuB,CAGxB,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,qBAAqB,GAC9B,wBAAwB,CAM1B;AAED,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,qBAAqB,GAC9B,wBAAwB,CAM1B;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,WAAW,GACpB,wBAAwB,CAmB1B"}
@@ -17,6 +17,7 @@ const bytedance_service_1 = require("./providers/bytedance/bytedance.service");
17
17
  const elevenlabs_service_1 = require("./providers/elevenlabs/elevenlabs.service");
18
18
  const anthropic_service_1 = require("./providers/anthropic/anthropic.service");
19
19
  const falUpscale_service_1 = require("./providers/fal/falUpscale.service");
20
+ const xai_service_1 = require("./providers/xai/xai.service");
20
21
  // Partial, intentionally: hosted avatar engines (heygen-avatar, tavus-avatar)
21
22
  // are NOT generic video models — they're handled by the dedicated avatar seam
22
23
  // (getAvatarVideoProvider / IAvatarVideoProvider). getAiGenProviderService gates
@@ -26,10 +27,12 @@ const falUpscale_service_1 = require("./providers/fal/falUpscale.service");
26
27
  // KlingAvatarProvider adapter.)
27
28
  exports.videoServicesMap = {
28
29
  // --- Pixverse ---
30
+ "pixverse-c1": pixverse_service_1.PixVerseService,
29
31
  "pixverse-v6": pixverse_service_1.PixVerseService,
30
32
  "pixverse-v5.6": pixverse_service_1.PixVerseService,
31
33
  "pixverse-v5.5": pixverse_service_1.PixVerseService,
32
34
  "pixverse-v5": pixverse_service_1.PixVerseService,
35
+ "pixverse-lipsync": pixverse_service_1.PixVerseService,
33
36
  // --- ByteDance ---
34
37
  "bytedance-seedance-1.5-pro": bytedance_service_1.ByteDanceService,
35
38
  "bytedance-seedance-1.0-pro-fast": bytedance_service_1.ByteDanceService,
@@ -39,9 +42,12 @@ exports.videoServicesMap = {
39
42
  "bytedance-seedance-2.0-fast": bytedance_service_1.ByteDanceService,
40
43
  "bytedance-seedance-2.0-mini": bytedance_service_1.ByteDanceService,
41
44
  // --- Google ---
45
+ "google-gemini-omni-flash": google_service_1.GoogleService,
42
46
  "google-veo-3.1": google_service_1.GoogleService,
43
47
  "google-veo-3.1-fast": google_service_1.GoogleService,
44
48
  "google-veo-3.1-lite": google_service_1.GoogleService,
49
+ // Veo 3.0 shut down 2026-06-30 (no config → rejected at the API edge); the
50
+ // mapping stays only so historical job docs still resolve a provider.
45
51
  "google-veo-3": google_service_1.GoogleService,
46
52
  "google-veo-3-fast": google_service_1.GoogleService,
47
53
  "google-veo-2": google_service_1.GoogleService,
@@ -49,6 +55,18 @@ exports.videoServicesMap = {
49
55
  "runway-gen4.5": runway_service_1.RunwayService,
50
56
  "runway-gen4-turbo": runway_service_1.RunwayService,
51
57
  "runway-gen4-aleph": runway_service_1.RunwayService,
58
+ "runway-wan3": runway_service_1.RunwayService,
59
+ "runway-seedance2.5": runway_service_1.RunwayService,
60
+ "runway-seedance2": runway_service_1.RunwayService,
61
+ "runway-seedance2-fast": runway_service_1.RunwayService,
62
+ "runway-seedance2-mini": runway_service_1.RunwayService,
63
+ "runway-grok-imagine-1.5": runway_service_1.RunwayService,
64
+ "runway-h3-max": runway_service_1.RunwayService,
65
+ "runway-hailuo3": runway_service_1.RunwayService,
66
+ "runway-veo3.1": runway_service_1.RunwayService,
67
+ "runway-veo3.1-fast": runway_service_1.RunwayService,
68
+ "runway-happyhorse-1.0": runway_service_1.RunwayService,
69
+ "runway-gemini-omni-flash": runway_service_1.RunwayService,
52
70
  // --- Kling ---
53
71
  "kling-v2.6": kling_service_1.KlingService,
54
72
  "kling-v2.5-turbo": kling_service_1.KlingService,
@@ -57,6 +75,7 @@ exports.videoServicesMap = {
57
75
  "kling-v2.1-master": kling_service_1.KlingService,
58
76
  "kling-v3.0": kling_service_1.KlingService,
59
77
  "kling-v3.0-turbo": kling_service_1.KlingService,
78
+ "kling-v3.0-omni": kling_service_1.KlingService,
60
79
  "kling-avatar": kling_service_1.KlingService,
61
80
  "kling-video-o1": kling_service_1.KlingService,
62
81
  "kling-v3-omni-video": kling_service_1.KlingService,
@@ -71,8 +90,19 @@ exports.videoServicesMap = {
71
90
  "openai-sora-2": openai_service_1.OpenaiService,
72
91
  "openai-sora-2-pro": openai_service_1.OpenaiService,
73
92
  // --- Alibaba ---
93
+ "alibaba-wan-3.0": alibaba_1.AlibabaService,
94
+ "alibaba-wan-3.0-prime": alibaba_1.AlibabaService,
95
+ "alibaba-happyhorse-1.1-t2v": alibaba_1.AlibabaService,
96
+ "alibaba-happyhorse-1.1-i2v": alibaba_1.AlibabaService,
97
+ "alibaba-happyhorse-1.1-r2v": alibaba_1.AlibabaService,
98
+ "alibaba-happyhorse-1.0-t2v": alibaba_1.AlibabaService,
99
+ "alibaba-happyhorse-1.0-i2v": alibaba_1.AlibabaService,
100
+ "alibaba-happyhorse-1.0-r2v": alibaba_1.AlibabaService,
101
+ "alibaba-happyhorse-1.0-video-edit": alibaba_1.AlibabaService,
74
102
  "alibaba-wan-2.7-t2v": alibaba_1.AlibabaService,
75
103
  "alibaba-wan-2.7-i2v": alibaba_1.AlibabaService,
104
+ "alibaba-wan-2.7-r2v": alibaba_1.AlibabaService,
105
+ "alibaba-wan-2.7-videoedit": alibaba_1.AlibabaService,
76
106
  "alibaba-wan-2.6-t2v": alibaba_1.AlibabaService,
77
107
  "alibaba-wan-2.6-i2v": alibaba_1.AlibabaService,
78
108
  "alibaba-wan-2.6-i2v-flash": alibaba_1.AlibabaService,
@@ -102,13 +132,18 @@ exports.imageServicesMap = {
102
132
  [aiModels_1.EImageGenModels.GOOGLE_IMAGEN_4_FAST]: google_service_1.GoogleService,
103
133
  [aiModels_1.EImageGenModels.GOOGLE_NANO_BANANA_PRO]: google_service_1.GoogleService,
104
134
  [aiModels_1.EImageGenModels.GOOGLE_NANO_BANANA]: google_service_1.GoogleService,
135
+ [aiModels_1.EImageGenModels.GOOGLE_NANO_BANANA_2]: google_service_1.GoogleService,
105
136
  // --- OpenAI gpt-image ---
106
137
  [aiModels_1.EImageGenModels.OPENAI_GPT_IMAGE_2]: openai_service_1.OpenaiService,
107
138
  [aiModels_1.EImageGenModels.OPENAI_GPT_IMAGE_1_5]: openai_service_1.OpenaiService,
108
139
  [aiModels_1.EImageGenModels.OPENAI_GPT_IMAGE_1]: openai_service_1.OpenaiService,
109
140
  [aiModels_1.EImageGenModels.OPENAI_GPT_IMAGE_1_MINI]: openai_service_1.OpenaiService,
110
141
  // --- ByteDance Seedream 5 (Lite only — pro/edit unreleased) ---
142
+ [aiModels_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_PRO]: bytedance_service_1.ByteDanceService,
143
+ [aiModels_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_FLASH]: bytedance_service_1.ByteDanceService,
111
144
  [aiModels_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_LITE]: bytedance_service_1.ByteDanceService,
145
+ [aiModels_1.EImageGenModels.BYTEDANCE_SEEDREAM_4_5]: bytedance_service_1.ByteDanceService,
146
+ [aiModels_1.EImageGenModels.BYTEDANCE_SEEDREAM_4_0]: bytedance_service_1.ByteDanceService,
112
147
  // --- Kling first-party image API (KlingImageService) ---
113
148
  [aiModels_1.EImageGenModels.KLING_IMAGE_O1]: klingImage_service_1.KlingImageService,
114
149
  [aiModels_1.EImageGenModels.KLING_V3_OMNI_IMAGE]: klingImage_service_1.KlingImageService,
@@ -116,6 +151,8 @@ exports.imageServicesMap = {
116
151
  // --- Kling Kolors (DashScope-hosted, legacy) ---
117
152
  [aiModels_1.EImageGenModels.KLING_KOLORS]: alibaba_1.AlibabaService,
118
153
  // --- Alibaba Qwen-Image ---
154
+ [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_3_PRO]: alibaba_1.AlibabaService,
155
+ [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_3]: alibaba_1.AlibabaService,
119
156
  [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_2_PRO]: alibaba_1.AlibabaService,
120
157
  [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_2]: alibaba_1.AlibabaService,
121
158
  [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_EDIT_MAX]: alibaba_1.AlibabaService,
@@ -126,6 +163,9 @@ exports.imageServicesMap = {
126
163
  [aiModels_1.EImageGenModels.ALIBABA_WAN_2_7_IMAGE]: alibaba_1.AlibabaService,
127
164
  // --- MiniMax image-01 ---
128
165
  [aiModels_1.EImageGenModels.MINIMAX_IMAGE_01]: minimax_service_1.MinimaxService,
166
+ // --- xAI Grok Imagine ---
167
+ [aiModels_1.EImageGenModels.XAI_GROK_IMAGINE_IMAGE_2]: xai_service_1.XaiService,
168
+ [aiModels_1.EImageGenModels.XAI_GROK_IMAGINE_IMAGE]: xai_service_1.XaiService,
129
169
  // --- RunwayML Gen-4 Image ---
130
170
  [aiModels_1.EImageGenModels.RUNWAYML_GEN4_IMAGE]: runway_service_1.RunwayService,
131
171
  [aiModels_1.EImageGenModels.RUNWAYML_GEN4_IMAGE_TURBO]: runway_service_1.RunwayService,
@@ -5,10 +5,13 @@
5
5
  * motion intensity), MiniMax Director (in-prompt commands), Seedance (in-prompt),
6
6
  * and Pixverse V6 (lens-control prompt vocabulary).
7
7
  *
8
- * Providers that don't expose camera control (Veo, OpenAI, Wan T2V) ignore the
9
- * field with a logged warning rather than throwing.
8
+ * Every video model gets it: `applyCameraDirection` (./cameraDirection.ts)
9
+ * turns it into whatever the model documents — MiniMax `[Pan left]` commands,
10
+ * Seedance 1.x `camera_fixed`, or a plain camera sentence in the prompt.
10
11
  */
11
- export type CameraPreset = "static" | "pan_left" | "pan_right" | "tilt_up" | "tilt_down" | "zoom_in" | "zoom_out" | "dolly_in" | "dolly_out" | "orbit_left" | "orbit_right" | "roll_left" | "roll_right" | "tracking" | "handheld" | "push_in" | "pull_out";
12
+ export declare const CAMERA_PRESETS: readonly ["static", "pan_left", "pan_right", "tilt_up", "tilt_down", "zoom_in", "zoom_out", "dolly_in", "dolly_out", "orbit_left", "orbit_right", "roll_left", "roll_right", "tracking", "handheld", "push_in", "pull_out"];
13
+ export type CameraPreset = (typeof CAMERA_PRESETS)[number];
14
+ export declare function isCameraPreset(v: unknown): v is CameraPreset;
12
15
  /**
13
16
  * Six-axis vector control (mirrors Kling's `camera_control.config` shape).
14
17
  * Each axis is in [-10, 10]. Adapters that don't support fine-grained vector
@@ -1 +1 @@
1
- {"version":3,"file":"cameraControl.types.d.ts","sourceRoot":"","sources":["../../../../src/services/aiGen/canonicalAdapters/cameraControl.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,UAAU,GACV,WAAW,GACX,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,YAAY,GACZ,aAAa,GACb,WAAW,GACX,YAAY,GACZ,UAAU,GACV,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
1
+ {"version":3,"file":"cameraControl.types.d.ts","sourceRoot":"","sources":["../../../../src/services/aiGen/canonicalAdapters/cameraControl.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,6NAkBjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAE5D;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,2 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CAMERA_PRESETS = void 0;
4
+ exports.isCameraPreset = isCameraPreset;
5
+ /**
6
+ * Canonical camera-control schema. Translated per-provider by adapters that
7
+ * live alongside each provider's service. The set is the union of camera
8
+ * primitives across Kling (typed presets + vector), Runway (named presets +
9
+ * motion intensity), MiniMax Director (in-prompt commands), Seedance (in-prompt),
10
+ * and Pixverse V6 (lens-control prompt vocabulary).
11
+ *
12
+ * Every video model gets it: `applyCameraDirection` (./cameraDirection.ts)
13
+ * turns it into whatever the model documents — MiniMax `[Pan left]` commands,
14
+ * Seedance 1.x `camera_fixed`, or a plain camera sentence in the prompt.
15
+ */
16
+ exports.CAMERA_PRESETS = [
17
+ "static",
18
+ "pan_left",
19
+ "pan_right",
20
+ "tilt_up",
21
+ "tilt_down",
22
+ "zoom_in",
23
+ "zoom_out",
24
+ "dolly_in",
25
+ "dolly_out",
26
+ "orbit_left",
27
+ "orbit_right",
28
+ "roll_left",
29
+ "roll_right",
30
+ "tracking",
31
+ "handheld",
32
+ "push_in",
33
+ "pull_out",
34
+ ];
35
+ function isCameraPreset(v) {
36
+ return typeof v === "string" && exports.CAMERA_PRESETS.includes(v);
37
+ }
@@ -0,0 +1,36 @@
1
+ import type { CameraControl, CameraPreset } from "./cameraControl.types";
2
+ /**
3
+ * Canonical camera control → what each video model actually documents.
4
+ *
5
+ * Almost no current model takes a structured camera parameter any more — Kling
6
+ * dropped `camera_control` from its 2.5-turbo / 2.6 / v3 / Omni APIs (its docs
7
+ * steer camera through the prompt: "Camera zooms out, the girl smiles"), and
8
+ * Veo, Sora, Wan, Pixverse, Seedance 2.x and Grok Imagine read camera direction
9
+ * from the prompt too. So the default is a plain camera sentence ahead of the
10
+ * prompt, and only models with a documented syntax get something else:
11
+ *
12
+ * - MiniMax H3 / H3 Max / Hailuo-02 / 2.3 / 2.3-Fast: `[Pan left]`-style
13
+ * commands, 15 of them, combinable inside one bracket (platform.minimax.io
14
+ * video-generation-t2v, "Supported 15 camera commands"; the H3 guide asks
15
+ * for the same bracketed moves after key descriptions).
16
+ * - Runway: its own bracketed clause (providers/runway/cameraAdapter).
17
+ * - Seedance 1.x: a "static" camera becomes `camera_fixed: true` (the only
18
+ * camera parameter ModelArk documents) on models that declare
19
+ * `cameraFixed`; other moves go in the prompt.
20
+ *
21
+ * Call it once, right before `provider.generateVideo`. It clears
22
+ * `cameraControl` from the params it returns so a service that still maps the
23
+ * field itself (Kling, Runway) can't apply the move twice.
24
+ */
25
+ export interface CameraDirectable {
26
+ modelKey?: string;
27
+ prompt?: string;
28
+ cameraControl?: CameraControl;
29
+ cameraFixed?: boolean;
30
+ }
31
+ /** Resolve the canonical control to a single preset (vector wins, like Kling's adapter). */
32
+ export declare function resolveCameraPreset(c: CameraControl | undefined): CameraPreset | undefined;
33
+ /** The camera clause for a model, or undefined when there's nothing to add. */
34
+ export declare function cameraPromptClause(modelKey: string | undefined, c: CameraControl, prompt: string | undefined): string | undefined;
35
+ export declare function applyCameraDirection<T extends CameraDirectable>(params: T): T;
36
+ //# sourceMappingURL=cameraDirection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cameraDirection.d.ts","sourceRoot":"","sources":["../../../../src/services/aiGen/canonicalAdapters/cameraDirection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAgB,MAAM,uBAAuB,CAAC;AAEvF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAoHD,4FAA4F;AAC5F,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAI1F;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,CAAC,EAAE,aAAa,EAChB,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,SAAS,CAcpB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,gBAAgB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAmB7E"}
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveCameraPreset = resolveCameraPreset;
4
+ exports.cameraPromptClause = cameraPromptClause;
5
+ exports.applyCameraDirection = applyCameraDirection;
6
+ const aiModels_1 = require("../../../globals/aiModels");
7
+ const cameraAdapter_1 = require("../providers/runway/cameraAdapter");
8
+ /** Prompt sentence per preset — standard cinematography wording. */
9
+ const PRESET_SENTENCE = {
10
+ static: "Static camera, locked off, no camera movement",
11
+ pan_left: "The camera pans left",
12
+ pan_right: "The camera pans right",
13
+ tilt_up: "The camera tilts up",
14
+ tilt_down: "The camera tilts down",
15
+ zoom_in: "The camera zooms in",
16
+ zoom_out: "The camera zooms out",
17
+ dolly_in: "The camera dollies in toward the subject",
18
+ dolly_out: "The camera dollies back away from the subject",
19
+ orbit_left: "The camera orbits left around the subject",
20
+ orbit_right: "The camera orbits right around the subject",
21
+ roll_left: "The camera rolls counter-clockwise",
22
+ roll_right: "The camera rolls clockwise",
23
+ tracking: "Tracking shot, the camera follows the subject",
24
+ handheld: "Handheld camera with natural shake",
25
+ push_in: "Slow push-in toward the subject",
26
+ pull_out: "Slow pull-out revealing the scene",
27
+ };
28
+ /**
29
+ * Words that mean the prompt already carries this move (the planner copies a
30
+ * motion ref's direction into scene.prompt), so we don't say it twice.
31
+ */
32
+ const PRESET_KEYWORDS = {
33
+ static: /\bstatic (shot|camera)\b|\blocked[- ]off\b/i,
34
+ pan_left: /\bpans? (to the )?left\b/i,
35
+ pan_right: /\bpans? (to the )?right\b/i,
36
+ tilt_up: /\btilts? up\b/i,
37
+ tilt_down: /\btilts? down\b/i,
38
+ zoom_in: /\bzooms? in\b/i,
39
+ zoom_out: /\bzooms? out\b/i,
40
+ dolly_in: /\bdoll(y|ies) in\b/i,
41
+ dolly_out: /\bdoll(y|ies) (out|back)\b/i,
42
+ orbit_left: /\borbits? (to the )?left\b|\bcounter-?clockwise orbit\b/i,
43
+ orbit_right: /\borbits? (to the )?right\b|\bclockwise orbit\b/i,
44
+ roll_left: /\brolls? (counter-?clockwise|left)\b/i,
45
+ roll_right: /\brolls? (clockwise|right)\b/i,
46
+ tracking: /\btracking shot\b|\bfollows? the subject\b/i,
47
+ handheld: /\bhand-?held\b/i,
48
+ push_in: /\bpush(es)?[- ]in\b/i,
49
+ pull_out: /\bpull(s)?[- ](out|back)\b/i,
50
+ };
51
+ /** MiniMax's documented commands (one or more per bracket, max 3). */
52
+ const PRESET_MINIMAX = {
53
+ static: ["Static shot"],
54
+ pan_left: ["Pan left"],
55
+ pan_right: ["Pan right"],
56
+ tilt_up: ["Tilt up"],
57
+ tilt_down: ["Tilt down"],
58
+ zoom_in: ["Zoom in"],
59
+ zoom_out: ["Zoom out"],
60
+ dolly_in: ["Push in"],
61
+ dolly_out: ["Pull out"],
62
+ // An orbit is a truck one way while panning back the other way to keep
63
+ // the subject centred (orbit left = camera travels left, pans right).
64
+ orbit_left: ["Truck left", "Pan right"],
65
+ orbit_right: ["Truck right", "Pan left"],
66
+ roll_left: null,
67
+ roll_right: null,
68
+ tracking: ["Tracking shot"],
69
+ handheld: ["Shake"],
70
+ push_in: ["Push in"],
71
+ pull_out: ["Pull out"],
72
+ };
73
+ const MINIMAX_COMMAND_MODELS = new Set([
74
+ // H3 docs: "add camera motion instructions (e.g. [pan], [zoom], [static])
75
+ // directly after key descriptions" (guides/video-generation).
76
+ "minimax-h3",
77
+ "minimax-h3-max",
78
+ "minimax-hailuo-02",
79
+ "minimax-hailuo-2.3",
80
+ "minimax-hailuo-2.3-fast",
81
+ ]);
82
+ /** Dominant axis of a six-axis vector → the preset it reads as. */
83
+ function vectorToPreset(v) {
84
+ let best;
85
+ for (const axis of ["horizontal", "vertical", "pan", "tilt", "roll", "zoom"]) {
86
+ const value = v[axis];
87
+ if (typeof value === "number" && value !== 0 && (!best || Math.abs(value) > Math.abs(best.value))) {
88
+ best = { axis, value };
89
+ }
90
+ }
91
+ if (!best)
92
+ return "static";
93
+ const pos = best.value > 0;
94
+ switch (best.axis) {
95
+ case "horizontal":
96
+ return "tracking";
97
+ case "vertical":
98
+ return pos ? "tilt_up" : "tilt_down";
99
+ case "pan":
100
+ return pos ? "pan_right" : "pan_left";
101
+ case "tilt":
102
+ return pos ? "tilt_up" : "tilt_down";
103
+ case "roll":
104
+ return pos ? "roll_right" : "roll_left";
105
+ case "zoom":
106
+ return pos ? "zoom_in" : "zoom_out";
107
+ }
108
+ }
109
+ function intensityPrefix(i) {
110
+ if (i === undefined)
111
+ return undefined;
112
+ if (i <= 0.33)
113
+ return "subtle";
114
+ if (i >= 0.67)
115
+ return "strong";
116
+ return undefined;
117
+ }
118
+ /** Resolve the canonical control to a single preset (vector wins, like Kling's adapter). */
119
+ function resolveCameraPreset(c) {
120
+ if (!c)
121
+ return undefined;
122
+ if (c.vector)
123
+ return vectorToPreset(c.vector);
124
+ return c.preset;
125
+ }
126
+ /** The camera clause for a model, or undefined when there's nothing to add. */
127
+ function cameraPromptClause(modelKey, c, prompt) {
128
+ const preset = resolveCameraPreset(c);
129
+ if (!preset)
130
+ return undefined;
131
+ if (prompt && PRESET_KEYWORDS[preset].test(prompt))
132
+ return undefined;
133
+ const strength = intensityPrefix(c.intensity);
134
+ if (modelKey && MINIMAX_COMMAND_MODELS.has(modelKey)) {
135
+ const cmds = PRESET_MINIMAX[preset];
136
+ if (cmds)
137
+ return `[${cmds.join(",")}]`;
138
+ }
139
+ const sentence = PRESET_SENTENCE[preset];
140
+ if (!strength || preset === "static")
141
+ return `${sentence}.`;
142
+ return strength === "subtle"
143
+ ? `${sentence}, subtle and slow.`
144
+ : `${sentence}, fast and pronounced.`;
145
+ }
146
+ function applyCameraDirection(params) {
147
+ const c = params.cameraControl;
148
+ if (!c || (!c.preset && !c.vector))
149
+ return params;
150
+ const provider = params.modelKey ? (0, aiModels_1.getProviderKey)(params.modelKey) : "";
151
+ const fields = params.modelKey
152
+ ? aiModels_1.aiModelConfigs[params.modelKey]?.fields
153
+ : undefined;
154
+ if (fields && "cameraFixed" in fields && resolveCameraPreset(c) === "static") {
155
+ return { ...params, cameraFixed: true, cameraControl: undefined };
156
+ }
157
+ let prompt = params.prompt;
158
+ if (provider === "runway") {
159
+ const preset = resolveCameraPreset(c);
160
+ prompt = preset ? (0, cameraAdapter_1.applyRunwayCameraControl)(prompt, { ...c, preset }) : prompt;
161
+ }
162
+ else {
163
+ const clause = cameraPromptClause(params.modelKey, c, prompt);
164
+ if (clause)
165
+ prompt = prompt ? `${clause} ${prompt}` : clause;
166
+ }
167
+ return { ...params, prompt, cameraControl: undefined };
168
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./cameraControl.types";
2
2
  export * from "./multiShot.types";
3
+ export * from "./cameraDirection";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/aiGen/canonicalAdapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/aiGen/canonicalAdapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./cameraControl.types"), exports);
18
18
  __exportStar(require("./multiShot.types"), exports);
19
+ __exportStar(require("./cameraDirection"), exports);
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Canonical multi-shot schema. Per-provider adapters translate this into:
3
- * Kling v3.0 → `multi_prompt[]` (per-shot prompts) + companion `shot_type`
4
- * (v3.0 only — v2.x has no public multi-shot API)
3
+ * Kling omni-video (O1 / v3-omni) → `multi_prompt[]` + `shot_type`
4
+ * Kling v3.0 / 3.0 Turbo → prompt-encoded "shot n, m, words;" storyboard
5
+ * (toKlingShotPrompt; v2.x has no public multi-shot API)
5
6
  * Seedance → concatenated prompt with "--- CUT ---" separators
6
7
  * Pixverse → `generate_multi_clip_switch=true` + concatenated prompt (≤2 shots)
7
8
  * others → throw UnsupportedCapabilityError (gated by IModelSchema.fields.multiShot)
@@ -1 +1 @@
1
- {"version":3,"file":"multiShot.types.d.ts","sourceRoot":"","sources":["../../../../src/services/aiGen/canonicalAdapters/multiShot.types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,mEAAmE;AACnE,MAAM,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;AAE/B,qBAAa,0BAA2B,SAAQ,KAAK;aAEjC,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;gBADhB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;CAKnC"}
1
+ {"version":3,"file":"multiShot.types.d.ts","sourceRoot":"","sources":["../../../../src/services/aiGen/canonicalAdapters/multiShot.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,mEAAmE;AACnE,MAAM,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;AAE/B,qBAAa,0BAA2B,SAAQ,KAAK;aAEjC,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;gBADhB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;CAKnC"}
@@ -22,5 +22,45 @@ export declare function getModelsSupportingLastFrame(): string[];
22
22
  * supported by this model"). Same pattern as modelSupportsLastFrame, generalized.
23
23
  */
24
24
  export declare function modelDeclaresField(modelKey: string, field: string): boolean;
25
+ /** Whether the provider has shut this model down (config carries `retired`). */
26
+ /** Where the input-video seconds of a request come from (request body, job doc or scene). */
27
+ export interface InputVideoBillingSource {
28
+ inputVideoUrl?: string;
29
+ /** Measured length of `inputVideoUrl` (client reads it from the <video> element). */
30
+ inputVideoDurationSec?: number;
31
+ referenceVideoUrls?: string[];
32
+ /** Measured lengths of `referenceVideoUrls`, same order. */
33
+ referenceVideoDurationsSec?: number[];
34
+ /** Output duration — the stand-in for any clip the client didn't measure. */
35
+ duration?: number;
36
+ inputImageUrl?: string;
37
+ lastFrameImageUrl?: string;
38
+ referenceImageUrls?: string[];
39
+ /** Counted for providers that bill per audio reference (Runway Grok Imagine). */
40
+ referenceAudioUrls?: string[];
41
+ }
42
+ /**
43
+ * Input-video billing for getCreditUsed. Providers that bill input seconds
44
+ * (Wan 3.0, HappyHorse edit, MiniMax, Seedance 2.0) charge for EVERY video the
45
+ * request carries — the source clip and each reference clip — so both count.
46
+ * An unmeasured clip falls back to the output duration (the same conservative
47
+ * proxy the source clip always used). Every billing call site (precheck,
48
+ * upfront deduction, multi-scene true-up, reconcile) must go through this so
49
+ * the estimate and the reconcile agree.
50
+ */
51
+ export declare function getInputVideoBilling(src: InputVideoBillingSource): {
52
+ hasInputVideo: boolean;
53
+ inputVideoDurationSec?: number;
54
+ /**
55
+ * First frame + last frame + reference images. Some providers bill per
56
+ * input image (MiniMax H3 beyond a free allowance, Runway-hosted Hailuo /
57
+ * Grok / Gemini Omni Flash); the rest ignore it. Rides along here so every
58
+ * billing call site that already spreads this result passes it too.
59
+ */
60
+ numInputImages: number;
61
+ /** Reference audio clips (Runway-hosted Grok Imagine bills 1 credit each). */
62
+ numInputAudios: number;
63
+ };
64
+ export declare function isModelRetired(modelKey: string): boolean;
25
65
  export declare function validateParams(params: VideoGenerationParams): boolean;
26
66
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/services/aiGen/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGhE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAG3E;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAiKrE"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/services/aiGen/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGhE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAG3E;AAED,gFAAgF;AAChF,6FAA6F;AAC7F,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,4DAA4D;IAC5D,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,uBAAuB,GAAG;IAClE,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,cAAc,EAAE,MAAM,CAAC;CACxB,CAqBA;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CA6KrE"}