vidspotai-shared 1.0.124 → 1.0.126

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 (153) 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/user.model.d.ts +7 -1
  40. package/lib/models/user.model.d.ts.map +1 -1
  41. package/lib/models/video.model.d.ts +11 -0
  42. package/lib/models/video.model.d.ts.map +1 -1
  43. package/lib/schemas/videoPlan.schema.d.ts +88 -0
  44. package/lib/schemas/videoPlan.schema.d.ts.map +1 -1
  45. package/lib/schemas/videoPlan.schema.js +27 -1
  46. package/lib/services/agent/executor/visual.d.ts.map +1 -1
  47. package/lib/services/agent/executor/visual.js +40 -2
  48. package/lib/services/agent/mentionedRefs.d.ts.map +1 -1
  49. package/lib/services/agent/mentionedRefs.js +4 -1
  50. package/lib/services/agent/planner/structuralRules.d.ts.map +1 -1
  51. package/lib/services/agent/planner/structuralRules.js +8 -3
  52. package/lib/services/agent/poster/posterAgent.schema.d.ts +3 -3
  53. package/lib/services/agent/providerFallback/chains.d.ts +25 -0
  54. package/lib/services/agent/providerFallback/chains.d.ts.map +1 -1
  55. package/lib/services/agent/providerFallback/chains.js +59 -5
  56. package/lib/services/agent/repair/strategies/llmRepair.strategy.d.ts.map +1 -1
  57. package/lib/services/agent/repair/strategies/llmRepair.strategy.js +2 -0
  58. package/lib/services/agent/tools/animateImage.tool.d.ts +31 -0
  59. package/lib/services/agent/tools/animateImage.tool.d.ts.map +1 -1
  60. package/lib/services/agent/tools/animateImage.tool.js +10 -3
  61. package/lib/services/agent/tools/generateImage.tool.d.ts +8 -4
  62. package/lib/services/agent/tools/generateImage.tool.d.ts.map +1 -1
  63. package/lib/services/agent/tools/generateImage.tool.js +24 -7
  64. package/lib/services/agent/tools/generateVideo.tool.d.ts +32 -0
  65. package/lib/services/agent/tools/generateVideo.tool.d.ts.map +1 -1
  66. package/lib/services/agent/tools/generateVideo.tool.js +37 -9
  67. package/lib/services/agent/tools/planVideo.tool.d.ts +19 -0
  68. package/lib/services/agent/tools/planVideo.tool.d.ts.map +1 -1
  69. package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
  70. package/lib/services/aiGen/aiGenFactory.service.js +40 -0
  71. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts +6 -3
  72. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts.map +1 -1
  73. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.js +35 -0
  74. package/lib/services/aiGen/canonicalAdapters/cameraDirection.d.ts +36 -0
  75. package/lib/services/aiGen/canonicalAdapters/cameraDirection.d.ts.map +1 -0
  76. package/lib/services/aiGen/canonicalAdapters/cameraDirection.js +168 -0
  77. package/lib/services/aiGen/canonicalAdapters/index.d.ts +1 -0
  78. package/lib/services/aiGen/canonicalAdapters/index.d.ts.map +1 -1
  79. package/lib/services/aiGen/canonicalAdapters/index.js +1 -0
  80. package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts +3 -2
  81. package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts.map +1 -1
  82. package/lib/services/aiGen/helpers.d.ts +40 -0
  83. package/lib/services/aiGen/helpers.d.ts.map +1 -1
  84. package/lib/services/aiGen/helpers.js +48 -2
  85. package/lib/services/aiGen/index.d.ts +1 -0
  86. package/lib/services/aiGen/index.d.ts.map +1 -1
  87. package/lib/services/aiGen/index.js +3 -0
  88. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts +13 -1
  89. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts.map +1 -1
  90. package/lib/services/aiGen/providers/alibaba/alibaba.js +313 -33
  91. package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts +29 -1
  92. package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
  93. package/lib/services/aiGen/providers/bytedance/bytedance.service.js +371 -54
  94. package/lib/services/aiGen/providers/google/google.service.d.ts +16 -0
  95. package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
  96. package/lib/services/aiGen/providers/google/google.service.js +372 -116
  97. package/lib/services/aiGen/providers/google/googleKeyPool.d.ts +6 -0
  98. package/lib/services/aiGen/providers/google/googleKeyPool.d.ts.map +1 -1
  99. package/lib/services/aiGen/providers/google/googleKeyPool.js +8 -0
  100. package/lib/services/aiGen/providers/kling/kling.service.d.ts +17 -1
  101. package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -1
  102. package/lib/services/aiGen/providers/kling/kling.service.js +59 -3
  103. package/lib/services/aiGen/providers/kling/klingCredits.d.ts +1 -1
  104. package/lib/services/aiGen/providers/kling/klingCredits.d.ts.map +1 -1
  105. package/lib/services/aiGen/providers/kling/klingCredits.js +19 -1
  106. package/lib/services/aiGen/providers/kling/klingRequests.d.ts +37 -7
  107. package/lib/services/aiGen/providers/kling/klingRequests.d.ts.map +1 -1
  108. package/lib/services/aiGen/providers/kling/klingRequests.js +191 -13
  109. package/lib/services/aiGen/providers/kling/types.d.ts +78 -0
  110. package/lib/services/aiGen/providers/kling/types.d.ts.map +1 -1
  111. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts +11 -2
  112. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts.map +1 -1
  113. package/lib/services/aiGen/providers/minimax/minimax.service.js +168 -2
  114. package/lib/services/aiGen/providers/minimax/types.d.ts +63 -0
  115. package/lib/services/aiGen/providers/minimax/types.d.ts.map +1 -1
  116. package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts +12 -0
  117. package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts.map +1 -1
  118. package/lib/services/aiGen/providers/pixverse/pixverse.service.js +131 -17
  119. package/lib/services/aiGen/providers/runway/hostedModels.d.ts +84 -0
  120. package/lib/services/aiGen/providers/runway/hostedModels.d.ts.map +1 -0
  121. package/lib/services/aiGen/providers/runway/hostedModels.js +266 -0
  122. package/lib/services/aiGen/providers/runway/index.d.ts +1 -0
  123. package/lib/services/aiGen/providers/runway/index.d.ts.map +1 -1
  124. package/lib/services/aiGen/providers/runway/index.js +1 -0
  125. package/lib/services/aiGen/providers/runway/runway.service.d.ts +1 -1
  126. package/lib/services/aiGen/providers/runway/runway.service.d.ts.map +1 -1
  127. package/lib/services/aiGen/providers/runway/runway.service.js +118 -21
  128. package/lib/services/aiGen/providers/runway/types.d.ts +18 -3
  129. package/lib/services/aiGen/providers/runway/types.d.ts.map +1 -1
  130. package/lib/services/aiGen/providers/runway/types.js +31 -3
  131. package/lib/services/aiGen/providers/types.d.ts +55 -0
  132. package/lib/services/aiGen/providers/types.d.ts.map +1 -1
  133. package/lib/services/aiGen/providers/xai/xai.service.d.ts +19 -0
  134. package/lib/services/aiGen/providers/xai/xai.service.d.ts.map +1 -0
  135. package/lib/services/aiGen/providers/xai/xai.service.js +205 -0
  136. package/lib/services/firestore.service.d.ts +4 -0
  137. package/lib/services/firestore.service.d.ts.map +1 -1
  138. package/lib/services/firestore.service.js +5 -0
  139. package/lib/services/index.d.ts +2 -0
  140. package/lib/services/index.d.ts.map +1 -1
  141. package/lib/services/index.js +2 -0
  142. package/lib/services/klingElements/klingElementLibrary.service.d.ts +37 -0
  143. package/lib/services/klingElements/klingElementLibrary.service.d.ts.map +1 -0
  144. package/lib/services/klingElements/klingElementLibrary.service.js +179 -0
  145. package/lib/services/trialGuard/index.d.ts +2 -0
  146. package/lib/services/trialGuard/index.d.ts.map +1 -0
  147. package/lib/services/trialGuard/index.js +17 -0
  148. package/lib/services/trialGuard/trialSignals.d.ts +88 -0
  149. package/lib/services/trialGuard/trialSignals.d.ts.map +1 -0
  150. package/lib/services/trialGuard/trialSignals.js +160 -0
  151. package/lib/utils/helpers.d.ts.map +1 -1
  152. package/lib/utils/helpers.js +5 -1
  153. package/package.json +2 -1
