@unityclaw/sdk 1.0.1 → 1.0.3

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.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,64 @@ 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>>>;
805
+ }
806
+
807
+ /**
808
+ * UnityClaw SDK Config Management
809
+ * Shared configuration for SDK and CLI tools
810
+ */
811
+ /** Config directory */
812
+ declare const CONFIG_DIR: string;
813
+ /** Config file path */
814
+ declare const CONFIG_FILE: string;
815
+ /** Default tasks directory */
816
+ declare const DEFAULT_TASKS_DIR: string;
817
+ /** UnityClaw configuration */
818
+ interface UnityClawConfig {
819
+ apiKey?: string;
820
+ baseUrl?: string;
821
+ taskDir?: string;
797
822
  }
823
+ /** Get config file path */
824
+ declare function getConfigPath(): string;
825
+ /** Load config from ~/.unityclaw/config.json */
826
+ declare function loadConfig(): UnityClawConfig;
827
+ /** Save config to file */
828
+ declare function saveConfig(config: UnityClawConfig): void;
829
+ /** Set a config value */
830
+ declare function setConfigValue(key: string, value: string): void;
831
+ /** Get a config value */
832
+ declare function getConfigValue(key: string): string | undefined;
798
833
 
799
- 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 };
834
+ export { type APIResponse, type AttachmentFieldItem, type AttachmentResult, type BitableContext, CONFIG_DIR, CONFIG_FILE, type Context, DEFAULT_TASKS_DIR, 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 UnityClawConfig, type UrlFieldItem, type VeoVideoParams, VideoAPI, type WanVideoParams, getConfigPath, getConfigValue, loadConfig, saveConfig, setConfigValue };
package/dist/index.d.ts 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,64 @@ 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>>>;
805
+ }
806
+
807
+ /**
808
+ * UnityClaw SDK Config Management
809
+ * Shared configuration for SDK and CLI tools
810
+ */
811
+ /** Config directory */
812
+ declare const CONFIG_DIR: string;
813
+ /** Config file path */
814
+ declare const CONFIG_FILE: string;
815
+ /** Default tasks directory */
816
+ declare const DEFAULT_TASKS_DIR: string;
817
+ /** UnityClaw configuration */
818
+ interface UnityClawConfig {
819
+ apiKey?: string;
820
+ baseUrl?: string;
821
+ taskDir?: string;
797
822
  }
823
+ /** Get config file path */
824
+ declare function getConfigPath(): string;
825
+ /** Load config from ~/.unityclaw/config.json */
826
+ declare function loadConfig(): UnityClawConfig;
827
+ /** Save config to file */
828
+ declare function saveConfig(config: UnityClawConfig): void;
829
+ /** Set a config value */
830
+ declare function setConfigValue(key: string, value: string): void;
831
+ /** Get a config value */
832
+ declare function getConfigValue(key: string): string | undefined;
798
833
 
799
- 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 };
834
+ export { type APIResponse, type AttachmentFieldItem, type AttachmentResult, type BitableContext, CONFIG_DIR, CONFIG_FILE, type Context, DEFAULT_TASKS_DIR, 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 UnityClawConfig, type UrlFieldItem, type VeoVideoParams, VideoAPI, type WanVideoParams, getConfigPath, getConfigValue, loadConfig, saveConfig, setConfigValue };