@unityclaw/sdk 1.0.1 → 1.0.2

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/dist/index.cjs CHANGED
@@ -242,31 +242,31 @@ var ImageAPI = class {
242
242
  * prompt: 'A beautiful sunset over mountains',
243
243
  * size: { value: '2K', label: '2K' }
244
244
  * });
245
+ * console.log('Task folder:', result.taskFolder);
246
+ * console.log('Local path:', result.response.data?.[0]?.localPath);
245
247
  * ```
246
248
  */
247
249
  async gemini(params) {
248
- const taskResult = await this.client.request("/api/gemini/image", {
250
+ return this.client.request("/api/gemini/image", {
249
251
  prompt: params.prompt,
250
252
  attachment: params.attachment,
251
253
  model: params.model,
252
254
  aspect_ratio: params.aspect_ratio,
253
255
  size: params.size
254
256
  });
255
- return taskResult.response;
256
257
  }
257
258
  /**
258
259
  * Generate image using Gemini API v2
259
260
  * @see /api/gemini/image/v2
260
261
  */
261
262
  async geminiV2(params) {
262
- const taskResult = await this.client.request("/api/gemini/image/v2", {
263
+ return this.client.request("/api/gemini/image/v2", {
263
264
  prompt: params.prompt,
264
265
  attachment: params.attachment,
265
266
  model: params.model,
266
267
  aspect_ratio: params.aspect_ratio,
267
268
  size: params.size
268
269
  });
269
- return taskResult.response;
270
270
  }
271
271
  /**
272
272
  * Generate image using JiMeng (Doubao) API
@@ -278,10 +278,11 @@ var ImageAPI = class {
278
278
  * prompt: '一只可爱的猫咪',
279
279
  * size: { value: '1024x1024', label: '1:1' }
280
280
  * });
281
+ * console.log('Task folder:', result.taskFolder);
281
282
  * ```
282
283
  */