@@ -5,6 +5,7 @@ const logger_1 = require("../../../utils/logger");
5
5
  const referenceImageRenderer_1 = require("../referenceImageRenderer");
6
6
  const extendChain_1 = require("../extendChain");
7
7
  const helpers_1 = require("../../aiGen/helpers");
8
+ const chains_1 = require("../providerFallback/chains");
8
9
  const unsplash_service_1 = require("../../aiGen/providers/unsplash/unsplash.service");
9
10
  const duration_1 = require("./duration");
10
11
  async function runVisual(deps, scene, ctx, aspect, plan) {
@@ -33,6 +34,17 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
33
34
  const identityRefs = anchorImageUrl
34
35
  ? Array.from(new Set([anchorImageUrl, ...referenceImageUrls]))
35
36
  : referenceImageUrls;
37
+ // Video models render 9:16 / 16:9 / 1:1 only; a 4:5 plan gets the closest.
38
+ const videoAspect = (0, chains_1.videoAspectFor)(aspect);
39
+ // The scene's camera move (from a @-mentioned motion ref or the planner).
40
+ const cameraControl = scene.cameraPreset ? { preset: scene.cameraPreset } : undefined;
41
+ // Cache identity for the two fields above, added only when they differ from
42
+ // what every pre-existing cache entry was minted with (9:16, no camera) so a
43
+ // re-execute of an older run still replays instead of re-submitting.
44
+ const videoCacheExtras = {
45
+ ...(videoAspect !== "9:16" ? { videoAspect } : {}),
46
+ ...(cameraControl ? { cameraPreset: scene.cameraPreset } : {}),
47
+ };
36
48
  const wrap = (tool, outcome) => outcome.ok
37
49
  ? { ok: true, output: { tool, ...outcome.output } }
38
50
  : { ok: false, error: outcome.error };
@@ -155,6 +167,7 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
155
167
  referenceImageUrls,
156
168
  extendSegments: extendChain?.length ?? 0,
157
169
  ...(useFlf ? { lastFramePrompt: scene.lastFramePrompt } : {}),
170
+ ...videoCacheExtras,
158
171
  };
159
172
  const { hit, inputsHash } = deps.checkTaskCache(clipId, "animate_image", cacheInput);
