vidspotai-shared 1.0.80 → 1.0.81

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 (29) hide show
  1. package/lib/globals/aiModels/enums.d.ts +5 -0
  2. package/lib/globals/aiModels/enums.d.ts.map +1 -1
  3. package/lib/globals/aiModels/enums.js +12 -1
  4. package/lib/globals/aiModels/providers/alibaba.d.ts.map +1 -1
  5. package/lib/globals/aiModels/providers/alibaba.js +159 -39
  6. package/lib/services/aiGen/aiGenFactory.service.d.ts +4 -1
  7. package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
  8. package/lib/services/aiGen/aiGenFactory.service.js +13 -1
  9. package/lib/services/aiGen/index.d.ts +1 -0
  10. package/lib/services/aiGen/index.d.ts.map +1 -1
  11. package/lib/services/aiGen/index.js +1 -0
  12. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts +34 -7
  13. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts.map +1 -1
  14. package/lib/services/aiGen/providers/alibaba/alibaba.js +193 -75
  15. package/lib/services/aiGen/providers/google/google.service.d.ts +1 -0
  16. package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
  17. package/lib/services/aiGen/providers/google/google.service.js +28 -0
  18. package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts.map +1 -1
  19. package/lib/services/aiGen/providers/pixverse/pixverse.service.js +71 -40
  20. package/lib/services/aiGen/transientRetry.d.ts +35 -0
  21. package/lib/services/aiGen/transientRetry.d.ts.map +1 -0
  22. package/lib/services/aiGen/transientRetry.js +106 -0
  23. package/package.json +6 -6
  24. package/lib/services/aiGen/providers/azure/azure.service.d.ts +0 -14
  25. package/lib/services/aiGen/providers/azure/azure.service.d.ts.map +0 -1
  26. package/lib/services/aiGen/providers/azure/azure.service.js +0 -108
  27. package/lib/services/aiGen/providers/azure/index.d.ts +0 -2
  28. package/lib/services/aiGen/providers/azure/index.d.ts.map +0 -1
  29. package/lib/services/aiGen/providers/azure/index.js +0 -17