283
284
  async jimeng(params) {
284
- const taskResult = await this.client.request("/api/jimeng/image", {
285
+ return this.client.request("/api/jimeng/image", {
285
286
  prompt: params.prompt,
286
287
  attachment: params.attachment,
287
288
  size: params.size,
@@ -290,14 +291,13 @@ var ImageAPI = class {
290
291
  image_count: params.image_count,
291
292
  model: params.model
292
293
  });
293
- return taskResult.response;
294
294
  }
295
295
  /**
296
296
  * Generate image using JiMeng V3 API
297
297
  * @see /api/jimeng/image/v3
298
298
  */
299
299
  async jimengV3(params) {
300
- const taskResult = await this.client.request("/api/jimeng/image/v3", {
300
+ return this.client.request("/api/jimeng/image/v3", {
301
301
  prompt: params.prompt,
302
302
  attachment: params.attachment,
303
303
  size: params.size,
@@ -306,18 +306,16 @@ var ImageAPI = class {
306
306
  image_count: params.image_count,
307
307
  model: params.model
308
308
  });
309
- return taskResult.response;
310
309
  }
311
310
  /**
312
311
  * Compress image
313
312
  * @see /api/image/compress
314
313
  */
315
314
  async compress(params) {
316
- const taskResult = await this.client.request("/api/image/compress", {
315
+ return this.client.request("/api/image/compress", {
317
316
  attachment: params.attachment,
318
317
  quality: params.quality
319
318
  });
320
- return taskResult.response;
321
319
  }
322
320
  };
323
321
 
@@ -336,28 +334,27 @@ var VideoAPI = class {
336
334
  * prompt: 'A cat playing piano',
337
335
  * orientation: { value: 'landscape', label: 'Landscape' }
338
336
  * });
337
+ * console.log('Task folder:', result.taskFolder);
339
338
  * ```
340
339
  */
341
340
  async sora(params) {
342
- const taskResult = await this.client.request("/api/sora/video", {
341
+ return this.client.request("/api/sora/video", {
343
342
  attachment: params.attachment,
344
343
  prompt: params.prompt,
345
344
  orientation: params.orientation
346
345
  });
347
- return taskResult.response;
348
346
  }
349
347
  /**
350
348
  * Generate video using Sora Stable API
351
349
  * @see /api/sora/video/stable
352
350
  */
353
351
  async soraStable(params) {
354
- const taskResult = await this.client.request("/api/sora/video/stable", {
352
+ return this.client.request("/api/sora/video/stable", {
355
353
  attachment: params.attachment,
356
354
  prompt: params.prompt,
357
355
  size: params.size,
358
356
  seconds: params.seconds
359
357
  });
360
- return taskResult.response;
361
358
  }
362
359
  /**
363
360
  * Generate video using Veo API
@@ -373,7 +370,7 @@ var VideoAPI = class {
373
370
  * ```
374
371
  */
375
372
  async veo(params) {
376
- const taskResult = await this.client.request("/api/veo/video", {
373
+ return this.client.request("/api/veo/video", {
377
374
  prompt: params.prompt,
378
375
  attachment: params.attachment,
379
376
  first_frame: params.first_frame,
@@ -382,7 +379,6 @@ var VideoAPI = class {
382
379
  resolution: params.resolution,
383
380
  duration: params.duration
384
381
  });
385
- return taskResult.response;
386
382
  }
387
383
  /**
388
384
  * Generate video using Kling API
@@ -399,14 +395,13 @@ var VideoAPI = class {
399
395
  * ```
400
396
  */
401
397
  async kling(params) {
402
- const taskResult = await this.client.request("/api/kling/video", {
398
+ return this.client.request("/api/kling/video", {
403
399
  attachment: params.attachment,
404
400
  prompt: params.prompt,
405
401
  aspect_ratio: params.aspect_ratio,
406
402
  duration: params.duration,
407
403
  model: params.model
408
404
  });
409
- return taskResult.response;
410
405
  }
411
406
  /**
412
407
  * Generate video using JiMeng API
@@ -422,13 +417,12 @@ var VideoAPI = class {
422
417
  * ```
423
418
  */
424
419
  async jimeng(params) {
425
- const taskResult = await this.client.request("/api/jimeng/video", {
420
+ return this.client.request("/api/jimeng/video", {
426
421
  action: params.action,
427
422
  attachment: params.attachment,
428
423
  prompt: params.prompt,
429
424
  aspect_ratio: params.aspect_ratio
430
425
  });
431
- return taskResult.response;
432
426
  }
433
427
  /**
434
428
  * Generate video using Doubao API
@@ -444,7 +438,7 @@ var VideoAPI = class {
444
438
  * ```
445
439
  */
446
440
  async doubao(params) {
447
- const taskResult = await this.client.request("/api/doubao/video", {
441
+ return this.client.request("/api/doubao/video", {
448
442
  action: params.action,
449
443
  attachment: params.attachment,
450
444
  prompt: params.prompt,
@@ -452,7 +446,6 @@ var VideoAPI = class {
452
446
  ratio: params.ratio,
453
447
  duration: params.duration
454
448
  });
455
- return taskResult.response;
456
449
  }
457
450
  /**
458
451
  * Generate video using Wan API (Alibaba)
@@ -469,7 +462,7 @@ var VideoAPI = class {
469
462
  * ```
470
463
  */
471
464
  async wan(params) {
472
- const taskResult = await this.client.request("/api/wan/video", {
465
+ return this.client.request("/api/wan/video", {
473
466
  attachment: params.attachment,
474
467
  prompt: params.prompt,
475
468
  size: params.size,
@@ -477,7 +470,6 @@ var VideoAPI = class {
477
470
  model: params.model,
478
471
  shot_type: params.shot_type
479
472
  });
480
- return taskResult.response;
481
473
  }
482
474
  /**
483
475
  * Generate video using MiniMax API
@@ -493,14 +485,13 @@ var VideoAPI = class {
493
485
  * ```
494
486
  */
495
487
  async minimax(params) {
496
- const taskResult = await this.client.request("/api/minimax/video", {
488
+ return this.client.request("/api/minimax/video", {
497
489
  attachment: params.attachment,
498
490
  prompt: params.prompt,
499
491
  size: params.size,
500
492
  duration: params.duration,
501
493
  model: params.model
502
494
  });
503
- return taskResult.response;
504
495
  }
505
496
  };
506
497
 
@@ -520,119 +511,111 @@ var DocumentAPI = class {
520
511
  * source_language: { value: 'en', label: 'English' },
521
512
  * target_language: { value: 'zh', label: 'Chinese' }
522
513
  * });
514
+ * console.log('Task folder:', result.taskFolder);
523
515
  * ```
524
516
  */
525
517
  async translate(params) {
526
- const taskResult = await this.client.request("/api/doc/translate", {
518
+ return this.client.request("/api/doc/translate", {
527
519
  attachment: params.attachment,
528
520
  source_language: params.source_language,
529
521
  target_language: params.target_language
530
522
  });
531
- return taskResult.response;
532
523
  }
533
524
  /**
534
525
  * Convert image to Word document
535
526
  * @see /api/doc_convert/image2word
536
527
  */
537
528
  async image2Word(params) {
538
- const taskResult = await this.client.request(
529
+ return this.client.request(
539
530
  "/api/doc_convert/image2word",
540
531
  {
541
532
  attachment: params.attachment
542
533
  }
543
534
  );
544
- return taskResult.response;
545
535
  }
546
536
  /**
547
537
  * Convert image to PowerPoint
548
538
  * @see /api/doc_convert/image2ppt
549
539
  */
550
540
  async image2Ppt(params) {
551
- const taskResult = await this.client.request(
541
+ return this.client.request(
552
542
  "/api/doc_convert/image2ppt",
553
543
  {
554
544
  attachment: params.attachment
555
545
  }
556
546
  );
557
- return taskResult.response;
558
547
  }
559
548
  /**
560
549
  * Convert image to Excel
561
550
  * @see /api/doc_convert/image2excel
562
551
  */
563
552
  async image2Excel(params) {
564
- const taskResult = await this.client.request(
553
+ return this.client.request(
565
554
  "/api/doc_convert/image2excel",
566
555
  {
567
556
  attachment: params.attachment
568
557
  }
569
558
  );
570
- return taskResult.response;
571
559
  }
572
560
  /**
573
561
  * Convert image to PDF
574
562
  * @see /api/doc_convert/image2pdf
575
563
  */
576
564
  async image2Pdf(params) {
577
- const taskResult = await this.client.request(
565
+ return this.client.request(
578
566
  "/api/doc_convert/image2pdf",
579
567
  {
580
568
  attachment: params.attachment
581
569
  }
582
570
  );
583
- return taskResult.response;
584
571
  }
585
572
  /**
586
573
  * Convert PDF to Word document
587
574
  * @see /api/doc_convert/pdf2word
588
575
  */
589
576
  async pdf2Word(params) {
590
- const taskResult = await this.client.request(
577
+ return this.client.request(
591
578
  "/api/doc_convert/pdf2word",
592
579
  {
593
580
  attachment: params.attachment
594
581
  }
595
582
  );
596
- return taskResult.response;
597
583
  }
598
584
  /**
599
585
  * Convert PDF to PowerPoint
600
586
  * @see /api/doc_convert/pdf2ppt
601
587
  */
602
588
  async pdf2Ppt(params) {
603
- const taskResult = await this.client.request(
589
+ return this.client.request(
604
590
  "/api/doc_convert/pdf2ppt",
605
591
  {
606
592
  attachment: params.attachment
607
593
  }
608
594
  );
609
- return taskResult.response;
610
595
  }
611
596
  /**
612
597
  * Convert PDF to Excel
613
598
  * @see /api/doc_convert/pdf2excel
614
599
  */
615
600
  async pdf2Excel(params) {
616
- const taskResult = await this.client.request(
601
+ return this.client.request(
617
602
  "/api/doc_convert/pdf2excel",
618
603
  {
619
604
  attachment: params.attachment
620
605
  }
621
606
  );
622
- return taskResult.response;
623
607
  }
624
608
  /**
625
609
  * Convert PDF to image
626
610
  * @see /api/doc_convert/pdf2image
627
611
  */
628
612
  async pdf2Image(params) {
629
- const taskResult = await this.client.request(
613
+ return this.client.request(
630
614
  "/api/doc_convert/pdf2image",
631
615
  {
632
616
  attachment: params.attachment
633
617
  }
634
618
  );
635
- return taskResult.response;
636
619
  }
637
620
  /**
638
621
  * Generic document conversion
@@ -642,12 +625,11 @@ var DocumentAPI = class {
642
625
  async convert(params) {
643
626
  const isImage = params.input_format === "image" || !params.input_format;
644
627
  const endpoint = isImage ? "/api/doc_convert/image" : "/api/doc_convert/pdf";
645
- const taskResult = await this.client.request(endpoint, {
628
+ return this.client.request(endpoint, {
646
629
  attachment: params.attachment,
647
630
  input_format: params.input_format,
648
631
  output_format: params.output_format
649
632
  });
650
- return taskResult.response;
651
633
  }
652
634
  };
653
635
 
@@ -671,13 +653,15 @@ var MediaAPI = class {
671
653
  * const result = await client.media.analyze({
672
654
  * url: [{ tmp_url: 'https://...', type: 'video/mp4', name: 'video.mp4' }]
673
655
  * });
656
+ *
657
+ * console.log('Task folder:', result.taskFolder);
658
+ * console.log('Summary:', result.response.data?.summary);
674
659
  * ```
675
660
  */
676
661
  async analyze(params) {
677
- const taskResult = await this.client.request("/api/media_analysis", {
662
+ return this.client.request("/api/media_analysis", {
678
663
  url: params.url
679
664
  });
680
- return taskResult.response;
681
665
  }
682
666
  /**
683
667
  * Analyze video file directly
@@ -692,7 +676,7 @@ var MediaAPI = class {
692
676
  * ```
693
677
  */
694
678
  async analyzeVideo(params) {
695
- const taskResult = await this.client.request("/api/media_analysis", {
679
+ return this.client.request("/api/media_analysis", {
696
680
  url: [
697
681
  {
698
682
  tmp_url: params.file.tmp_url,
@@ -702,7 +686,6 @@ var MediaAPI = class {
702
686
  }
703
687
  ]
704
688
  });
705
- return taskResult.response;
706
689
  }
707
690
  /**
708
691
  * Analyze social media video (TikTok, YouTube, etc.)
@@ -716,10 +699,9 @@ var MediaAPI = class {
716
699
  * ```
717
700
  */
718
701
  async analyzeSocialVideo(params) {
719
- const taskResult = await this.client.request("/api/media_analysis", {
702
+ return this.client.request("/api/media_analysis", {
720
703
  url: [{ link: params.url, type: "url" }]
721
704
  });
722
- return taskResult.response;
723
705
  }
724
706
  };
725
707
 
package/dist/index.d.cts CHANGED
@@ -335,14 +335,16 @@ declare class ImageAPI {
335
335
  * prompt: 'A beautiful sunset over mountains',
336
336
  * size: { value: '2K', label: '2K' }
337
337
  * });
338
+ * console.log('Task folder:', result.taskFolder);
339
+ * console.log('Local path:', result.response.data?.[0]?.localPath);
338
340
  * ```
339
341
  */
340
- gemini(params: GeminiImageRequestParams): Promise<APIResponse<AttachmentResult[]>>;
342
+ gemini(params: GeminiImageRequestParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
341
343
  /**
342
344
  * Generate image using Gemini API v2
343
345
  * @see /api/gemini/image/v2
344
346
  */
345
- geminiV2(params: GeminiImageRequestParams): Promise<APIResponse<AttachmentResult[]>>;
347
+ geminiV2(params: GeminiImageRequestParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
346
348
  /**
347
349
  * Generate image using JiMeng (Doubao) API
348
350
  * @see /api/jimeng/image
@@ -353,14 +355,15 @@ declare class ImageAPI {
353
355
  * prompt: '一只可爱的猫咪',
354
356
  * size: { value: '1024x1024', label: '1:1' }
355
357
  * });
358
+ * console.log('Task folder:', result.taskFolder);
356
359
  * ```
357
360
  */
358
- jimeng(params: JiMengImageRequestParams): Promise<APIResponse<AttachmentResult[]>>;
361
+ jimeng(params: JiMengImageRequestParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
359
362
  /**
360
363
  * Generate image using JiMeng V3 API
361
364
  * @see /api/jimeng/image/v3
362
365
  */
363
- jimengV3(params: JiMengImageRequestParams): Promise<APIResponse<AttachmentResult[]>>;
366
+ jimengV3(params: JiMengImageRequestParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
364
367
  /**
365
368
  * Compress image
366
369
  * @see /api/image/compress
@@ -372,7 +375,7 @@ declare class ImageAPI {
372
375
  type?: string;
373
376
  }>;
374
377
  quality?: number;
375
- }): Promise<APIResponse<AttachmentResult[]>>;
378
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
376
379
  }
377
380
 
378
381
  /**
@@ -396,13 +399,14 @@ declare class VideoAPI {
396
399
  * prompt: 'A cat playing piano',
397
400
  * orientation: { value: 'landscape', label: 'Landscape' }
398
401
  * });
402
+ * console.log('Task folder:', result.taskFolder);
399
403
  * ```
400
404
  */
401
405
  sora(params: {
402
406
  attachment?: SoraVideoParams['attachment'];
403
407
  prompt?: string | TextFieldItem[];
404
408
  orientation: LabelFieldItem | string;
405
- }): Promise<APIResponse<AttachmentResult[]>>;
409
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
406
410
  /**
407
411
  * Generate video using Sora Stable API
408
412
  * @see /api/sora/video/stable
@@ -416,7 +420,7 @@ declare class VideoAPI {
416
420
  prompt?: string | TextFieldItem[];
417
421
  size?: LabelFieldItem | string;
418
422
  seconds?: LabelFieldItem | string;
419
- }): Promise<APIResponse<AttachmentResult[]>>;
423
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
420
424
  /**
421
425
  * Generate video using Veo API
422
426
  * @see /api/veo/video
@@ -438,7 +442,7 @@ declare class VideoAPI {
438
442
  aspect_ratio?: LabelFieldItem | string;
439
443
  resolution?: LabelFieldItem | string;
440
444
  duration?: LabelFieldItem | string;
441
- }): Promise<APIResponse<AttachmentResult[]>>;
445
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
442
446
  /**
443
447
  * Generate video using Kling API
444
448
  * @see /api/kling/video
@@ -459,7 +463,7 @@ declare class VideoAPI {
459
463
  aspect_ratio?: LabelFieldItem | string;
460
464
  duration?: LabelFieldItem | string;
461
465
  model?: LabelFieldItem | string;
462
- }): Promise<APIResponse<AttachmentResult[]>>;
466
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
463
467
  /**
464
468
  * Generate video using JiMeng API
465
469
  * @see /api/jimeng/video
@@ -478,7 +482,7 @@ declare class VideoAPI {
478
482
  attachment?: JiMengVideoParams['attachment'];
479
483
  prompt?: string | TextFieldItem[];
480
484
  aspect_ratio: LabelFieldItem | string;
481
- }): Promise<APIResponse<AttachmentResult[]>>;
485
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
482
486
  /**
483
487
  * Generate video using Doubao API
484
488
  * @see /api/doubao/video
@@ -499,7 +503,7 @@ declare class VideoAPI {
499
503
  resolution: LabelFieldItem | string;
500
504
  ratio: LabelFieldItem | string;
501
505
  duration?: LabelFieldItem | string;
502
- }): Promise<APIResponse<AttachmentResult[]>>;
506
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
503
507
  /**
504
508
  * Generate video using Wan API (Alibaba)
505
509
  * @see /api/wan/video
@@ -521,7 +525,7 @@ declare class VideoAPI {
521
525
  duration?: LabelFieldItem | string;
522
526
  model?: LabelFieldItem | string;
523
527
  shot_type?: LabelFieldItem | string;
524
- }): Promise<APIResponse<AttachmentResult[]>>;
528
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
525
529
  /**
526
530
  * Generate video using MiniMax API
527
531
  * @see /api/minimax/video
@@ -541,7 +545,7 @@ declare class VideoAPI {
541
545
  size?: LabelFieldItem | string;
542
546
  duration?: LabelFieldItem | string;
543
547
  model?: LabelFieldItem | string;
544
- }): Promise<APIResponse<AttachmentResult[]>>;
548
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
545
549
  }
546
550
 
547
551
  /**
@@ -566,69 +570,70 @@ declare class DocumentAPI {
566
570
  * source_language: { value: 'en', label: 'English' },
567
571
  * target_language: { value: 'zh', label: 'Chinese' }
568
572
  * });
573
+ * console.log('Task folder:', result.taskFolder);
569
574
  * ```
570
575
  */
571
576
  translate(params: {
572
577
  attachment: DocTranslateParams['attachment'];
573
578
  source_language: LabelFieldItem | string;
574
579
  target_language: LabelFieldItem | string;
575
- }): Promise<APIResponse<AttachmentResult[]>>;
580
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
576
581
  /**
577
582
  * Convert image to Word document
578
583
  * @see /api/doc_convert/image2word
579
584
  */
580
585
  image2Word(params: {
581
586
  attachment: DocConvertParams['attachment'];
582
- }): Promise<APIResponse<AttachmentResult[]>>;
587
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
583
588
  /**
584
589
  * Convert image to PowerPoint
585
590
  * @see /api/doc_convert/image2ppt
586
591
  */
587
592
  image2Ppt(params: {
588
593
  attachment: DocConvertParams['attachment'];
589
- }): Promise<APIResponse<AttachmentResult[]>>;
594
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
590
595
  /**
591
596
  * Convert image to Excel
592
597
  * @see /api/doc_convert/image2excel
593
598
  */
594
599
  image2Excel(params: {
595
600
  attachment: DocConvertParams['attachment'];
596
- }): Promise<APIResponse<AttachmentResult[]>>;
601
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
597
602
  /**
598
603
  * Convert image to PDF
599
604
  * @see /api/doc_convert/image2pdf
600
605
  */
601
606
  image2Pdf(params: {
602
607
  attachment: DocConvertParams['attachment'];
603
- }): Promise<APIResponse<AttachmentResult[]>>;
608
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
604
609
  /**
605
610
  * Convert PDF to Word document
606
611
  * @see /api/doc_convert/pdf2word
607
612
  */
608
613
  pdf2Word(params: {
609
614
  attachment: DocConvertParams['attachment'];
610
- }): Promise<APIResponse<AttachmentResult[]>>;
615
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
611
616
  /**
612
617
  * Convert PDF to PowerPoint
613
618
  * @see /api/doc_convert/pdf2ppt
614
619
  */
615
620
  pdf2Ppt(params: {
616
621
  attachment: DocConvertParams['attachment'];
617
- }): Promise<APIResponse<AttachmentResult[]>>;
622
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
618
623
  /**
619
624
  * Convert PDF to Excel
620
625
  * @see /api/doc_convert/pdf2excel
621
626
  */
622
627
  pdf2Excel(params: {
623
628
  attachment: DocConvertParams['attachment'];
624
- }): Promise<APIResponse<AttachmentResult[]>>;
629
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
625
630
  /**
626
631
  * Convert PDF to image
627
632
  * @see /api/doc_convert/pdf2image
628
633
  */
629
634
  pdf2Image(params: {
630
635
  attachment: DocConvertParams['attachment'];
631
- }): Promise<APIResponse<AttachmentResult[]>>;
636
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
632
637
  /**
633
638
  * Generic document conversion
634
639
  * @see /api/doc_convert/image
@@ -638,7 +643,7 @@ declare class DocumentAPI {
638
643
  attachment: DocConvertParams['attachment'];
639
644
  input_format?: string;
640
645
  output_format: string;
641
- }): Promise<APIResponse<AttachmentResult[]>>;
646
+ }): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
642
647
  }
643
648
 
644
649
  /**
@@ -667,9 +672,12 @@ declare class MediaAPI {
667
672
  * const result = await client.media.analyze({
668
673
  * url: [{ tmp_url: 'https://...', type: 'video/mp4', name: 'video.mp4' }]
669
674
  * });
675
+ *
676
+ * console.log('Task folder:', result.taskFolder);
677
+ * console.log('Summary:', result.response.data?.summary);
670
678
  * ```
671
679
  */
672
- analyze(params: MediaAnalysisParams): Promise<APIResponse<MediaAnalysisResult>>;
680
+ analyze(params: MediaAnalysisParams): Promise<TaskResult<APIResponse<MediaAnalysisResult>>>;
673
681
  /**
674
682
  * Analyze video file directly
675
683
  * @see /api/video_analysis (internal)
@@ -690,7 +698,7 @@ declare class MediaAPI {
690
698
  size?: number;
691
699
  };
692
700
  prompt?: string;
693
- }): Promise<APIResponse<MediaAnalysisResult>>;
701
+ }): Promise<TaskResult<APIResponse<MediaAnalysisResult>>>;
694
702
  /**
695
703
  * Analyze social media video (TikTok, YouTube, etc.)
696
704
  * @see /api/media_analysis
@@ -704,7 +712,7 @@ declare class MediaAPI {
704
712
  */
705
713
  analyzeSocialVideo(params: {
706
714
  url: string;
707
- }): Promise<APIResponse<MediaAnalysisResult>>;
715
+ }): Promise<TaskResult<APIResponse<MediaAnalysisResult>>>;
708
716
  }
709
717
 
710
718
  /**
@@ -763,37 +771,37 @@ declare class UnityClawClient {
763
771
  * Generate image using Gemini API
764
772
  * @deprecated Use client.image.gemini() instead
765
773
  */
766
- generateImage(params: GeminiImageParams): Promise<APIResponse<AttachmentResult[]>>;
774
+ generateImage(params: GeminiImageParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
767
775
  /**
768
776
  * Generate image using JiMeng API
769
777
  * @deprecated Use client.image.jimeng() instead
770
778
  */
771
- generateJiMengImage(params: JiMengImageParams): Promise<APIResponse<AttachmentResult[]>>;
779
+ generateJiMengImage(params: JiMengImageParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
772
780
  /**
773
781
  * Generate video using Sora API
774
782
  * @deprecated Use client.video.sora() instead
775
783
  */
776
- generateSoraVideo(params: SoraVideoParams): Promise<APIResponse<AttachmentResult[]>>;
784
+ generateSoraVideo(params: SoraVideoParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
777
785
  /**
778
786
  * Generate video using Veo API
779
787
  * @deprecated Use client.video.veo() instead
780
788
  */
781
- generateVeoVideo(params: VeoVideoParams): Promise<APIResponse<AttachmentResult[]>>;
789
+ generateVeoVideo(params: VeoVideoParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
782
790
  /**
783
791
  * Generate video using Kling API
784
792
  * @deprecated Use client.video.kling() instead
785
793
  */
786
- generateKlingVideo(params: KlingVideoParams): Promise<APIResponse<AttachmentResult[]>>;
794
+ generateKlingVideo(params: KlingVideoParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
787
795
  /**
788
796
  * Translate document
789
797
  * @deprecated Use client.document.translate() instead
790
798
  */
791
- translateDocument(params: DocTranslateParams): Promise<APIResponse<AttachmentResult[]>>;
799
+ translateDocument(params: DocTranslateParams): Promise<TaskResult<APIResponse<AttachmentResult[]>>>;
792
800
  /**
793
801
  * Analyze media (video/audio from URL)
794
802
  * @deprecated Use client.media.analyze() instead
795
803
  */
796
- analyzeMedia(params: MediaAnalysisParams): Promise<APIResponse<MediaAnalysisResult>>;
804
+ analyzeMedia(params: MediaAnalysisParams): Promise<TaskResult<APIResponse<MediaAnalysisResult>>>;
797
805
  }
798
806
 
799
807
  export { type APIResponse, type AttachmentFieldItem, type AttachmentResult, type BitableContext, type Context, type DeepPartial, type DocConvertParams, type DocTranslateParams, DocumentAPI, type DoubaoVideoParams, type GeminiImageParams, ImageAPI, type ImageGenParams, type JiMengImageParams, type JiMengVideoParams, type KlingVideoParams, type LabelFieldItem, type LabelValue, MediaAPI, type MediaAnalysisParams, type MediaAnalysisResult, type MiniMaxVideoParams, type OpenClawShortcutParams, type SDKContext, type SoraVideoParams, type TaskFolderContext, TaskFolderManager, type TaskFolderOptions, type TaskLog, type TaskResult, type TextFieldItem, type TextInput, UnityClawClient, type UnityClawClientConfig, type UrlFieldItem, type VeoVideoParams, VideoAPI, type WanVideoParams };