160
173
  if (hit) {
@@ -176,7 +189,8 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
176
189
  const img = await deps.runTool("generate_image", {
177
190
  prompt: scene.prompt,
178
191
  modelKey: "google-nano-banana",
179
- aspectRatio: aspect,
192
+ // The still is the clip's first frame — same shape as the clip.
193
+ aspectRatio: videoAspect,
180
194
  ...(identityRefs.length
181
195
  ? { inputImageUrls: identityRefs }
182
196
  : {}),
@@ -193,7 +207,7 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
193
207
  const endImg = await deps.runTool("generate_image", {
194
208
  prompt: scene.lastFramePrompt,
195
209
  modelKey: "google-nano-banana",
196
- aspectRatio: aspect,
210
+ aspectRatio: videoAspect,
197
211
  ...(identityRefs.length
198
212
  ? { inputImageUrls: identityRefs }
199
213
  : {}),
@@ -207,6 +221,10 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
207
221
  motionHint: scene.prompt,
208
222
  durationSec: animateDurationSec,
209
223
  modelKey: animateModelKey,
224
+ // Was never passed, so every agent i2v clip rendered at the tool's
225
+ // 9:16 default regardless of the plan's aspect.
226
+ aspectRatio: videoAspect,
227
+ ...(cameraControl ? { cameraControl } : {}),
210
228
  ...(lastFrameImageUrl ? { lastFrameImageUrl } : {}),
211
229
  }, ctx);
212
230
  if (!animate.ok)
@@ -232,6 +250,20 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
232
250
  }
233
251
  case "ai-text-to-video": {
234
252
  const t2vModelKey = scene.preferredModel ?? "kling-v2.6";
253
+ // A pinned subject (a @-mentioned character / product, or an earlier
254
+ // scene's identity still) has to reach the model as an image. Text-to-
255
+ // video models that take reference images get them directly below; for
256
+ // one that doesn't, the scene goes through image-to-video instead — a
257
+ // first frame generated WITH the refs, then animated — rather than a
258
+ // prompt-only clip of a stranger.
259
+ if (identityRefs.length && (0, chains_1.modelReferenceImageLimit)(t2vModelKey) === 0) {
260
+ logger_1.logger.info("executor: t2v scene has reference images but its model takes none — using image-to-video", {
261
+ sceneIndex: scene.sceneIndex,
262
+ modelKey: t2vModelKey,
263
+ refs: identityRefs.length,
264
+ });
265
+ return runVisual(deps, { ...scene, strategy: "ai-image-to-video" }, ctx, aspect, plan);
266
+ }
235
267
  // AG-2 / L-4: same extend-chain decision as ai-image-to-video.
236
268
  const chain = (0, extendChain_1.planExtendChain)(t2vModelKey, durationSec);
237
269
  const extendChain = chain?.segments;
@@ -254,6 +286,9 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
254
286
  modelKey: t2vModelKey,
255
287
  durationSec: t2vDurationSec,
256
288
  extendSegments: extendChain?.length ?? 0,
289
+ ...videoCacheExtras,
290
+ // Bible refs, not identityRefs — same reasoning as ai-image-to-video.
291
+ ...(identityRefs.length ? { referenceImageUrls } : {}),
257
292
  };
258
293
  const { hit, inputsHash } = deps.checkTaskCache(clipId, "generate_video", cacheInput);
259
294
  if (hit) {
@@ -273,6 +308,9 @@ async function runVisual(deps, scene, ctx, aspect, plan) {
273
308
  prompt: scene.prompt,
274
309
  modelKey: t2vModelKey,
275
310
  durationSec: t2vDurationSec,
311
+ aspectRatio: videoAspect,
312
+ ...(cameraControl ? { cameraControl } : {}),
313
+ ...(identityRefs.length ? { referenceImageUrls: identityRefs.slice(0, 9) } : {}),
276
314
  }, ctx);
277
315
  if (!out.ok)
278
316
  return wrap("generate_video", out);
@@ -1 +1 @@
1
- {"version":3,"file":"mentionedRefs.d.ts","sourceRoot":"","sources":["../../../src/services/agent/mentionedRefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAe,MAAM,gCAAgC,CAAC;AAgD/E;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,gBAAgB,GAAG,SAAS,EACnC,KAAK,EAAE,UAAU,GAChB,gBAAgB,GAAG,SAAS,CAwC9B;AAID;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAC7B,MAAM,CAmER"}
1
+ {"version":3,"file":"mentionedRefs.d.ts","sourceRoot":"","sources":["../../../src/services/agent/mentionedRefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAe,MAAM,gCAAgC,CAAC;AAkD/E;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,gBAAgB,GAAG,SAAS,EACnC,KAAK,EAAE,UAAU,GAChB,gBAAgB,GAAG,SAAS,CAwC9B;AAID;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAC7B,MAAM,CA2ER"}
@@ -123,7 +123,10 @@ function buildMentionedRefsSection(brief, bible) {
123
123
  const moves = by("motion");
124
124
  if (moves.length) {
125
125
  lines.push(" Camera moves — same placement rule as angles. Copy the direction into scene.prompt verbatim.", " A still can't carry a camera move, so those scenes must use ai-image-to-video or", " ai-text-to-video (never ai-image-static / stock-image-ken-burns):");
126
- moves.forEach((r) => lines.push(` ${r.name}: ${r.instruction}`));
126
+ moves.forEach((r) => lines.push(` ${r.name}: ${r.instruction}${r.presetKey ? ` [cameraPreset: ${r.presetKey}]` : ""}`));
127
+ if (moves.some((r) => r.presetKey)) {
128
+ lines.push(" For a move tagged [cameraPreset: X], also set scene.cameraPreset = X on those scenes — the", " video model gets it as a structured camera instruction in the syntax it understands.");
129
+ }
127
130
  }
128
131
  return lines.join("\n");
129
132
  }
@@ -1 +1 @@
1
- {"version":3,"file":"structuralRules.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/planner/structuralRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,+BAA+B,CAAC;AAG7E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CA0OrE"}
1
+ {"version":3,"file":"structuralRules.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/planner/structuralRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,+BAA+B,CAAC;AAG7E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAkPrE"}
@@ -130,12 +130,13 @@ function buildStructuralRulesSection(brief) {
130
130
  // • 3s floor: kling-v3.0 (T3)
131
131
  // • 4s floor: google-veo-3.1 / -fast / -lite, bytedance-seedance-1.5-pro,
132
132
  // bytedance-seedance-2.0 / -2.0-fast
133
- // • 5s floor: kling 2.x family, pixverse all, alibaba-wan, runway-gen4-turbo
133
+ // • 5s floor: kling 2.x family, pixverse all, alibaba-wan
134
+ // (runway-gen4-turbo now takes 2-10s, like gen4.5)
134
135
  // • 6s floor: minimax-hailuo-02 / 2.3 / 2.3-fast ← do NOT pick for <6s scenes.
135
136
  // The catalog above lists each model's "dur:..." constraint — match scene
136
137
  // durations to it. Pacing target can still be honoured by varying scene COUNT
137
138
  // (e.g. a 10s UGC at fast pacing = 2 scenes × 5s on pixverse, NOT 6 × 1.7s).
138
- lines.push(" - Provider duration floor: every scene with strategy=ai-image-to-video or ai-text-to-video MUST have durationMs/1000 in its preferredModel's allowed durations (shown as `dur:` in the catalog). Hard universal floor is 2s — no provider accepts sub-2s clips. If a desired scene is shorter than the floor, MERGE it with the next scene instead of generating a too-short clip. For sub-5s scenes, pick from: bytedance-seedance-1.0-pro / -pro-fast (2-12s), runway-gen4.5 (2-10s), kling-v3.0 (3-15s), google-veo-3.1* (4-8s). Picking minimax-hailuo for a <6s scene is a HARD ERROR.");
139
+ lines.push(" - Provider duration floor: every scene with strategy=ai-image-to-video or ai-text-to-video MUST have durationMs/1000 in its preferredModel's allowed durations (shown as `dur:` in the catalog). Hard universal floor is 2s — no provider accepts sub-2s clips. If a desired scene is shorter than the floor, MERGE it with the next scene instead of generating a too-short clip. For sub-5s scenes, pick from: bytedance-seedance-1.0-pro / -pro-fast (2-12s), runway-gen4.5 / runway-gen4-turbo (2-10s), kling-v3.0 (3-15s), google-veo-3.1* (4-8s). Picking minimax-hailuo for a <6s scene is a HARD ERROR.");
139
140
  // AG-28: voiceover-vs-scene duration budget. Without this, the planner
140
141
  // picks scene.durationMs based on visual pacing and the TTS that comes
141
142
  // out is consistently 1-2s longer per scene → voice clipped mid-sentence.
@@ -189,7 +190,11 @@ function buildStructuralRulesSection(brief) {
189
190
  // Only meaningful on ai-image-to-video scenes whose preferredModel is
190
191
  // FLF-capable; the executor silently ignores it otherwise, so the rule is
191
192
  // additive and safe to skip when no scene needs directed two-anchor motion.
192
- lines.push(" - First-last-frame (FLF) interpolation: for a scene with strategy=ai-image-to-video where the motion goes between TWO distinct, specific compositions (wide establishing shot → product close-up; closed door → open door; ingredient on counter → finished plated dish; logo small → logo filling frame), set scene.lastFramePrompt to a COMPLETE image prompt describing the END frame. scene.prompt is the START frame; the model interpolates between them for reliable directed motion instead of guessing from a single image + motion words. Rules: (1) lastFramePrompt is a full visual description of the final composition, NOT a motion verb (GOOD: \"extreme close-up of the bottle label, soft studio light\"; BAD: \"zoom into the label\"). (2) Keep subject/lighting/style consistent with scene.prompt so the interpolation reads as one continuous shot — re-state shared identity descriptors verbatim. (3) ONLY set it when preferredModel is FLF-capable: google-veo-3.1 / -fast, kling-v2.6 / -v2.5-turbo / -v3.0, runway-gen4-turbo / -gen4.5, alibaba-wan. On any other model it is ignored. (4) Use sparingly — only when a scene genuinely has two anchor compositions; ordinary single-image motion needs no lastFramePrompt. It costs one extra (cheap) image generation per FLF scene.");
193
+ lines.push(" - First-last-frame (FLF) interpolation: for a scene with strategy=ai-image-to-video where the motion goes between TWO distinct, specific compositions (wide establishing shot → product close-up; closed door → open door; ingredient on counter → finished plated dish; logo small → logo filling frame), set scene.lastFramePrompt to a COMPLETE image prompt describing the END frame. scene.prompt is the START frame; the model interpolates between them for reliable directed motion instead of guessing from a single image + motion words. Rules: (1) lastFramePrompt is a full visual description of the final composition, NOT a motion verb (GOOD: \"extreme close-up of the bottle label, soft studio light\"; BAD: \"zoom into the label\"). (2) Keep subject/lighting/style consistent with scene.prompt so the interpolation reads as one continuous shot — re-state shared identity descriptors verbatim. (3) ONLY set it when preferredModel is FLF-capable: google-veo-3.1 / -fast, kling-v2.6 / -v2.5-turbo / -v3.0, alibaba-wan (NOT Runway — its models take a first frame only). On any other model it is ignored. (4) Use sparingly — only when a scene genuinely has two anchor compositions; ordinary single-image motion needs no lastFramePrompt. It costs one extra (cheap) image generation per FLF scene.");
194
+ // Camera move as a structured field. The executor sends it to the video
195
+ // model as cameraControl; applyCameraDirection writes it in the syntax that
196
+ // model documents (MiniMax [Pan left] commands, a camera sentence, etc.).
197
+ lines.push(" - Camera move: on an ai-image-to-video or ai-text-to-video scene with ONE clear camera move, set scene.cameraPreset to it — one of 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. Keep describing the move in scene.prompt too. Leave it unset when the shot has no particular camera move or a compound one the list can't name.");
193
198
  // text-layout v1 — per-scene composition decision. Optional but strongly
194
199
  // recommended when source aspect ≠ target aspect (i.e. most stock video
195
200
  // and avatar shots on 9:16 vertical, or vertical UGC on 16:9 horizontal).
@@ -186,8 +186,8 @@ export declare const PosterVariantPlanSchema: z.ZodObject<{
186
186
  }, z.core.$strip>;
187
187
  scrim: z.ZodEnum<{
188
188
  none: "none";
189
- soft: "soft";
190
189
  strong: "strong";
190
+ soft: "soft";
191
191
  }>;
192
192
  imagePrompt: z.ZodString;
193
193
  negativePrompt: z.ZodOptional<z.ZodString>;
@@ -297,8 +297,8 @@ export declare const PosterPlanSchema: z.ZodObject<{
297
297
  }, z.core.$strip>;
298
298
  scrim: z.ZodEnum<{
299
299
  none: "none";
300
- soft: "soft";
301
300
  strong: "strong";
301
+ soft: "soft";
302
302
  }>;
303
303
  imagePrompt: z.ZodString;
304
304
  negativePrompt: z.ZodOptional<z.ZodString>;
@@ -446,8 +446,8 @@ export declare const PosterRefineRequestSchema: z.ZodObject<{
446
446
  }, z.core.$strip>;
447
447
  scrim: z.ZodEnum<{
448
448
  none: "none";
449
- soft: "soft";
450
449
  strong: "strong";
450
+ soft: "soft";
451
451
  }>;
452
452
  imagePrompt: z.ZodString;
453
453
  negativePrompt: z.ZodOptional<z.ZodString>;
@@ -52,6 +52,31 @@ export interface VideoCapabilityRequest {
52
52
  export declare function isVideoModelCapable(model: EVideoGenModels, req: VideoCapabilityRequest): boolean;
53
53
  /** Reduce a "W:H" or "WxH" ratio to lowest terms, e.g. "1280:720" → "16:9". */
54
54
  export declare function normalizeAspect(a: string): string;
55
+ /**
56
+ * How many reference images (identity / style refs that are NOT the first
57
+ * frame) a video model takes natively: its `referenceImageUrls.max`, Infinity
58
+ * when it declares the field without a cap, 0 when it doesn't take any.
59
+ */
60
+ export declare function modelReferenceImageLimit(m: EVideoGenModels | string): number;
61
+ /**
62
+ * Soft capability ordering for a fallback chain: models that natively cover
63
+ * every "nice to have" in `wants` go first, the rest keep their relative
64
+ * order behind them. Used for inputs a model can do without but renders worse
65
+ * without (reference images → the subject stops looking like the ref), so a
66
+ * capable model is tried before one that would drop them, without emptying
67
+ * the chain when none is capable.
68
+ */
69
+ export interface VideoPreference {
70
+ /** Reference images the caller wants honored. */
71
+ referenceImages?: number;
72
+ }
73
+ export declare function rankVideoChainByPreference(chain: readonly EVideoGenModels[], wants: VideoPreference): EVideoGenModels[];
74
+ /**
75
+ * The closest ratio a video model can render for a plan aspect. Every video
76
+ * model takes 9:16 / 16:9 / 1:1; 4:5 (feed) is image-only, and 1:1 is the
77
+ * closest shape, so the render crops the least from it.
78
+ */
79
+ export declare function videoAspectFor(aspect: string): "9:16" | "16:9" | "1:1";
55
80
  /**
56
81
  * Build a chain that puts the planner's pick first, then the rest of the
57
82
  * tier-appropriate chain (deduped). Honors the planner's intent while still
@@ -1 +1 @@
1
- {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/providerFallback/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,e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W,EAAE,MAAM,EACnB,IAAI,GAAE,mBAAwB,GAC7B,kBAAkB,GAAG,IAAI,CAyB3B"}
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SFX_CHAIN = exports.MUSIC_CHAIN = exports.AVATAR_VIDEO_CHAIN = exports.T3_IMAGE_TO_VIDEO_CHAIN = exports.T2_IMAGE_TO_VIDEO_CHAIN = exports.T2_TEXT_TO_VIDEO_CHAIN = exports.T3_TEXT_TO_VIDEO_CHAIN = void 0;
4
4
  exports.isVideoModelCapable = isVideoModelCapable;
5
5
  exports.normalizeAspect = normalizeAspect;
6
+ exports.modelReferenceImageLimit = modelReferenceImageLimit;
7
+ exports.rankVideoChainByPreference = rankVideoChainByPreference;
8
+ exports.videoAspectFor = videoAspectFor;
6
9
  exports.buildVideoChain = buildVideoChain;
7
10
  exports.snapDurationForModel = snapDurationForModel;
8
11
  const aiModels_1 = require("../../../globals/aiModels");
@@ -23,11 +26,16 @@ const helpers_1 = require("../../aiGen/helpers");
23
26
  // ── Video: text-to-video, T3 (cinematic) ──────────────────────────────
24
27
  exports.T3_TEXT_TO_VIDEO_CHAIN = [
25
28
  aiModels_1.EVideoGenModels.GOOGLE_VEO_3_1,
29
+ // Gemini Omni Flash: Google's current default video model (GA), 3-10s, ~$0.10/s.
30
+ aiModels_1.EVideoGenModels.GOOGLE_GEMINI_OMNI_FLASH,
26
31
  aiModels_1.EVideoGenModels.KLING_V2_6,
27
32
  aiModels_1.EVideoGenModels.RUNWAY_GEN4_5,
28
33
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_5,
29
34
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0,
35
+ aiModels_1.EVideoGenModels.MINIMAX_H3,
30
36
  aiModels_1.EVideoGenModels.MINIMAX_HAILUO_2_3,
37
+ // PixVerse C1: cinema-grade flagship, any 1–15s at up to 1080p + native audio.
38
+ aiModels_1.EVideoGenModels.PIXVERSE_C1,
31
39
  ];
32
40
  // ── Video: text-to-video, T2 (balanced) ───────────────────────────────
33
41
  // AG-16: seedance-1.0-pro-fast added to cover 2-3s clips; pixverse-v6 added
@@ -41,6 +49,7 @@ exports.T2_TEXT_TO_VIDEO_CHAIN = [
41
49
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0_MINI,
42
50
  aiModels_1.EVideoGenModels.PIXVERSE_V6,
43
51
  aiModels_1.EVideoGenModels.PIXVERSE_V5_6,
52
+ aiModels_1.EVideoGenModels.MINIMAX_H3_MAX,
44
53
  aiModels_1.EVideoGenModels.MINIMAX_HAILUO_2_3_FAST,
45
54
  ];
46
55
  // ── Video: image-to-video, T2 (most common path) ──────────────────────
@@ -58,6 +67,7 @@ exports.T2_IMAGE_TO_VIDEO_CHAIN = [
58
67
  // 2.0 Mini: cheapest 2.x I2V (native audio + refs, up to 15s). Budget tier → T2.
59
68
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0_MINI,
60
69
  aiModels_1.EVideoGenModels.PIXVERSE_V6,
70
+ aiModels_1.EVideoGenModels.MINIMAX_H3_MAX,
61
71
  aiModels_1.EVideoGenModels.MINIMAX_HAILUO_02,
62
72
  ];
63
73
  // ── Video: image-to-video, T3 (premium) ───────────────────────────────
@@ -67,9 +77,12 @@ exports.T3_IMAGE_TO_VIDEO_CHAIN = [
67
77
  aiModels_1.EVideoGenModels.KLING_V2_6,
68
78
  aiModels_1.EVideoGenModels.KLING_V3_0,
69
79
  aiModels_1.EVideoGenModels.GOOGLE_VEO_3_1,
80
+ aiModels_1.EVideoGenModels.GOOGLE_GEMINI_OMNI_FLASH,
70
81
  aiModels_1.EVideoGenModels.RUNWAY_GEN4_5,
71
82
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_5,
72
83
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0,
84
+ // PixVerse C1: cinema-grade flagship, any 1–15s at up to 1080p + native audio.
85
+ aiModels_1.EVideoGenModels.PIXVERSE_C1,
73
86
  ];
74
87
  // ── Video: avatar / talking-head ──────────────────────────────────────
75
88
  // Kling (byo-media) is the default; HeyGen/Tavus (hosted) are fallbacks. NOTE:
@@ -170,11 +183,15 @@ function gcd(a, b) {
170
183
  // EVideoGenModels.BYTEDANCE_SEEDANCE_2_0,
171
184
  // EVideoGenModels.PIXVERSE_V5_6,
172
185
  // ]);
173
- // AG-16: small allow-list for native-audio support — not yet on the schema as a
174
- // queryable field, so kept hardcoded (conservative). Extend when audio becomes
175
- // a proper config field like lastFrameImageUrl did.
186
+ // AG-16: native-audio support. A model that declares `audio` in its config
187
+ // fields supports it (Veo 3.x, Seedance 1.5-pro / 2.x, Kling 2.6 / 3.0,
188
+ // Pixverse); this list only covers models whose audio is always on and so
189
+ // declare no toggle (Kling 3.0 Turbo, the avatar model).
176
190
  const AUDIO_MODELS = new Set([
177
- aiModels_1.EVideoGenModels.GOOGLE_VEO_3,
191
+ aiModels_1.EVideoGenModels.KLING_V3_0_TURBO,
192
+ aiModels_1.EVideoGenModels.GOOGLE_GEMINI_OMNI_FLASH,
193
+ // REMOVED FOR v2 — kept for reference: Veo 3.0 shut down 2026-06-30.
194
+ // EVideoGenModels.GOOGLE_VEO_3,
178
195
  aiModels_1.EVideoGenModels.GOOGLE_VEO_3_1,
179
196
  aiModels_1.EVideoGenModels.GOOGLE_VEO_3_1_FAST,
180
197
  aiModels_1.EVideoGenModels.GOOGLE_VEO_3_1_LITE,
@@ -182,13 +199,50 @@ const AUDIO_MODELS = new Set([
182
199
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0,
183
200
  aiModels_1.EVideoGenModels.BYTEDANCE_SEEDANCE_2_0_MINI,
184
201
  aiModels_1.EVideoGenModels.KLING_AVATAR,
202
+ aiModels_1.EVideoGenModels.MINIMAX_H3,
203
+ aiModels_1.EVideoGenModels.MINIMAX_H3_MAX,
204
+ aiModels_1.EVideoGenModels.PIXVERSE_C1,
185
205
  ]);
186
206
  function supportsEndFrame(m) {
187
207
  // Single source of truth: model config declares `lastFrameImageUrl` in fields.
188
208
  return (0, helpers_1.modelSupportsLastFrame)(m);
189
209
  }
190
210
  function supportsAudio(m) {
191
- return AUDIO_MODELS.has(m);
211
+ return AUDIO_MODELS.has(m) || "audio" in (videoFields(m) ?? {});
212
+ }
213
+ function videoFields(m) {
214
+ const cfg = aiModels_1.aiModelConfigs[m];
215
+ return cfg?.fields;
216
+ }
217
+ /**
218
+ * How many reference images (identity / style refs that are NOT the first
219
+ * frame) a video model takes natively: its `referenceImageUrls.max`, Infinity
220
+ * when it declares the field without a cap, 0 when it doesn't take any.
221
+ */
222
+ function modelReferenceImageLimit(m) {
223
+ const field = videoFields(m)?.referenceImageUrls;
224
+ if (!field)
225
+ return 0;
226
+ return typeof field.max === "number" ? field.max : Number.POSITIVE_INFINITY;
227
+ }
228
+ function rankVideoChainByPreference(chain, wants) {
229
+ const satisfies = (m) => !wants.referenceImages || modelReferenceImageLimit(m) > 0;
230
+ return [...chain.filter(satisfies), ...chain.filter((m) => !satisfies(m))];
231
+ }
232
+ /**
233
+ * The closest ratio a video model can render for a plan aspect. Every video
234
+ * model takes 9:16 / 16:9 / 1:1; 4:5 (feed) is image-only, and 1:1 is the
235
+ * closest shape, so the render crops the least from it.
236
+ */
237
+ function videoAspectFor(aspect) {
238
+ if (aspect === "9:16" || aspect === "16:9" || aspect === "1:1")
239
+ return aspect;
240
+ const m = aspect.match(/^(\d+):(\d+)$/);
241
+ if (!m)
242
+ return "9:16";
243
+ const r = Number(m[1]) / Number(m[2]);
244
+ const options = [["9:16", 9 / 16], ["1:1", 1], ["16:9", 16 / 9]];
245
+ return options.reduce((best, o) => (Math.abs(o[1] - r) < Math.abs(best[1] - r) ? o : best))[0];
192
246
  }
193
247
  /**
194
248
  * Build a chain that puts the planner's pick first, then the rest of the
@@ -1 +1 @@
1
- {"version":3,"file":"llmRepair.strategy.d.ts","sourceRoot":"","sources":["../../../../../src/services/agent/repair/strategies/llmRepair.strategy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAiC,cAAc,EAAE,MAAM,UAAU,CAAC;AAwOzE,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,gBAAsC,CAAC;AAC3E,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,gBAAoC,CAAC"}
1
+ {"version":3,"file":"llmRepair.strategy.d.ts","sourceRoot":"","sources":["../../../../../src/services/agent/repair/strategies/llmRepair.strategy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAiC,cAAc,EAAE,MAAM,UAAU,CAAC;AAyOzE,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,gBAAsC,CAAC;AAC3E,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,gBAAoC,CAAC"}
@@ -69,6 +69,8 @@ function alternativeModels(currentModelKey, limit = 14) {
69
69
  for (const key of Object.keys(aiModels_1.aiModelConfigs)) {
70
70
  if (key === currentModelKey)
71
71
  continue;
72
+ if (!(0, aiModels_1.isModelOffered)(aiModels_1.aiModelConfigs[key]))
73
+ continue;
72
74
  const summary = summarizeModel(key);
73
75
  if (!summary?.type)
74
76
  continue;
@@ -12,6 +12,37 @@ declare const InputSchema: z.ZodObject<{
12
12
  "16:9": "16:9";
13
13
  }>>;
14
14
  lastFrameImageUrl: z.ZodOptional<z.ZodString>;
15
+ cameraControl: z.ZodOptional<z.ZodObject<{
16
+ preset: z.ZodOptional<z.ZodEnum<{
17
+ static: "static";
18
+ pan_left: "pan_left";
19
+ pan_right: "pan_right";
20
+ tilt_up: "tilt_up";
21
+ tilt_down: "tilt_down";
22
+ zoom_in: "zoom_in";
23
+ zoom_out: "zoom_out";
24
+ dolly_in: "dolly_in";
25
+ dolly_out: "dolly_out";
26
+ orbit_left: "orbit_left";
27
+ orbit_right: "orbit_right";
28
+ roll_left: "roll_left";
29
+ roll_right: "roll_right";
30
+ tracking: "tracking";
31
+ handheld: "handheld";
32
+ push_in: "push_in";
33
+ pull_out: "pull_out";
34
+ }>>;
35
+ vector: z.ZodOptional<z.ZodObject<{
36
+ horizontal: z.ZodOptional<z.ZodNumber>;
37
+ vertical: z.ZodOptional<z.ZodNumber>;
38
+ pan: z.ZodOptional<z.ZodNumber>;
39
+ tilt: z.ZodOptional<z.ZodNumber>;
40
+ roll: z.ZodOptional<z.ZodNumber>;
41
+ zoom: z.ZodOptional<z.ZodNumber>;
42
+ }, z.core.$strip>>;
43
+ intensity: z.ZodOptional<z.ZodNumber>;
44
+ }, z.core.$strip>>;
45
+ negativePrompt: z.ZodOptional<z.ZodString>;
15
46
  }, z.core.$strip>;
16
47
  declare const OutputSchema: z.ZodObject<{
17
48
  status: z.ZodLiteral<"triggered">;
@@ -1 +1 @@
1
- {"version":3,"file":"animateImage.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/animateImage.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI5D,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAW/D,QAAA,MAAM,WAAW;;;;;;;;;;;iBA6Bf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;iBAMhB,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAC3C,OAAO,WAAW,EAClB,OAAO,YAAY,CA2FpB,CAAC"}
1
+ {"version":3,"file":"animateImage.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/animateImage.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAM5D,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAW/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;iBAMhB,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAC3C,OAAO,WAAW,EAClB,OAAO,YAAY,CA+FpB,CAAC"}
@@ -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");
@@ -30,8 +32,11 @@ const InputSchema = zod_1.z.object({
30
32
  .describe("AG-1: end frame for first-last-frame (FLF) interpolation — animate FROM " +
31
33
  "imageUrl (first frame) TO this image (last frame) for directed motion " +
32
34
  "between two specific compositions. Only FLF-capable models accept it " +
33
- "(kling, runway-gen4-turbo, google-veo-3.1, alibaba-wan); the chain skips " +
35
+ "(kling, google-veo-3.1, alibaba-wan); the chain skips " +
34
36
  "and falls back on models that don't. Omit for plain single-image motion."),
37
+ cameraControl: videoPlan_schema_1.CameraControlSchema.optional().describe("Camera move (preset like dolly_in / pan_left / orbit_right / static, optional 0..1 intensity). " +
38
+ "Translated per model: MiniMax [Pan left] commands, a camera sentence in the prompt elsewhere."),
39
+ negativePrompt: zod_1.z.string().optional(),
35
40
  });
36
41
  const OutputSchema = zod_1.z.object({
37
42
  status: zod_1.z.literal("triggered"),
@@ -87,15 +92,17 @@ exports.animateImageTool = {
87
92
  let heldSlot = true;
88
93
  try {
89
94
  const provider = (0, aiGenFactory_service_1.getAiGenProviderService)(modelKey);
90
- const result = await provider.generateVideo({
95
+ const result = await provider.generateVideo((0, cameraDirection_1.applyCameraDirection)({
91
96
  prompt: input.motionHint,
92
97
  modelKey,
93
98
  duration: input.durationSec,
94
99
  aspectRatio: input.aspectRatio,
95
100
  inputImageUrl: input.imageUrl,
96
101
  lastFrameImageUrl: input.lastFrameImageUrl,
102
+ negativePrompt: input.negativePrompt,
103
+ cameraControl: input.cameraControl,
97
104
  type: "image-to-video",
98
- });
105
+ }));
99
106
  const taskId = result.task?.taskId ??
100
107
  result.task?.id ??
101
108
  (typeof result.task === "string" ? result.task : "unknown");
@@ -21,16 +21,18 @@ import { ToolDefinition } from "../toolRegistry";
21
21
  declare const InputSchema: z.ZodObject<{
22
22
  prompt: z.ZodString;
23
23
  modelKey: z.ZodDefault<z.ZodEnum<{
24
- "google-imagen-4-ultra": "google-imagen-4-ultra";
25
- "google-imagen-4": "google-imagen-4";
26
- "google-imagen-4-fast": "google-imagen-4-fast";
27
24
  "google-nano-banana-pro": "google-nano-banana-pro";
28
25
  "google-nano-banana": "google-nano-banana";
26
+ "google-nano-banana-2": "google-nano-banana-2";
29
27
  "openai-gpt-image-2": "openai-gpt-image-2";
30
28
  "openai-gpt-image-1.5": "openai-gpt-image-1.5";
31
29
  "openai-gpt-image-1": "openai-gpt-image-1";
32
30
  "openai-gpt-image-1-mini": "openai-gpt-image-1-mini";
31
+ "bytedance-seedream-5-pro": "bytedance-seedream-5-pro";
32
+ "bytedance-seedream-5-flash": "bytedance-seedream-5-flash";
33
33
  "bytedance-seedream-5-lite": "bytedance-seedream-5-lite";
34
+ "bytedance-seedream-4.5": "bytedance-seedream-4.5";
35
+ "bytedance-seedream-4.0": "bytedance-seedream-4.0";
34
36
  "kling-kolors": "kling-kolors";
35
37
  "alibaba-qwen-image-2.0-pro": "alibaba-qwen-image-2.0-pro";
36
38
  "alibaba-qwen-image-2.0": "alibaba-qwen-image-2.0";
@@ -40,6 +42,8 @@ declare const InputSchema: z.ZodObject<{
40
42
  "minimax-image-01": "minimax-image-01";
41
43
  "runwayml-gen4-image": "runwayml-gen4-image";
42
44
  "runwayml-gen4-image-turbo": "runwayml-gen4-image-turbo";
45
+ "xai-grok-imagine-image-2.0": "xai-grok-imagine-image-2.0";
46
+ "xai-grok-imagine-image": "xai-grok-imagine-image";
43
47
  }>>;
44
48
  aspectRatio: z.ZodDefault<z.ZodEnum<{
45
49
  "9:16": "9:16";
@@ -56,8 +60,8 @@ declare const InputSchema: z.ZodObject<{
56
60
  seed: z.ZodOptional<z.ZodNumber>;
57
61
  numImages: z.ZodDefault<z.ZodNumber>;
58
62
  outputFormat: z.ZodOptional<z.ZodEnum<{
59
- png: "png";
60
63
  jpeg: "jpeg";
64
+ png: "png";
61
65
  webp: "webp";
62
66
  }>>;
63
67
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"generateImage.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/generateImage.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAwB/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;iBAOhB,CAAC;AA2BH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C,OAAO,WAAW,EAClB,OAAO,YAAY,CAuGpB,CAAC"}
1
+ {"version":3,"file":"generateImage.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/generateImage.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAkC/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;iBAOhB,CAAC;AAkCH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C,OAAO,WAAW,EAClB,OAAO,YAAY,CAuGpB,CAAC"}
@@ -27,15 +27,23 @@ const rateLimiter_1 = require("../../rateLimiter");
27
27
  const toolRegistry_1 = require("../toolRegistry");
28
28
  const ModelKeyEnum = zod_1.z.enum([
29
29
  enums_1.EImageGenModels.GOOGLE_NANO_BANANA,
30
+ enums_1.EImageGenModels.GOOGLE_NANO_BANANA_2,
30
31
  enums_1.EImageGenModels.GOOGLE_NANO_BANANA_PRO,
31
- enums_1.EImageGenModels.GOOGLE_IMAGEN_4_FAST,
32
- enums_1.EImageGenModels.GOOGLE_IMAGEN_4,
33
- enums_1.EImageGenModels.GOOGLE_IMAGEN_4_ULTRA,
32
+ // REMOVED FOR v2 — kept for reference: Imagen 4 keys are deprecated (Google
33
+ // shut the family down 2026-08-17; keys are repointed to Gemini 3.1 image
34
+ // models). Pick google-nano-banana / google-nano-banana-2 instead.
35
+ // EImageGenModels.GOOGLE_IMAGEN_4_FAST,
36
+ // EImageGenModels.GOOGLE_IMAGEN_4,
37
+ // EImageGenModels.GOOGLE_IMAGEN_4_ULTRA,
34
38
  enums_1.EImageGenModels.OPENAI_GPT_IMAGE_1_MINI,
35
39
  enums_1.EImageGenModels.OPENAI_GPT_IMAGE_1,
36
40
  enums_1.EImageGenModels.OPENAI_GPT_IMAGE_1_5,
37
41
  enums_1.EImageGenModels.OPENAI_GPT_IMAGE_2,
42
+ enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_PRO,
43
+ enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_FLASH,
38
44
  enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_LITE,
45
+ enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_4_5,
46
+ enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_4_0,
39
47
  enums_1.EImageGenModels.KLING_KOLORS,
40
48
  enums_1.EImageGenModels.ALIBABA_QWEN_IMAGE_2,
41
49
  enums_1.EImageGenModels.ALIBABA_QWEN_IMAGE_2_PRO,
@@ -45,6 +53,8 @@ const ModelKeyEnum = zod_1.z.enum([
45
53
  enums_1.EImageGenModels.MINIMAX_IMAGE_01,
46
54
  enums_1.EImageGenModels.RUNWAYML_GEN4_IMAGE_TURBO,
47
55
  enums_1.EImageGenModels.RUNWAYML_GEN4_IMAGE,
56
+ enums_1.EImageGenModels.XAI_GROK_IMAGINE_IMAGE_2,
57
+ enums_1.EImageGenModels.XAI_GROK_IMAGINE_IMAGE,
48
58
  ]);
49
59
  const InputSchema = zod_1.z.object({
50
60
  prompt: zod_1.z
@@ -67,7 +77,7 @@ const InputSchema = zod_1.z.object({
67
77
  .array(zod_1.z.string().url())
68
78
  .max(16)
69
79
  .optional()
70
- .describe("Multi-image references for identity transfer / composition. Used by AG-13 to thread character + product reference images into scene-level image gens. Per-provider caps: OpenAI ≤16, Nano Banana ≤14, Seedream ≤10, Qwen 1–3, MiniMax 1."),
80
+ .describe("Multi-image references for identity transfer / composition. Used by AG-13 to thread character + product reference images into scene-level image gens. Per-provider caps: OpenAI ≤16, Nano Banana ≤14, Seedream 5 pro/flash ≤10, other Seedream ≤14, Grok Imagine ≤5, Qwen 1–3, MiniMax 1."),
71
81
  negativePrompt: zod_1.z.string().optional(),
72
82
  seed: zod_1.z.number().int().optional(),
73
83
  numImages: zod_1.z.number().int().min(1).max(4).default(1),
@@ -86,15 +96,22 @@ const OutputSchema = zod_1.z.object({
86
96
  // budgeting in estimate_cost. Order roughly cheapest → most expensive.
87
97
  const COST_BY_MODEL = {
88
98
  [enums_1.EImageGenModels.GOOGLE_NANO_BANANA]: 1,
89
- [enums_1.EImageGenModels.GOOGLE_IMAGEN_4_FAST]: 1,
99
+ [enums_1.EImageGenModels.GOOGLE_NANO_BANANA_2]: 1,
100
+ // [EImageGenModels.GOOGLE_IMAGEN_4_FAST]: 1, // REMOVED FOR v2 — deprecated
90
101
  [enums_1.EImageGenModels.OPENAI_GPT_IMAGE_1_MINI]: 1,
91
102
  [enums_1.EImageGenModels.GOOGLE_NANO_BANANA_PRO]: 2,
92
- [enums_1.EImageGenModels.GOOGLE_IMAGEN_4]: 2,
103
+ // [EImageGenModels.GOOGLE_IMAGEN_4]: 2, // REMOVED FOR v2 — deprecated
104
+ [enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_FLASH]: 1,
105
+ [enums_1.EImageGenModels.XAI_GROK_IMAGINE_IMAGE]: 1,
93
106
  [enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_LITE]: 2,
107
+ [enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_4_0]: 2,
108
+ [enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_4_5]: 2,
109
+ [enums_1.EImageGenModels.XAI_GROK_IMAGINE_IMAGE_2]: 2,
94
110
  [enums_1.EImageGenModels.KLING_KOLORS]: 2,
95
111
  [enums_1.EImageGenModels.ALIBABA_QWEN_IMAGE_2]: 2,
96
112
  [enums_1.EImageGenModels.MINIMAX_IMAGE_01]: 2,
97
- [enums_1.EImageGenModels.GOOGLE_IMAGEN_4_ULTRA]: 4,
113
+ // [EImageGenModels.GOOGLE_IMAGEN_4_ULTRA]: 4, // REMOVED FOR v2 — deprecated
114
+ [enums_1.EImageGenModels.BYTEDANCE_SEEDREAM_5_PRO]: 4,
98
115
  [enums_1.EImageGenModels.ALIBABA_QWEN_IMAGE_2_PRO]: 4,
99
116
  [enums_1.EImageGenModels.ALIBABA_QWEN_IMAGE_EDIT]: 4,
100
117
  [enums_1.EImageGenModels.ALIBABA_QWEN_IMAGE_EDIT_PLUS]: 4,
@@ -19,6 +19,38 @@ declare const InputSchema: z.ZodObject<{
19
19
  lastFrameImageUrl: z.ZodOptional<z.ZodString>;
20
20
  audio: z.ZodOptional<z.ZodBoolean>;
21
21
  negativePrompt: z.ZodOptional<z.ZodString>;
22
+ cameraControl: z.ZodOptional<z.ZodObject<{
23
+ preset: z.ZodOptional<z.ZodEnum<{
24
+ static: "static";
25
+ pan_left: "pan_left";
26
+ pan_right: "pan_right";
27
+ tilt_up: "tilt_up";
28
+ tilt_down: "tilt_down";
29
+ zoom_in: "zoom_in";
30
+ zoom_out: "zoom_out";
31
+ dolly_in: "dolly_in";
32
+ dolly_out: "dolly_out";
33
+ orbit_left: "orbit_left";
34
+ orbit_right: "orbit_right";
35
+ roll_left: "roll_left";
36
+ roll_right: "roll_right";
37
+ tracking: "tracking";
38
+ handheld: "handheld";
39
+ push_in: "push_in";
40
+ pull_out: "pull_out";
41
+ }>>;
42
+ vector: z.ZodOptional<z.ZodObject<{
43
+ horizontal: z.ZodOptional<z.ZodNumber>;
44
+ vertical: z.ZodOptional<z.ZodNumber>;
45
+ pan: z.ZodOptional<z.ZodNumber>;
46
+ tilt: z.ZodOptional<z.ZodNumber>;
47
+ roll: z.ZodOptional<z.ZodNumber>;
48
+ zoom: z.ZodOptional<z.ZodNumber>;
49
+ }, z.core.$strip>>;
50
+ intensity: z.ZodOptional<z.ZodNumber>;
51
+ }, z.core.$strip>>;
52
+ referenceImageUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
+ seed: z.ZodOptional<z.ZodNumber>;
22
54
  }, z.core.$strip>;
23
55
  declare const OutputSchema: z.ZodObject<{
24
56
  status: z.ZodLiteral<"triggered">;
@@ -1 +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;AAI5D,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA6B/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBA4Cf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;iBAOhB,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C,OAAO,WAAW,EAClB,OAAO,YAAY,CAqHpB,CAAC"}
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;AAM5D,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAgC/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyDf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;iBAOhB,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C,OAAO,WAAW,EAClB,OAAO,YAAY,CA0IpB,CAAC"}