@runapi.ai/kling 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/index.d.mts +37 -9
- package/dist/index.d.ts +37 -9
- package/dist/index.js +494 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +500 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -4
- package/skills/kling/README.md +3 -1
- package/skills/kling/SKILL.md +5 -0
package/dist/index.js
CHANGED
|
@@ -41,7 +41,436 @@ var import_core5 = require("@runapi.ai/core");
|
|
|
41
41
|
// src/resources/text-to-video.ts
|
|
42
42
|
var import_core = require("@runapi.ai/core");
|
|
43
43
|
var import_internal = require("@runapi.ai/core/internal");
|
|
44
|
+
|
|
45
|
+
// src/contract_gen.ts
|
|
46
|
+
var contract = {
|
|
47
|
+
"avatar": {
|
|
48
|
+
"models": [
|
|
49
|
+
"kling-ai-avatar-pro",
|
|
50
|
+
"kling-ai-avatar-standard",
|
|
51
|
+
"kling-ai-avatar-v1-pro",
|
|
52
|
+
"kling-v1-avatar-standard"
|
|
53
|
+
],
|
|
54
|
+
"fields_by_model": {
|
|
55
|
+
"kling-ai-avatar-pro": {
|
|
56
|
+
"model": {
|
|
57
|
+
"required": true
|
|
58
|
+
},
|
|
59
|
+
"prompt": {
|
|
60
|
+
"required": true
|
|
61
|
+
},
|
|
62
|
+
"source_audio_url": {
|
|
63
|
+
"required": true
|
|
64
|
+
},
|
|
65
|
+
"source_image_url": {
|
|
66
|
+
"required": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"kling-ai-avatar-standard": {
|
|
70
|
+
"model": {
|
|
71
|
+
"required": true
|
|
72
|
+
},
|
|
73
|
+
"prompt": {
|
|
74
|
+
"required": true
|
|
75
|
+
},
|
|
76
|
+
"source_audio_url": {
|
|
77
|
+
"required": true
|
|
78
|
+
},
|
|
79
|
+
"source_image_url": {
|
|
80
|
+
"required": true
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"kling-ai-avatar-v1-pro": {
|
|
84
|
+
"model": {
|
|
85
|
+
"required": true
|
|
86
|
+
},
|
|
87
|
+
"prompt": {
|
|
88
|
+
"required": true
|
|
89
|
+
},
|
|
90
|
+
"source_audio_url": {
|
|
91
|
+
"required": true
|
|
92
|
+
},
|
|
93
|
+
"source_image_url": {
|
|
94
|
+
"required": true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"kling-v1-avatar-standard": {
|
|
98
|
+
"model": {
|
|
99
|
+
"required": true
|
|
100
|
+
},
|
|
101
|
+
"prompt": {
|
|
102
|
+
"required": true
|
|
103
|
+
},
|
|
104
|
+
"source_audio_url": {
|
|
105
|
+
"required": true
|
|
106
|
+
},
|
|
107
|
+
"source_image_url": {
|
|
108
|
+
"required": true
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"image-to-video": {
|
|
114
|
+
"models": [
|
|
115
|
+
"kling-v2.1-master-image-to-video",
|
|
116
|
+
"kling-v2.1-pro",
|
|
117
|
+
"kling-v2.1-standard",
|
|
118
|
+
"kling-v2.5-turbo-image-to-video-pro",
|
|
119
|
+
"kling-v3-turbo-image-to-video"
|
|
120
|
+
],
|
|
121
|
+
"fields_by_model": {
|
|
122
|
+
"kling-v2.1-master-image-to-video": {
|
|
123
|
+
"duration_seconds": {
|
|
124
|
+
"enum": [
|
|
125
|
+
5,
|
|
126
|
+
10
|
|
127
|
+
],
|
|
128
|
+
"type": "integer"
|
|
129
|
+
},
|
|
130
|
+
"first_frame_image_url": {
|
|
131
|
+
"required": true
|
|
132
|
+
},
|
|
133
|
+
"model": {
|
|
134
|
+
"required": true
|
|
135
|
+
},
|
|
136
|
+
"prompt": {
|
|
137
|
+
"required": true
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"kling-v2.1-pro": {
|
|
141
|
+
"duration_seconds": {
|
|
142
|
+
"enum": [
|
|
143
|
+
5,
|
|
144
|
+
10
|
|
145
|
+
],
|
|
146
|
+
"type": "integer"
|
|
147
|
+
},
|
|
148
|
+
"first_frame_image_url": {
|
|
149
|
+
"required": true
|
|
150
|
+
},
|
|
151
|
+
"model": {
|
|
152
|
+
"required": true
|
|
153
|
+
},
|
|
154
|
+
"prompt": {
|
|
155
|
+
"required": true
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"kling-v2.1-standard": {
|
|
159
|
+
"duration_seconds": {
|
|
160
|
+
"enum": [
|
|
161
|
+
5,
|
|
162
|
+
10
|
|
163
|
+
],
|
|
164
|
+
"type": "integer"
|
|
165
|
+
},
|
|
166
|
+
"first_frame_image_url": {
|
|
167
|
+
"required": true
|
|
168
|
+
},
|
|
169
|
+
"model": {
|
|
170
|
+
"required": true
|
|
171
|
+
},
|
|
172
|
+
"prompt": {
|
|
173
|
+
"required": true
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"kling-v2.5-turbo-image-to-video-pro": {
|
|
177
|
+
"duration_seconds": {
|
|
178
|
+
"enum": [
|
|
179
|
+
5,
|
|
180
|
+
10
|
|
181
|
+
],
|
|
182
|
+
"type": "integer"
|
|
183
|
+
},
|
|
184
|
+
"first_frame_image_url": {
|
|
185
|
+
"required": true
|
|
186
|
+
},
|
|
187
|
+
"model": {
|
|
188
|
+
"required": true
|
|
189
|
+
},
|
|
190
|
+
"prompt": {
|
|
191
|
+
"required": true
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"kling-v3-turbo-image-to-video": {
|
|
195
|
+
"duration_seconds": {
|
|
196
|
+
"enum": [
|
|
197
|
+
3,
|
|
198
|
+
4,
|
|
199
|
+
5,
|
|
200
|
+
6,
|
|
201
|
+
7,
|
|
202
|
+
8,
|
|
203
|
+
9,
|
|
204
|
+
10,
|
|
205
|
+
11,
|
|
206
|
+
12,
|
|
207
|
+
13,
|
|
208
|
+
14,
|
|
209
|
+
15
|
|
210
|
+
],
|
|
211
|
+
"type": "integer"
|
|
212
|
+
},
|
|
213
|
+
"first_frame_image_url": {
|
|
214
|
+
"required": true
|
|
215
|
+
},
|
|
216
|
+
"model": {
|
|
217
|
+
"required": true
|
|
218
|
+
},
|
|
219
|
+
"output_resolution": {
|
|
220
|
+
"enum": [
|
|
221
|
+
"720p",
|
|
222
|
+
"1080p"
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"prompt": {
|
|
226
|
+
"required": true,
|
|
227
|
+
"min": 1,
|
|
228
|
+
"max": 2500,
|
|
229
|
+
"length": true
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"rules": [
|
|
234
|
+
{
|
|
235
|
+
"when": {
|
|
236
|
+
"model": "kling-v2.1-master-image-to-video"
|
|
237
|
+
},
|
|
238
|
+
"forbidden": [
|
|
239
|
+
"output_resolution"
|
|
240
|
+
]
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"when": {
|
|
244
|
+
"model": "kling-v2.1-pro"
|
|
245
|
+
},
|
|
246
|
+
"forbidden": [
|
|
247
|
+
"output_resolution"
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"when": {
|
|
252
|
+
"model": "kling-v2.1-standard"
|
|
253
|
+
},
|
|
254
|
+
"forbidden": [
|
|
255
|
+
"output_resolution"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"when": {
|
|
260
|
+
"model": "kling-v2.5-turbo-image-to-video-pro"
|
|
261
|
+
},
|
|
262
|
+
"forbidden": [
|
|
263
|
+
"output_resolution"
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"when": {
|
|
268
|
+
"model": "kling-v3-turbo-image-to-video"
|
|
269
|
+
},
|
|
270
|
+
"forbidden": [
|
|
271
|
+
"aspect_ratio",
|
|
272
|
+
"negative_prompt",
|
|
273
|
+
"cfg_scale",
|
|
274
|
+
"last_frame_image_url"
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
"motion-control": {
|
|
280
|
+
"models": [
|
|
281
|
+
"kling-3.0"
|
|
282
|
+
],
|
|
283
|
+
"fields_by_model": {
|
|
284
|
+
"kling-3.0": {
|
|
285
|
+
"background_source": {
|
|
286
|
+
"enum": [
|
|
287
|
+
"video",
|
|
288
|
+
"image"
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
"character_orientation": {
|
|
292
|
+
"enum": [
|
|
293
|
+
"video",
|
|
294
|
+
"image"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
"model": {
|
|
298
|
+
"required": true
|
|
299
|
+
},
|
|
300
|
+
"output_resolution": {
|
|
301
|
+
"enum": [
|
|
302
|
+
"720p",
|
|
303
|
+
"1080p"
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
"reference_video_url": {
|
|
307
|
+
"required": true
|
|
308
|
+
},
|
|
309
|
+
"source_image_url": {
|
|
310
|
+
"required": true
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"text-to-video": {
|
|
316
|
+
"models": [
|
|
317
|
+
"kling-3.0",
|
|
318
|
+
"kling-v2.1-master-text-to-video",
|
|
319
|
+
"kling-v2.5-turbo-text-to-video-pro",
|
|
320
|
+
"kling-v3-turbo-text-to-video"
|
|
321
|
+
],
|
|
322
|
+
"fields_by_model": {
|
|
323
|
+
"kling-3.0": {
|
|
324
|
+
"aspect_ratio": {
|
|
325
|
+
"enum": [
|
|
326
|
+
"16:9",
|
|
327
|
+
"9:16",
|
|
328
|
+
"1:1"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"duration_seconds": {
|
|
332
|
+
"enum": [
|
|
333
|
+
3,
|
|
334
|
+
4,
|
|
335
|
+
5,
|
|
336
|
+
6,
|
|
337
|
+
7,
|
|
338
|
+
8,
|
|
339
|
+
9,
|
|
340
|
+
10,
|
|
341
|
+
11,
|
|
342
|
+
12,
|
|
343
|
+
13,
|
|
344
|
+
14,
|
|
345
|
+
15
|
|
346
|
+
],
|
|
347
|
+
"type": "integer"
|
|
348
|
+
},
|
|
349
|
+
"model": {
|
|
350
|
+
"required": true
|
|
351
|
+
},
|
|
352
|
+
"output_resolution": {
|
|
353
|
+
"enum": [
|
|
354
|
+
"720p",
|
|
355
|
+
"1080p",
|
|
356
|
+
"4k"
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"kling-v2.1-master-text-to-video": {
|
|
361
|
+
"aspect_ratio": {
|
|
362
|
+
"enum": [
|
|
363
|
+
"16:9",
|
|
364
|
+
"9:16",
|
|
365
|
+
"1:1"
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
"duration_seconds": {
|
|
369
|
+
"enum": [
|
|
370
|
+
5,
|
|
371
|
+
10
|
|
372
|
+
],
|
|
373
|
+
"type": "integer"
|
|
374
|
+
},
|
|
375
|
+
"model": {
|
|
376
|
+
"required": true
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"kling-v2.5-turbo-text-to-video-pro": {
|
|
380
|
+
"aspect_ratio": {
|
|
381
|
+
"enum": [
|
|
382
|
+
"16:9",
|
|
383
|
+
"9:16",
|
|
384
|
+
"1:1"
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
"duration_seconds": {
|
|
388
|
+
"enum": [
|
|
389
|
+
5,
|
|
390
|
+
10
|
|
391
|
+
],
|
|
392
|
+
"type": "integer"
|
|
393
|
+
},
|
|
394
|
+
"model": {
|
|
395
|
+
"required": true
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"kling-v3-turbo-text-to-video": {
|
|
399
|
+
"aspect_ratio": {
|
|
400
|
+
"enum": [
|
|
401
|
+
"16:9",
|
|
402
|
+
"9:16",
|
|
403
|
+
"1:1"
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
"duration_seconds": {
|
|
407
|
+
"enum": [
|
|
408
|
+
3,
|
|
409
|
+
4,
|
|
410
|
+
5,
|
|
411
|
+
6,
|
|
412
|
+
7,
|
|
413
|
+
8,
|
|
414
|
+
9,
|
|
415
|
+
10,
|
|
416
|
+
11,
|
|
417
|
+
12,
|
|
418
|
+
13,
|
|
419
|
+
14,
|
|
420
|
+
15
|
|
421
|
+
],
|
|
422
|
+
"type": "integer"
|
|
423
|
+
},
|
|
424
|
+
"model": {
|
|
425
|
+
"required": true
|
|
426
|
+
},
|
|
427
|
+
"output_resolution": {
|
|
428
|
+
"enum": [
|
|
429
|
+
"720p",
|
|
430
|
+
"1080p"
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
"prompt": {
|
|
434
|
+
"required": true,
|
|
435
|
+
"min": 1,
|
|
436
|
+
"max": 2500,
|
|
437
|
+
"length": true
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"rules": [
|
|
442
|
+
{
|
|
443
|
+
"when": {
|
|
444
|
+
"model": "kling-v3-turbo-text-to-video"
|
|
445
|
+
},
|
|
446
|
+
"forbidden": [
|
|
447
|
+
"enable_sound",
|
|
448
|
+
"negative_prompt",
|
|
449
|
+
"cfg_scale",
|
|
450
|
+
"multi_shots",
|
|
451
|
+
"multi_prompt",
|
|
452
|
+
"first_frame_image_url",
|
|
453
|
+
"last_frame_image_url",
|
|
454
|
+
"kling_elements"
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
// src/resources/text-to-video.ts
|
|
44
462
|
var ENDPOINT = "/api/v1/kling/text_to_video";
|
|
463
|
+
var V3_TURBO_MODEL = "kling-v3-turbo-text-to-video";
|
|
464
|
+
var V3_TURBO_UNSUPPORTED_FIELDS = [
|
|
465
|
+
"enable_sound",
|
|
466
|
+
"negative_prompt",
|
|
467
|
+
"cfg_scale",
|
|
468
|
+
"multi_shots",
|
|
469
|
+
"multi_prompt",
|
|
470
|
+
"first_frame_image_url",
|
|
471
|
+
"last_frame_image_url",
|
|
472
|
+
"kling_elements"
|
|
473
|
+
];
|
|
45
474
|
var TextToVideo = class {
|
|
46
475
|
constructor(http) {
|
|
47
476
|
this.http = http;
|
|
@@ -68,8 +497,11 @@ var TextToVideo = class {
|
|
|
68
497
|
* @returns The task creation result with id.
|
|
69
498
|
*/
|
|
70
499
|
async create(params, options) {
|
|
500
|
+
const body = (0, import_core.compactParams)(params);
|
|
501
|
+
rejectUnsupportedV3TurboFields(body);
|
|
502
|
+
(0, import_core.validateParams)(contract["text-to-video"], body);
|
|
71
503
|
return this.http.request("POST", ENDPOINT, {
|
|
72
|
-
body
|
|
504
|
+
body,
|
|
73
505
|
...options
|
|
74
506
|
});
|
|
75
507
|
}
|
|
@@ -85,11 +517,40 @@ var TextToVideo = class {
|
|
|
85
517
|
});
|
|
86
518
|
}
|
|
87
519
|
};
|
|
520
|
+
function rejectUnsupportedV3TurboFields(body) {
|
|
521
|
+
if (body.model !== V3_TURBO_MODEL) return;
|
|
522
|
+
const field = V3_TURBO_UNSUPPORTED_FIELDS.find((candidate) => fieldPresent(body, candidate));
|
|
523
|
+
if (field) {
|
|
524
|
+
throw new import_core.ValidationError(`${field} is not supported by ${V3_TURBO_MODEL}`);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
function fieldPresent(params, field) {
|
|
528
|
+
if (!(field in params)) return false;
|
|
529
|
+
const value = params[field];
|
|
530
|
+
if (value === false) return true;
|
|
531
|
+
if (Array.isArray(value)) return value.some((item) => presentValue(item));
|
|
532
|
+
return presentValue(value);
|
|
533
|
+
}
|
|
534
|
+
function presentValue(value) {
|
|
535
|
+
if (value === null || value === void 0 || value === false) return false;
|
|
536
|
+
if (value === true) return true;
|
|
537
|
+
if (typeof value === "string") return value.trim() !== "";
|
|
538
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
539
|
+
if (typeof value === "object") return Object.keys(value).length > 0;
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
88
542
|
|
|
89
543
|
// src/resources/image-to-video.ts
|
|
90
544
|
var import_core2 = require("@runapi.ai/core");
|
|
91
545
|
var import_internal2 = require("@runapi.ai/core/internal");
|
|
92
546
|
var ENDPOINT2 = "/api/v1/kling/image_to_video";
|
|
547
|
+
var V3_TURBO_MODEL2 = "kling-v3-turbo-image-to-video";
|
|
548
|
+
var V3_TURBO_UNSUPPORTED_FIELDS2 = [
|
|
549
|
+
"aspect_ratio",
|
|
550
|
+
"negative_prompt",
|
|
551
|
+
"cfg_scale",
|
|
552
|
+
"last_frame_image_url"
|
|
553
|
+
];
|
|
93
554
|
var ImageToVideo = class {
|
|
94
555
|
constructor(http) {
|
|
95
556
|
this.http = http;
|
|
@@ -116,8 +577,11 @@ var ImageToVideo = class {
|
|
|
116
577
|
* @returns The task creation result with id.
|
|
117
578
|
*/
|
|
118
579
|
async create(params, options) {
|
|
580
|
+
const body = (0, import_core2.compactParams)(params);
|
|
581
|
+
rejectUnsupportedV3TurboFields2(body);
|
|
582
|
+
(0, import_core2.validateParams)(contract["image-to-video"], body);
|
|
119
583
|
return this.http.request("POST", ENDPOINT2, {
|
|
120
|
-
body
|
|
584
|
+
body,
|
|
121
585
|
...options
|
|
122
586
|
});
|
|
123
587
|
}
|
|
@@ -133,6 +597,28 @@ var ImageToVideo = class {
|
|
|
133
597
|
});
|
|
134
598
|
}
|
|
135
599
|
};
|
|
600
|
+
function rejectUnsupportedV3TurboFields2(body) {
|
|
601
|
+
if (body.model !== V3_TURBO_MODEL2) return;
|
|
602
|
+
const field = V3_TURBO_UNSUPPORTED_FIELDS2.find((candidate) => fieldPresent2(body, candidate));
|
|
603
|
+
if (field) {
|
|
604
|
+
throw new import_core2.ValidationError(`${field} is not supported by ${V3_TURBO_MODEL2}`);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function fieldPresent2(params, field) {
|
|
608
|
+
if (!(field in params)) return false;
|
|
609
|
+
const value = params[field];
|
|
610
|
+
if (value === false) return true;
|
|
611
|
+
if (Array.isArray(value)) return value.some((item) => presentValue2(item));
|
|
612
|
+
return presentValue2(value);
|
|
613
|
+
}
|
|
614
|
+
function presentValue2(value) {
|
|
615
|
+
if (value === null || value === void 0 || value === false) return false;
|
|
616
|
+
if (value === true) return true;
|
|
617
|
+
if (typeof value === "string") return value.trim() !== "";
|
|
618
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
619
|
+
if (typeof value === "object") return Object.keys(value).length > 0;
|
|
620
|
+
return true;
|
|
621
|
+
}
|
|
136
622
|
|
|
137
623
|
// src/resources/ai-avatar.ts
|
|
138
624
|
var import_core3 = require("@runapi.ai/core");
|
|
@@ -164,8 +650,10 @@ var AiAvatar = class {
|
|
|
164
650
|
* @returns The task creation result with id.
|
|
165
651
|
*/
|
|
166
652
|
async create(params, options) {
|
|
653
|
+
const body = (0, import_core3.compactParams)(params);
|
|
654
|
+
(0, import_core3.validateParams)(contract["avatar"], body);
|
|
167
655
|
return this.http.request("POST", ENDPOINT3, {
|
|
168
|
-
body
|
|
656
|
+
body,
|
|
169
657
|
...options
|
|
170
658
|
});
|
|
171
659
|
}
|
|
@@ -212,8 +700,10 @@ var MotionControl = class {
|
|
|
212
700
|
* @returns The task creation result with id.
|
|
213
701
|
*/
|
|
214
702
|
async create(params, options) {
|
|
703
|
+
const body = (0, import_core4.compactParams)(params);
|
|
704
|
+
(0, import_core4.validateParams)(contract["motion-control"], body);
|
|
215
705
|
return this.http.request("POST", ENDPOINT4, {
|
|
216
|
-
body
|
|
706
|
+
body,
|
|
217
707
|
...options
|
|
218
708
|
});
|
|
219
709
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-video.ts","../src/resources/image-to-video.ts","../src/resources/ai-avatar.ts","../src/resources/motion-control.ts"],"sourcesContent":["export { KlingClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\nimport { ImageToVideo } from './resources/image-to-video';\nimport { AiAvatar } from './resources/ai-avatar';\nimport { MotionControl } from './resources/motion-control';\n\n/**\n * Kling video generation, AI avatar lip-sync, and motion control API client.\n *\n * @example\n * ```typescript\n * const client = new KlingClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'kling-3.0',\n * prompt: 'A cat walking through a garden',\n * });\n * ```\n */\nexport class KlingClient extends BaseClient {\n /** Text-to-video generation with multi-shot, sound, and Kling elements support on kling-3.0. */\n public readonly textToVideo: TextToVideo;\n /** Image-to-video animation from a first-frame image guided by a text prompt. */\n public readonly imageToVideo: ImageToVideo;\n /** AI avatar lip-sync: animate a face image to match an audio track. */\n public readonly aiAvatar: AiAvatar;\n /** Transfer motion from a reference video onto a subject image. */\n public readonly motionControl: MotionControl;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n this.imageToVideo = new ImageToVideo(this.http);\n this.aiAvatar = new AiAvatar(this.http);\n this.motionControl = new MotionControl(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/text_to_video';\n\n/** Generate video from text prompts. Supports multi-shot, sound, first/last frame images, and Kling elements on kling-3.0; negative prompts and cfg_scale on V2.x models. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video from a text prompt and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/image_to_video';\n\n/** Animate a still image into video, guided by a text prompt and first-frame image. */\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video from an input image and wait until complete.\n * @param params Image-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: ImageToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedImageToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ImageToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedImageToVideoResponse;\n }\n\n /**\n * Create an image-to-video task; returns immediately with a task id.\n * @param params Image-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image-to-video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse> {\n return this.http.request<ImageToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedAiAvatarResponse,\n AiAvatarParams,\n AiAvatarResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/ai_avatar';\n\n/** Lip-sync a face image to an audio track, producing a talking-head video. */\nexport class AiAvatar {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate an AI avatar video and wait until complete.\n * @param params AI avatar parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: AiAvatarParams, options?: RequestOptions & PollingOptions): Promise<CompletedAiAvatarResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<AiAvatarResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedAiAvatarResponse;\n }\n\n /**\n * Create an AI avatar generation task; returns immediately with a task id.\n * @param params AI avatar parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: AiAvatarParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an AI avatar task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current AI avatar task status.\n */\n async get(id: string, options?: RequestOptions): Promise<AiAvatarResponse> {\n return this.http.request<AiAvatarResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedMotionControlResponse,\n MotionControlParams,\n MotionControlResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/motion_control';\n\n/** Transfer motion from a reference video onto a subject image, preserving the subject's appearance. */\nexport class MotionControl {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video with motion transfer from a reference video and wait until complete.\n * @param params Motion control parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: MotionControlParams, options?: RequestOptions & PollingOptions): Promise<CompletedMotionControlResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<MotionControlResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedMotionControlResponse;\n }\n\n /**\n * Create a motion control generation task; returns immediately with a task id.\n * @param params Motion control parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: MotionControlParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a motion control task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current motion control task status.\n */\n async get(id: string, options?: RequestOptions): Promise<MotionControlResponse> {\n return this.http.request<MotionControlResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;A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,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,WAAW,IAAI,SAAS,KAAK,IAAI;AACtC,SAAK,gBAAgB,IAAI,cAAc,KAAK,IAAI;AAAA,EAClD;AACF;;;ADjCA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-video.ts","../src/contract_gen.ts","../src/resources/image-to-video.ts","../src/resources/ai-avatar.ts","../src/resources/motion-control.ts"],"sourcesContent":["export { KlingClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\nimport { ImageToVideo } from './resources/image-to-video';\nimport { AiAvatar } from './resources/ai-avatar';\nimport { MotionControl } from './resources/motion-control';\n\n/**\n * Kling video generation, AI avatar lip-sync, and motion control API client.\n *\n * @example\n * ```typescript\n * const client = new KlingClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'kling-3.0',\n * prompt: 'A cat walking through a garden',\n * });\n * ```\n */\nexport class KlingClient extends BaseClient {\n /** Text-to-video generation with multi-shot, sound, and Kling elements support on kling-3.0. */\n public readonly textToVideo: TextToVideo;\n /** Image-to-video animation from a first-frame image guided by a text prompt. */\n public readonly imageToVideo: ImageToVideo;\n /** AI avatar lip-sync: animate a face image to match an audio track. */\n public readonly aiAvatar: AiAvatar;\n /** Transfer motion from a reference video onto a subject image. */\n public readonly motionControl: MotionControl;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n this.imageToVideo = new ImageToVideo(this.http);\n this.aiAvatar = new AiAvatar(this.http);\n this.motionControl = new MotionControl(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { ValidationError, compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/text_to_video';\nconst V3_TURBO_MODEL = 'kling-v3-turbo-text-to-video';\nconst V3_TURBO_UNSUPPORTED_FIELDS = [\n 'enable_sound',\n 'negative_prompt',\n 'cfg_scale',\n 'multi_shots',\n 'multi_prompt',\n 'first_frame_image_url',\n 'last_frame_image_url',\n 'kling_elements',\n];\n\n/** Generate video from text prompts. Supports multi-shot, sound, first/last frame images, and Kling elements on kling-3.0; negative prompts and cfg_scale on V2.x models. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video from a text prompt and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n rejectUnsupportedV3TurboFields(body as Record<string, unknown>);\n validateParams(contract['text-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n\nfunction rejectUnsupportedV3TurboFields(body: Record<string, unknown>): void {\n if (body.model !== V3_TURBO_MODEL) return;\n\n const field = V3_TURBO_UNSUPPORTED_FIELDS.find((candidate) => fieldPresent(body, candidate));\n if (field) {\n throw new ValidationError(`${field} is not supported by ${V3_TURBO_MODEL}`);\n }\n}\n\nfunction fieldPresent(params: Record<string, unknown>, field: string): boolean {\n if (!(field in params)) return false;\n const value = params[field];\n if (value === false) return true;\n if (Array.isArray(value)) return value.some((item) => presentValue(item));\n return presentValue(value);\n}\n\nfunction presentValue(value: unknown): boolean {\n if (value === null || value === undefined || value === false) return false;\n if (value === true) return true;\n if (typeof value === 'string') return value.trim() !== '';\n if (Array.isArray(value)) return value.length > 0;\n if (typeof value === 'object') return Object.keys(value as object).length > 0;\n return true;\n}\n","export const contract = {\n \"avatar\": {\n \"models\": [\n \"kling-ai-avatar-pro\",\n \"kling-ai-avatar-standard\",\n \"kling-ai-avatar-v1-pro\",\n \"kling-v1-avatar-standard\"\n ],\n \"fields_by_model\": {\n \"kling-ai-avatar-pro\": {\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n },\n \"source_audio_url\": {\n \"required\": true\n },\n \"source_image_url\": {\n \"required\": true\n }\n },\n \"kling-ai-avatar-standard\": {\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n },\n \"source_audio_url\": {\n \"required\": true\n },\n \"source_image_url\": {\n \"required\": true\n }\n },\n \"kling-ai-avatar-v1-pro\": {\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n },\n \"source_audio_url\": {\n \"required\": true\n },\n \"source_image_url\": {\n \"required\": true\n }\n },\n \"kling-v1-avatar-standard\": {\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n },\n \"source_audio_url\": {\n \"required\": true\n },\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"image-to-video\": {\n \"models\": [\n \"kling-v2.1-master-image-to-video\",\n \"kling-v2.1-pro\",\n \"kling-v2.1-standard\",\n \"kling-v2.5-turbo-image-to-video-pro\",\n \"kling-v3-turbo-image-to-video\"\n ],\n \"fields_by_model\": {\n \"kling-v2.1-master-image-to-video\": {\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n }\n },\n \"kling-v2.1-pro\": {\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n }\n },\n \"kling-v2.1-standard\": {\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n }\n },\n \"kling-v2.5-turbo-image-to-video-pro\": {\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"model\": {\n \"required\": true\n },\n \"prompt\": {\n \"required\": true\n }\n },\n \"kling-v3-turbo-image-to-video\": {\n \"duration_seconds\": {\n \"enum\": [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15\n ],\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"model\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 1,\n \"max\": 2500,\n \"length\": true\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"kling-v2.1-master-image-to-video\"\n },\n \"forbidden\": [\n \"output_resolution\"\n ]\n },\n {\n \"when\": {\n \"model\": \"kling-v2.1-pro\"\n },\n \"forbidden\": [\n \"output_resolution\"\n ]\n },\n {\n \"when\": {\n \"model\": \"kling-v2.1-standard\"\n },\n \"forbidden\": [\n \"output_resolution\"\n ]\n },\n {\n \"when\": {\n \"model\": \"kling-v2.5-turbo-image-to-video-pro\"\n },\n \"forbidden\": [\n \"output_resolution\"\n ]\n },\n {\n \"when\": {\n \"model\": \"kling-v3-turbo-image-to-video\"\n },\n \"forbidden\": [\n \"aspect_ratio\",\n \"negative_prompt\",\n \"cfg_scale\",\n \"last_frame_image_url\"\n ]\n }\n ]\n },\n \"motion-control\": {\n \"models\": [\n \"kling-3.0\"\n ],\n \"fields_by_model\": {\n \"kling-3.0\": {\n \"background_source\": {\n \"enum\": [\n \"video\",\n \"image\"\n ]\n },\n \"character_orientation\": {\n \"enum\": [\n \"video\",\n \"image\"\n ]\n },\n \"model\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"reference_video_url\": {\n \"required\": true\n },\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-video\": {\n \"models\": [\n \"kling-3.0\",\n \"kling-v2.1-master-text-to-video\",\n \"kling-v2.5-turbo-text-to-video-pro\",\n \"kling-v3-turbo-text-to-video\"\n ],\n \"fields_by_model\": {\n \"kling-3.0\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15\n ],\n \"type\": \"integer\"\n },\n \"model\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\",\n \"4k\"\n ]\n }\n },\n \"kling-v2.1-master-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"type\": \"integer\"\n },\n \"model\": {\n \"required\": true\n }\n },\n \"kling-v2.5-turbo-text-to-video-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"type\": \"integer\"\n },\n \"model\": {\n \"required\": true\n }\n },\n \"kling-v3-turbo-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15\n ],\n \"type\": \"integer\"\n },\n \"model\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 1,\n \"max\": 2500,\n \"length\": true\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"kling-v3-turbo-text-to-video\"\n },\n \"forbidden\": [\n \"enable_sound\",\n \"negative_prompt\",\n \"cfg_scale\",\n \"multi_shots\",\n \"multi_prompt\",\n \"first_frame_image_url\",\n \"last_frame_image_url\",\n \"kling_elements\"\n ]\n }\n ]\n }\n} as const;\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { ValidationError, compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/image_to_video';\nconst V3_TURBO_MODEL = 'kling-v3-turbo-image-to-video';\nconst V3_TURBO_UNSUPPORTED_FIELDS = [\n 'aspect_ratio',\n 'negative_prompt',\n 'cfg_scale',\n 'last_frame_image_url',\n];\n\n/** Animate a still image into video, guided by a text prompt and first-frame image. */\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video from an input image and wait until complete.\n * @param params Image-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: ImageToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedImageToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ImageToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedImageToVideoResponse;\n }\n\n /**\n * Create an image-to-video task; returns immediately with a task id.\n * @param params Image-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n rejectUnsupportedV3TurboFields(body as Record<string, unknown>);\n validateParams(contract['image-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image-to-video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse> {\n return this.http.request<ImageToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n\nfunction rejectUnsupportedV3TurboFields(body: Record<string, unknown>): void {\n if (body.model !== V3_TURBO_MODEL) return;\n\n const field = V3_TURBO_UNSUPPORTED_FIELDS.find((candidate) => fieldPresent(body, candidate));\n if (field) {\n throw new ValidationError(`${field} is not supported by ${V3_TURBO_MODEL}`);\n }\n}\n\nfunction fieldPresent(params: Record<string, unknown>, field: string): boolean {\n if (!(field in params)) return false;\n const value = params[field];\n if (value === false) return true;\n if (Array.isArray(value)) return value.some((item) => presentValue(item));\n return presentValue(value);\n}\n\nfunction presentValue(value: unknown): boolean {\n if (value === null || value === undefined || value === false) return false;\n if (value === true) return true;\n if (typeof value === 'string') return value.trim() !== '';\n if (Array.isArray(value)) return value.length > 0;\n if (typeof value === 'object') return Object.keys(value as object).length > 0;\n return true;\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedAiAvatarResponse,\n AiAvatarParams,\n AiAvatarResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/ai_avatar';\n\n/** Lip-sync a face image to an audio track, producing a talking-head video. */\nexport class AiAvatar {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate an AI avatar video and wait until complete.\n * @param params AI avatar parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: AiAvatarParams, options?: RequestOptions & PollingOptions): Promise<CompletedAiAvatarResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<AiAvatarResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedAiAvatarResponse;\n }\n\n /**\n * Create an AI avatar generation task; returns immediately with a task id.\n * @param params AI avatar parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: AiAvatarParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['avatar'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an AI avatar task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current AI avatar task status.\n */\n async get(id: string, options?: RequestOptions): Promise<AiAvatarResponse> {\n return this.http.request<AiAvatarResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedMotionControlResponse,\n MotionControlParams,\n MotionControlResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/kling/motion_control';\n\n/** Transfer motion from a reference video onto a subject image, preserving the subject's appearance. */\nexport class MotionControl {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video with motion transfer from a reference video and wait until complete.\n * @param params Motion control parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\n */\n async run(params: MotionControlParams, options?: RequestOptions & PollingOptions): Promise<CompletedMotionControlResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<MotionControlResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedMotionControlResponse;\n }\n\n /**\n * Create a motion control generation task; returns immediately with a task id.\n * @param params Motion control parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: MotionControlParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['motion-control'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a motion control task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current motion control task status.\n */\n async get(id: string, options?: RequestOptions): Promise<MotionControlResponse> {\n return this.http.request<MotionControlResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n"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,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAA0D;AAC9E,WAAO,KAAK,KAAK,QAA+B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MAC1E,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ALvCO,IAAM,cAAN,cAA0B,wBAAW;AAAA;AAAA,EAE1B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,WAAW,IAAI,SAAS,KAAK,IAAI;AACtC,SAAK,gBAAgB,IAAI,cAAc,KAAK,IAAI;AAAA,EAClD;AACF;;;ADjCA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","V3_TURBO_MODEL","V3_TURBO_UNSUPPORTED_FIELDS","rejectUnsupportedV3TurboFields","fieldPresent","presentValue","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core"]}
|