@@ -32,8 +32,11 @@ export declare enum EVideoGenModels {
32
32
  MINIMAX_HAILUO_2_3 = "minimax-hailuo-2.3",
33
33
  MINIMAX_HAILUO_02 = "minimax-hailuo-02",
34
34
  MINIMAX_S2V_01 = "minimax-s2v-01",
35
+ ALIBABA_WAN_2_7_T2V = "alibaba-wan-2.7-t2v",
35
36
  ALIBABA_WAN_2_7_I2V = "alibaba-wan-2.7-i2v",
36
37
  ALIBABA_WAN_2_6_T2V = "alibaba-wan-2.6-t2v",
38
+ ALIBABA_WAN_2_6_I2V = "alibaba-wan-2.6-i2v",
39
+ ALIBABA_WAN_2_6_I2V_FLASH = "alibaba-wan-2.6-i2v-flash",
37
40
  ALIBABA_WAN_2_5_T2V = "alibaba-wan-2.5-t2v",
38
41
  ALIBABA_WAN_2_2_T2V = "alibaba-wan-2.2-t2v",
39
42
  ALIBABA_WAN_2_2_S2V = "alibaba-wan-2.2-s2v",
@@ -68,6 +71,8 @@ export declare const EImageGenModels: {
68
71
  readonly ALIBABA_QWEN_IMAGE_EDIT_MAX: "alibaba-qwen-image-edit-max";
69
72
  readonly ALIBABA_QWEN_IMAGE_EDIT_PLUS: "alibaba-qwen-image-edit-plus";
70
73
  readonly ALIBABA_QWEN_IMAGE_EDIT: "alibaba-qwen-image-edit";
74
+ readonly ALIBABA_WAN_2_7_IMAGE_PRO: "alibaba-wan-2.7-image-pro";
75
+ readonly ALIBABA_WAN_2_7_IMAGE: "alibaba-wan-2.7-image";
71
76
  readonly MINIMAX_IMAGE_01: "minimax-image-01";
72
77
  readonly RUNWAYML_GEN4_IMAGE: "runwayml-gen4-image";
73
78
  readonly RUNWAYML_GEN4_IMAGE_TURBO: "runwayml-gen4-image-turbo";
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/globals/aiModels/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB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,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAgDlB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEvF;;;;GAIG;AACH,oBAAY,eAAe;IACzB,iBAAiB,sBAAsB;IACvC,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,kBAAkB,uBAAuB;CAC1C;AAED,oBAAY,cAAc;IACxB,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;CACxC;AAED;;;;GAIG;AACH,oBAAY,aAAa;IACvB,wBAAwB,6BAA6B;CACtD;AAED,MAAM,MAAM,WAAW,GACnB,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,eAAe,GACf,aAAa,CAAC"}
@@ -39,10 +39,15 @@ var EVideoGenModels;
39
39
  EVideoGenModels["MINIMAX_HAILUO_2_3"] = "minimax-hailuo-2.3";
40
40
  EVideoGenModels["MINIMAX_HAILUO_02"] = "minimax-hailuo-02";
41
41
  EVideoGenModels["MINIMAX_S2V_01"] = "minimax-s2v-01";
42
+ EVideoGenModels["ALIBABA_WAN_2_7_T2V"] = "alibaba-wan-2.7-t2v";
42
43
  EVideoGenModels["ALIBABA_WAN_2_7_I2V"] = "alibaba-wan-2.7-i2v";
43
44
  EVideoGenModels["ALIBABA_WAN_2_6_T2V"] = "alibaba-wan-2.6-t2v";
45
+ EVideoGenModels["ALIBABA_WAN_2_6_I2V"] = "alibaba-wan-2.6-i2v";
46
+ EVideoGenModels["ALIBABA_WAN_2_6_I2V_FLASH"] = "alibaba-wan-2.6-i2v-flash";
44
47
  EVideoGenModels["ALIBABA_WAN_2_5_T2V"] = "alibaba-wan-2.5-t2v";
45
48
  EVideoGenModels["ALIBABA_WAN_2_2_T2V"] = "alibaba-wan-2.2-t2v";
49
+ // Kept for enum backward-compat — rejected with UserFacingError at submit
50
+ // (intl DashScope key cannot reach China-region wan2.2-s2v endpoint).
46
51
  EVideoGenModels["ALIBABA_WAN_2_2_S2V"] = "alibaba-wan-2.2-s2v";
47
52
  EVideoGenModels["OPENAI_SORA_2"] = "openai-sora-2";
48
53
  EVideoGenModels["OPENAI_SORA_2_PRO"] = "openai-sora-2-pro";
@@ -76,7 +81,10 @@ exports.EImageGenModels = {
76
81
  KLING_IMAGE_O1: "kling-image-o1", // IMAGE 3.0 — omni-image API, 1K/2K, element control
77
82
  KLING_V3_OMNI_IMAGE: "kling-v3-omni", // IMAGE 3.0 variant — omni-image API, 1K/2K/4K, series gen
78
83
  KLING_V2_1_IMAGE: "kling-v2-1-image", // IMAGE 2.1 — standard gen API, 1K/2K, subject/face/multi ref
79
- // Kling (Kolors) — routed through Alibaba DashScope (legacy; prefer first-party above for new work)
84
+ // Kling (Kolors) — REMOVED FOR v1, Kuaishou hosts this, not Alibaba DashScope.
85
+ // Kept for enum backward-compat; routed to AlibabaService which throws
86
+ // UserFacingError. Restore by wiring KlingImageService for the Kuaishou
87
+ // Kolors endpoint (api-singapore.klingai.com).
80
88
  KLING_KOLORS: "kling-kolors",
81
89
  // Alibaba — Qwen-Image (T2I + instruction edit)
82
90
  ALIBABA_QWEN_IMAGE_2_PRO: "alibaba-qwen-image-2.0-pro",
@@ -84,6 +92,9 @@ exports.EImageGenModels = {
84
92
  ALIBABA_QWEN_IMAGE_EDIT_MAX: "alibaba-qwen-image-edit-max",
85
93
  ALIBABA_QWEN_IMAGE_EDIT_PLUS: "alibaba-qwen-image-edit-plus",
86
94
  ALIBABA_QWEN_IMAGE_EDIT: "alibaba-qwen-image-edit",
95
+ // Alibaba — Wan-Image (T2I + instruction edit via single sync multimodal endpoint)
96
+ ALIBABA_WAN_2_7_IMAGE_PRO: "alibaba-wan-2.7-image-pro",
97
+ ALIBABA_WAN_2_7_IMAGE: "alibaba-wan-2.7-image",
87
98
  // MiniMax — image-01 (T2I with character reference)
88
99
  MINIMAX_IMAGE_01: "minimax-image-01",
89
100
  // RunwayML — Gen-4 Image (T2I, with reference images)
@@ -1 +1 @@
1
- {"version":3,"file":"alibaba.d.ts","sourceRoot":"","sources":["../../../../src/globals/aiModels/providers/alibaba.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAaxC,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CA4LrE,CAAC"}
1
+ {"version":3,"file":"alibaba.d.ts","sourceRoot":"","sources":["../../../../src/globals/aiModels/providers/alibaba.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAaxC,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAyTrE,CAAC"}
@@ -12,43 +12,101 @@ const wanCommonFields = {
12
12
  promptOptimizer: {},
13
13
  };
14
14
  exports.alibabaConfigs = {
15
- // --- Wan 2.7 i2v --- (image2video; supports first-last-frame interpolation)
15
+ // --- Wan 2.7 t2v --- newest text-to-video (Singapore region)
16
+ "alibaba-wan-2.7-t2v": {
17
+ modelId: "wan2.7-t2v",
18
+ type: ["text-to-video"],
19
+ tier: "T3",
20
+ fields: {
21
+ ...wanCommonFields,
22
+ resolution: { allowedValues: ["720p", "1080p"] },
23
+ duration: { allowedValues: [5, 10] },
24
+ },
25
+ cost: {
26
+ // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
27
+ table: {
28
+ "1280x720": { 5: 0.50, 10: 1.00 },
29
+ "1920x1080": { 5: 0.75, 10: 1.50 },
30
+ },
31
+ },
32
+ },
33
+ // --- Wan 2.7 i2v --- newest image-to-video; supports first-last-frame interpolation
16
34
  "alibaba-wan-2.7-i2v": {
17
- modelId: "wan2.7-i2v-plus",
35
+ modelId: "wan2.7-i2v",
18
36
  type: ["image-to-video"],
19
37
  tier: "T3",
20
38
  fields: {
21
39
  ...wanCommonFields,
40
+ resolution: { allowedValues: ["720p", "1080p"] },
41
+ duration: { allowedValues: [5, 10] },
22
42
  inputImageUrl: { required: true },
23
43
  lastFrameImageUrl: {}, // FLF interpolation
24
44
  },
25
45
  cost: {
46
+ // Alibaba intl (with audio): 720p $0.10/s, 1080p $0.15/s.
26
47
  table: {
27
- "832x480": { 5: 0.10, 10: 0.20 },
28
- "1280x720": { 5: 0.20, 10: 0.40 },
29
- "1920x1080": { 5: 0.40, 10: 0.80 },
48
+ "1280x720": { 5: 0.50, 10: 1.00 },
49
+ "1920x1080": { 5: 0.75, 10: 1.50 },
30
50
  },
31
51
  },
32
52
  },
33
- // --- Wan 2.6 t2v --- 720p/1080p only (no 480p); 5/10/15s
53
+ // --- Wan 2.6 t2v --- 720p/1080p only (no 480p); 5/10s
34
54
  "alibaba-wan-2.6-t2v": {
35
- modelId: "wan2.6-t2v-plus",
55
+ modelId: "wan2.6-t2v",
36
56
  type: ["text-to-video"],
37
57
  tier: "T3",
38
58
  fields: {
39
59
  ...wanCommonFields,
40
60
  resolution: { allowedValues: ["720p", "1080p"] },
41
- duration: { allowedValues: [5, 10, 15] },
61
+ duration: { allowedValues: [5, 10] },
42
62
  },
43
63
  cost: {
44
64
  // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
45
65
  table: {
46
- "1280x720": { 5: 0.50, 10: 1.00, 15: 1.50 },
47
- "1920x1080": { 5: 0.75, 10: 1.50, 15: 2.25 },
66
+ "1280x720": { 5: 0.50, 10: 1.00 },
67
+ "1920x1080": { 5: 0.75, 10: 1.50 },
68
+ },
69
+ },
70
+ },
71
+ // --- Wan 2.6 i2v --- image-to-video with audio
72
+ "alibaba-wan-2.6-i2v": {
73
+ modelId: "wan2.6-i2v",
74
+ type: ["image-to-video"],
75
+ tier: "T3",
76
+ fields: {
77
+ ...wanCommonFields,
78
+ resolution: { allowedValues: ["720p", "1080p"] },
79
+ duration: { allowedValues: [5, 10] },
80
+ inputImageUrl: { required: true },
81
+ },
82
+ cost: {
83
+ // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
84
+ table: {
85
+ "1280x720": { 5: 0.50, 10: 1.00 },
86
+ "1920x1080": { 5: 0.75, 10: 1.50 },
87
+ },
88
+ },
89
+ },
90
+ // --- Wan 2.6 i2v flash --- ~50% cheaper i2v variant (audio optional)
91
+ "alibaba-wan-2.6-i2v-flash": {
92
+ modelId: "wan2.6-i2v-flash",
93
+ type: ["image-to-video"],
94
+ tier: "T2",
95
+ fields: {
96
+ ...wanCommonFields,
97
+ resolution: { allowedValues: ["720p", "1080p"] },
98
+ duration: { allowedValues: [5, 10] },
99
+ inputImageUrl: { required: true },
100
+ },
101
+ cost: {
102
+ // Alibaba intl (with audio): 720p $0.05/s, 1080p $0.075/s.
103
+ table: {
104
+ "1280x720": { 5: 0.25, 10: 0.50 },
105
+ "1920x1080": { 5: 0.38, 10: 0.75 },
48
106
  },
49
107
  },
50
108
  },
51
- // --- Wan 2.5 t2v --- (preview tier per Alibaba docs)
109
+ // --- Wan 2.5 t2v --- preview tier
52
110
  "alibaba-wan-2.5-t2v": {
53
111
  modelId: "wan2.5-t2v-preview",
54
112
  type: ["text-to-video"],
@@ -80,28 +138,42 @@ exports.alibabaConfigs = {
80
138
  },
81
139
  },
82
140
  },
83
- // --- Wan 2.2 s2v --- (sound2video; audio drives motion, optional image for visual reference)
84
- "alibaba-wan-2.2-s2v": {
85
- modelId: "wan2.2-s2v",
86
- type: ["audio-to-video"],
87
- tier: "T2",
88
- fields: {
89
- prompt: {},
90
- inputAudioUrl: { required: true },
91
- inputImageUrl: {}, // optional visual reference
92
- resolution: { allowedValues: ["480p", "720p"] }, // 1080p not supported
93
- duration: { allowedValues: [5, 10, 15, 20] },
94
- seed: {},
95
- watermark: {},
96
- },
97
- cost: {
98
- // Alibaba intl: 480p $0.071677/s, 720p $0.129018/s.
99
- table: {
100
- "832x480": { 5: 0.36, 10: 0.72, 15: 1.08, 20: 1.44 },
101
- "1280x720": { 5: 0.65, 10: 1.29, 15: 1.94, 20: 2.58 },
102
- },
103
- },
104
- },
141
+ // --- Wan 2.2 s2v --- REMOVED FOR v1 — China-region only, intl key cannot reach
142
+ //
143
+ // Sound-to-video (wan2.2-s2v) is hosted exclusively on the China region
144
+ // (dashscope.aliyuncs.com) and requires a Beijing-region API key separate
145
+ // from the Singapore intl key. AlibabaService throws PROVIDER_AUTH_ERROR
146
+ // at submit time if this modelKey is selected so users get a clean
147
+ // "not available on intl" message instead of a generic 404.
148
+ //
149
+ // To restore: provision ALIBABA_CN_API_KEY (China Beijing region), add it
150
+ // to the service constructor's env-detection, and route s2v calls to the
151
+ // China endpoint (https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesis).
152
+ //
153
+ // Kept commented per repo convention (feedback_comment_dont_delete) so
154
+ // future work can recover the schema. The enum + factory entry remain
155
+ // wired but currently throw UserFacingError at submit.
156
+ // "alibaba-wan-2.2-s2v": {
157
+ // modelId: "wan2.2-s2v",
158
+ // type: ["audio-to-video"],
159
+ // tier: "T2",
160
+ // fields: {
161
+ // prompt: {},
162
+ // inputAudioUrl: { required: true },
163
+ // inputImageUrl: {}, // optional visual reference
164
+ // resolution: { allowedValues: ["480p", "720p"] },
165
+ // duration: { allowedValues: [5, 10, 15, 20] },
166
+ // seed: {},
167
+ // watermark: {},
168
+ // },
169
+ // cost: {
170
+ // // China region: 480p $0.071677/s, 720p $0.129018/s.
171
+ // table: {
172
+ // "832x480": { 5: 0.36, 10: 0.72, 15: 1.08, 20: 1.44 },
173
+ // "1280x720": { 5: 0.65, 10: 1.29, 15: 1.94, 20: 2.58 },
174
+ // },
175
+ // },
176
+ // },
105
177
  // ───────────────────────────────────────────────────────────────────────
106
178
  // Image-gen — Qwen-Image + Kolors (both via DashScope text2image / image2image)
107
179
  // ───────────────────────────────────────────────────────────────────────
@@ -175,18 +247,66 @@ exports.alibabaConfigs = {
175
247
  },
176
248
  cost: { fixed: 0.045 },
177
249
  },
178
- // Kolors (Kling) hosted on DashScope; routed to AlibabaService in factory.
179
- // TODO(verify): $0.03 unverified — Kolors not on Alibaba pricing page; needs Kuaishou source.
180
- "kling-kolors": {
181
- modelId: "kolors-v2",
182
- type: ["text-to-image"],
250
+ // --- Kolors (Kling) --- REMOVED FOR v1 not on Alibaba DashScope
251
+ //
252
+ // Kolors is Kuaishou's image model, hosted on klingai.kuaishou.com — NOT
253
+ // on Alibaba DashScope. The previous `modelId: "kolors-v2"` routing here
254
+ // returned "Model not exist" 100% of calls. AlibabaService now throws
255
+ // PROVIDER_AUTH_ERROR at submit time if this modelKey is selected.
256
+ //
257
+ // To restore: wire the Kuaishou Kling Kolors API (api-singapore.klingai.com
258
+ // image endpoints) through a dedicated KlingImageService entry — the
259
+ // first-party Kling image models already use that service (see
260
+ // EImageGenModels.KLING_V2_1_IMAGE etc).
261
+ //
262
+ // Kept commented per repo convention (feedback_comment_dont_delete).
263
+ // "kling-kolors": {
264
+ // modelId: "kolors-v2",
265
+ // type: ["text-to-image"],
266
+ // tier: "T1",
267
+ // fields: {
268
+ // prompt: { required: true },
269
+ // aspectRatio: { allowedValues: ["1:1", "9:16", "16:9", "3:4", "4:3"] },
270
+ // numImages: { default: 1 },
271
+ // seed: {},
272
+ // watermark: {},
273
+ // negativePrompt: {},
274
+ // },
275
+ // cost: { fixed: 0.03 },
276
+ // },
277
+ // --- Wan 2.7 image (pro) --- premium tier; supports both text-to-image
278
+ // and instruction edit (when input image provided). Sync multimodal endpoint.
279
+ "alibaba-wan-2.7-image-pro": {
280
+ modelId: "wan2.7-image-pro",
281
+ type: ["text-to-image", "image-to-image"],
282
+ tier: "T2",
283
+ fields: {
284
+ prompt: { required: true },
285
+ aspectRatio: { allowedValues: ["1:1", "9:16", "16:9", "3:4", "4:3", "2:3", "3:2"] },
286
+ numImages: { default: 1 },
287
+ inputImageUrl: {}, // optional — triggers edit mode
288
+ inputImageUrls: { max: 3 },
289
+ seed: {},
290
+ watermark: {},
291
+ promptOptimizer: {},
292
+ negativePrompt: {},
293
+ },
294
+ cost: { fixed: 0.075 },
295
+ },
296
+ // --- Wan 2.7 image --- standard tier
297
+ "alibaba-wan-2.7-image": {
298
+ modelId: "wan2.7-image",
299
+ type: ["text-to-image", "image-to-image"],
183
300
  tier: "T1",
184
301
  fields: {
185
302
  prompt: { required: true },
186
- aspectRatio: { allowedValues: ["1:1", "9:16", "16:9", "3:4", "4:3"] },
303
+ aspectRatio: { allowedValues: ["1:1", "9:16", "16:9", "3:4", "4:3", "2:3", "3:2"] },
187
304
  numImages: { default: 1 },
305
+ inputImageUrl: {},
306
+ inputImageUrls: { max: 3 },
188
307
  seed: {},
189
308
  watermark: {},
309
+ promptOptimizer: {},
190
310
  negativePrompt: {},
191
311
  },
192
312
  cost: { fixed: 0.03 },
@@ -9,7 +9,10 @@ export declare const videoServicesMap: Record<EVideoGenModels, AiGenServiceConst
9
9
  * Kling now has a first-party image API (api-singapore.klingai.com, same JWT auth as video):
10
10
  * /v1/images/omni-image → kling-image-o1, kling-v3-omni → KlingImageService
11
11
  * /v1/images/generations → kling-v2-1-image → KlingImageService
12
- * The legacy kling-kolors key still routes to AlibabaService (DashScope-hosted Kolors v2).
12
+ * The legacy kling-kolors key still routes to AlibabaService, but AlibabaService
13
+ * now rejects it with UserFacingError (Kolors is Kuaishou-hosted, not Alibaba —
14
+ * was returning "Model not exist" 100% of calls). Restore by wiring Kolors
15
+ * through KlingImageService once the Kuaishou Kolors endpoint is mapped.
13
16
  */
14
17
  export declare const imageServicesMap: Record<EImageGenModelKey, AiGenServiceConstructor>;
15
18
  /**
@@ -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,eAAe,EACf,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAahC,KAAK,uBAAuB,GAAG,UAAU,wBAAwB,CAAC;AAElE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,eAAe,EACf,uBAAuB,CAyDxB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,iBAAiB,EACjB,uBAAuB,CAuCxB,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,CAQzE,CAAC;AAEJ,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,WAAW,GACpB,wBAAwB,CAkB1B"}
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,eAAe,EACf,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAahC,KAAK,uBAAuB,GAAG,UAAU,wBAAwB,CAAC;AAElE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,eAAe,EACf,uBAAuB,CA+DxB,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,CAQzE,CAAC;AAEJ,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,WAAW,GACpB,wBAAwB,CAkB1B"}
@@ -57,10 +57,16 @@ exports.videoServicesMap = {
57
57
  "openai-sora-2": openai_service_1.OpenaiService,
58
58
  "openai-sora-2-pro": openai_service_1.OpenaiService,
59
59
  // --- Alibaba ---
60
+ "alibaba-wan-2.7-t2v": alibaba_1.AlibabaService,
60
61
  "alibaba-wan-2.7-i2v": alibaba_1.AlibabaService,
61
62
  "alibaba-wan-2.6-t2v": alibaba_1.AlibabaService,
63
+ "alibaba-wan-2.6-i2v": alibaba_1.AlibabaService,
64
+ "alibaba-wan-2.6-i2v-flash": alibaba_1.AlibabaService,
62
65
  "alibaba-wan-2.5-t2v": alibaba_1.AlibabaService,
63
66
  "alibaba-wan-2.2-t2v": alibaba_1.AlibabaService,
67
+ // wan2.2-s2v: rejected at submit (China-region only). Kept wired so the
68
+ // model key resolves and the user sees a clean UserFacingError instead
69
+ // of "Unknown modelKey" — see alibaba.ts INTL_UNAVAILABLE_MODEL_IDS.
64
70
  "alibaba-wan-2.2-s2v": alibaba_1.AlibabaService,
65
71
  };
66
72
  /**
@@ -70,7 +76,10 @@ exports.videoServicesMap = {
70
76
  * Kling now has a first-party image API (api-singapore.klingai.com, same JWT auth as video):
71
77
  * /v1/images/omni-image → kling-image-o1, kling-v3-omni → KlingImageService
72
78
  * /v1/images/generations → kling-v2-1-image → KlingImageService
73
- * The legacy kling-kolors key still routes to AlibabaService (DashScope-hosted Kolors v2).
79
+ * The legacy kling-kolors key still routes to AlibabaService, but AlibabaService
80
+ * now rejects it with UserFacingError (Kolors is Kuaishou-hosted, not Alibaba —
81
+ * was returning "Model not exist" 100% of calls). Restore by wiring Kolors
82
+ * through KlingImageService once the Kuaishou Kolors endpoint is mapped.
74
83
  */
75
84
  exports.imageServicesMap = {
76
85
  // --- Google (Imagen + Nano Banana) ---
@@ -98,6 +107,9 @@ exports.imageServicesMap = {
98
107
  [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_EDIT_MAX]: alibaba_1.AlibabaService,
99
108
  [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_EDIT_PLUS]: alibaba_1.AlibabaService,
100
109
  [aiModels_1.EImageGenModels.ALIBABA_QWEN_IMAGE_EDIT]: alibaba_1.AlibabaService,
110
+ // --- Alibaba Wan-Image (T2I + sync instruction edit) ---
111
+ [aiModels_1.EImageGenModels.ALIBABA_WAN_2_7_IMAGE_PRO]: alibaba_1.AlibabaService,
112
+ [aiModels_1.EImageGenModels.ALIBABA_WAN_2_7_IMAGE]: alibaba_1.AlibabaService,
101
113
  // --- MiniMax image-01 ---
102
114
  [aiModels_1.EImageGenModels.MINIMAX_IMAGE_01]: minimax_service_1.MinimaxService,
103
115
  // --- RunwayML Gen-4 Image ---
@@ -2,4 +2,5 @@ export * from "./aiGenFactory.service";
2
2
  export * from "./types";
3
3
  export * from "./helpers";
4
4
  export * from "./providers";
5
+ export * from "./transientRetry";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/aiGen/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/aiGen/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -18,3 +18,4 @@ __exportStar(require("./aiGenFactory.service"), exports);
18
18
  __exportStar(require("./types"), exports);
19
19
  __exportStar(require("./helpers"), exports);
20
20
  __exportStar(require("./providers"), exports);
21
+ __exportStar(require("./transientRetry"), exports);
@@ -4,20 +4,47 @@ export declare class AlibabaService extends BaseAiGenProviderService {
4
4
  private readonly baseUrl;
5
5
  private readonly timeout;
6
6
  constructor();
7
+ /**
8
+ * DashScope API call. `async` toggles the `X-DashScope-Async: enable` header
9
+ * — required for async endpoints (video-generation, image-generation,
10
+ * text2image), MUST be omitted for sync multimodal-generation.
11
+ */
7
12
  private request;
8
13
  generateVideo(params: VideoGenerationParams): Promise<VideoGenerationResult>;
9
14
  checkVideoStatus({ task, outputFilename, outputFilePath, modelKey, }: VideoStatusParams): Promise<VideoStatusResult>;
10
15
  /**
11
- * DashScope image generation. Both Kolors and Qwen-Image are async on
12
- * DashScope — submit returns a task_id, then poll /tasks/{id}. Image jobs
13
- * typically finish in 5–15s, well inside our HTTP timeout, so we poll
14
- * inline rather than going through BullMQ.
16
+ * DashScope image generation. Three dispatch paths (verified live 2026-06-06):
17
+ *
18
+ * 1. SYNC multimodal-generation/generation
19
+ * Models: qwen-image-2.0, qwen-image-2.0-pro, qwen-image-max,
20
+ * qwen-image-edit*, wan2.7-image, wan2.7-image-pro
21
+ * Response: output.choices[0].message.content[].image (inline URLs)
22
+ * Note: NO X-DashScope-Async header. Edit mode is triggered by including
23
+ * {image: refUrl} entries in the user message content array.
24
+ *
25
+ * 2. ASYNC image-generation/generation (Wan async image)
26
+ * Models: wan2.7-image*, wan2.6-image (when caller prefers async; we
27
+ * currently route these through path 1 since they're available
28
+ * there too).
29
+ *
30
+ * 3. ASYNC text2image/image-synthesis (legacy)
31
+ * Models: qwen-image, qwen-image-plus
32
+ * Response: output.results[].url
15
33
  *
16
- * Endpoint selection:
17
- * - Qwen-Image edit (modelId qwen-image-edit*): /image2image/image-synthesis
18
- * - Everything else (Qwen T2I, Kolors): /text2image/image-synthesis
34
+ * Image jobs typically finish in 5–15s, well inside our HTTP timeout, so
35
+ * we poll inline rather than going through BullMQ.
19
36
  */
20
37
  generateImage(params: ImageGenerationParams): Promise<ImageGenerationResult>;
38
+ /**
39
+ * Sync multimodal-generation. Returns inline image URLs in
40
+ * `output.choices[0].message.content[].image`. No polling needed.
41
+ */
42
+ private generateImageSync;
43
+ /**
44
+ * Async submit + poll. Used by both image-generation/generation (Wan async)
45
+ * and text2image/image-synthesis (legacy Qwen).
46
+ */
47
+ private generateImageAsync;
21
48
  getCreditUsed({ modelKey, resolution, aspectRatio, duration, multiClip, numImages, }: CreditUsageParams): number;
22
49
  }
23
50
  //# sourceMappingURL=alibaba.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alibaba.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/alibaba/alibaba.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAiBlB,qBAAa,cAAe,SAAQ,wBAAwB;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;;YASnB,OAAO;IAqBf,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IA0D3B,gBAAgB,CAAC,EACrB,IAAI,EACJ,cAAc,EACd,cAAyB,EACzB,QAAQ,GACT,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA0EjD;;;;;;;;;OASG;IACG,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IA2FjC,aAAa,CAAC,EACZ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAiB,EACjB,SAAa,GACd,EAAE,iBAAiB,GAAG,MAAM;CAmB9B"}
1
+ {"version":3,"file":"alibaba.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/alibaba/alibaba.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AA2DlB,qBAAa,cAAe,SAAQ,wBAAwB;IAE1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;;IAiBjC;;;;OAIG;YACW,OAAO;IAwBf,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IAiE3B,gBAAgB,CAAC,EACrB,IAAI,EACJ,cAAc,EACd,cAAyB,EACzB,QAAQ,GACT,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA0EjD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IA4EjC;;;OAGG;YACW,iBAAiB;IAuC/B;;;OAGG;YACW,kBAAkB;IAuDhC,aAAa,CAAC,EACZ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAiB,EACjB,SAAa,GACd,EAAE,iBAAiB,GAAG,MAAM;CAmB9B"}