@opencode/ai 2.0.32 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/ai-client.d.ts +2 -2
  2. package/dist/experimental/evaluation-client.d.ts +1 -1
  3. package/dist/experimental/evaluation.d.ts +20 -20
  4. package/dist/experimental/realtime.d.ts +6 -14
  5. package/dist/experimental/realtime.js +28 -3
  6. package/dist/experimental/system-one.d.ts +1 -1
  7. package/dist/image-client.d.ts +8 -8
  8. package/dist/image.d.ts +593 -437
  9. package/dist/llm.d.ts +51 -51
  10. package/dist/media-client.d.ts +1 -1
  11. package/dist/media.d.ts +4 -4
  12. package/dist/promise.d.ts +199 -198
  13. package/dist/protocols/alibaba-chat.d.ts +81 -82
  14. package/dist/protocols/alibaba-chat.js +0 -1
  15. package/dist/protocols/alibaba-messages.d.ts +99 -99
  16. package/dist/protocols/alibaba-responses.d.ts +120 -120
  17. package/dist/protocols/anthropic-messages.d.ts +187 -187
  18. package/dist/protocols/anthropic-messages.js +3 -2
  19. package/dist/protocols/assemblyai-transcription.d.ts +1 -1
  20. package/dist/protocols/bedrock-converse.d.ts +75 -79
  21. package/dist/protocols/bfl-images.d.ts +1 -1
  22. package/dist/protocols/cartesia-speech.d.ts +17 -17
  23. package/dist/protocols/cohere-chat.d.ts +26 -23
  24. package/dist/protocols/cohere-chat.js +22 -1
  25. package/dist/protocols/deepgram-speech.d.ts +17 -17
  26. package/dist/protocols/deepgram-transcription.d.ts +1 -1
  27. package/dist/protocols/elevenlabs-speech.d.ts +17 -17
  28. package/dist/protocols/elevenlabs-transcription.d.ts +1 -1
  29. package/dist/protocols/fal-images.d.ts +1 -1
  30. package/dist/protocols/fal-video.d.ts +1 -1
  31. package/dist/protocols/gemini.d.ts +55 -55
  32. package/dist/protocols/google-images.d.ts +1 -1
  33. package/dist/protocols/google-interactions.d.ts +64 -62
  34. package/dist/protocols/google-interactions.js +19 -1
  35. package/dist/protocols/google-speech.d.ts +17 -17
  36. package/dist/protocols/google-transcription.d.ts +47 -47
  37. package/dist/protocols/google-video.d.ts +1 -1
  38. package/dist/protocols/meta-messages.d.ts +121 -121
  39. package/dist/protocols/meta-responses.d.ts +201 -201
  40. package/dist/protocols/mistral-chat.d.ts +45 -45
  41. package/dist/protocols/open-responses-channel.d.ts +1 -1
  42. package/dist/protocols/open-responses.d.ts +584 -450
  43. package/dist/protocols/open-responses.js +27 -35
  44. package/dist/protocols/openai-chat.d.ts +248 -248
  45. package/dist/protocols/openai-chat.js +11 -42
  46. package/dist/protocols/openai-compatible-chat.d.ts +32 -32
  47. package/dist/protocols/openai-compatible-responses.d.ts +88 -88
  48. package/dist/protocols/openai-images.d.ts +17 -17
  49. package/dist/protocols/openai-responses.d.ts +567 -567
  50. package/dist/protocols/openai-responses.js +1 -1
  51. package/dist/protocols/openai-speech.d.ts +17 -17
  52. package/dist/protocols/openai-transcription.d.ts +47 -47
  53. package/dist/protocols/replicate-images.d.ts +1 -1
  54. package/dist/protocols/runway-video.d.ts +1 -1
  55. package/dist/protocols/shared.d.ts +12 -1
  56. package/dist/protocols/shared.js +17 -1
  57. package/dist/protocols/stability-images.d.ts +2 -2
  58. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  59. package/dist/protocols/utils/bedrock-media.d.ts +4 -4
  60. package/dist/protocols/utils/openai-options.d.ts +1 -1
  61. package/dist/protocols/utils/speech-stream.d.ts +1 -1
  62. package/dist/protocols/utils/tool-schema.d.ts +10 -5
  63. package/dist/protocols/utils/tool-stream.d.ts +152 -152
  64. package/dist/protocols/venice-chat.d.ts +109 -110
  65. package/dist/protocols/venice-chat.js +0 -1
  66. package/dist/protocols/xai-images.d.ts +1 -1
  67. package/dist/protocols/xai-responses.d.ts +79 -79
  68. package/dist/protocols/xai-video.d.ts +1 -1
  69. package/dist/protocols/zai-chat.d.ts +77 -78
  70. package/dist/protocols/zai-chat.js +0 -1
  71. package/dist/protocols/zai-images.d.ts +1 -1
  72. package/dist/protocols/zai-messages.d.ts +97 -97
  73. package/dist/providers/alibaba.d.ts +222 -283
  74. package/dist/providers/amazon-bedrock-mantle.d.ts +291 -298
  75. package/dist/providers/amazon-bedrock.d.ts +22 -28
  76. package/dist/providers/anthropic-compatible.d.ts +86 -90
  77. package/dist/providers/anthropic.d.ts +86 -90
  78. package/dist/providers/assemblyai.d.ts +2 -6
  79. package/dist/providers/azure.d.ts +228 -238
  80. package/dist/providers/baseten.d.ts +66 -70
  81. package/dist/providers/black-forest-labs.d.ts +2 -6
  82. package/dist/providers/cartesia.d.ts +2 -6
  83. package/dist/providers/cerebras.d.ts +66 -70
  84. package/dist/providers/cerebras.js +0 -1
  85. package/dist/providers/cloudflare-ai-gateway.d.ts +352 -356
  86. package/dist/providers/cloudflare-workers-ai.d.ts +66 -70
  87. package/dist/providers/cohere.d.ts +122 -132
  88. package/dist/providers/cohere.js +0 -2
  89. package/dist/providers/deepgram.d.ts +2 -7
  90. package/dist/providers/deepinfra.d.ts +66 -70
  91. package/dist/providers/deepinfra.js +0 -1
  92. package/dist/providers/deepseek.d.ts +66 -70
  93. package/dist/providers/deepseek.js +1 -1
  94. package/dist/providers/digitalocean.d.ts +137 -141
  95. package/dist/providers/elevenlabs.d.ts +2 -7
  96. package/dist/providers/fal.d.ts +2 -7
  97. package/dist/providers/fireworks.d.ts +66 -70
  98. package/dist/providers/google-vertex-chat.d.ts +34 -38
  99. package/dist/providers/google-vertex-interactions.d.ts +31 -41
  100. package/dist/providers/google-vertex-messages.d.ts +81 -85
  101. package/dist/providers/google-vertex-mistral.d.ts +23 -27
  102. package/dist/providers/google-vertex-responses.d.ts +90 -94
  103. package/dist/providers/google-vertex.d.ts +26 -30
  104. package/dist/providers/google.d.ts +94 -109
  105. package/dist/providers/groq.d.ts +111 -115
  106. package/dist/providers/groq.js +0 -1
  107. package/dist/providers/meta.d.ts +309 -317
  108. package/dist/providers/meta.js +1 -1
  109. package/dist/providers/minimax.d.ts +296 -303
  110. package/dist/providers/minimax.js +1 -1
  111. package/dist/providers/mistral.d.ts +22 -26
  112. package/dist/providers/moonshot.d.ts +296 -303
  113. package/dist/providers/moonshot.js +0 -1
  114. package/dist/providers/openai-compatible-responses.d.ts +90 -94
  115. package/dist/providers/openai-compatible.d.ts +34 -38
  116. package/dist/providers/openai.d.ts +93 -108
  117. package/dist/providers/opencode.d.ts +2 -8
  118. package/dist/providers/openrouter.d.ts +137 -144
  119. package/dist/providers/replicate.d.ts +2 -6
  120. package/dist/providers/runway.d.ts +2 -6
  121. package/dist/providers/stability.d.ts +2 -7
  122. package/dist/providers/togetherai.d.ts +66 -70
  123. package/dist/providers/togetherai.js +1 -1
  124. package/dist/providers/typesafe-ai.d.ts +2 -8
  125. package/dist/providers/venice.d.ts +58 -63
  126. package/dist/providers/vercel-ai-gateway.d.ts +2 -12
  127. package/dist/providers/xai.d.ts +38 -50
  128. package/dist/providers/zai-coding-plan.d.ts +206 -213
  129. package/dist/providers/zai.d.ts +40 -46
  130. package/dist/route/client.d.ts +51 -51
  131. package/dist/route/media-protocol.d.ts +1 -1
  132. package/dist/route/transport/http.d.ts +1 -1
  133. package/dist/route/transport/websocket.d.ts +8 -8
  134. package/dist/schema/errors.d.ts +19 -19
  135. package/dist/schema/events.d.ts +3090 -3288
  136. package/dist/schema/messages.d.ts +8 -7
  137. package/dist/schema/options.d.ts +2 -1
  138. package/dist/schema/options.js +2 -1
  139. package/dist/speech-client.d.ts +8 -8
  140. package/dist/speech.d.ts +434 -398
  141. package/dist/testing.d.ts +338 -338
  142. package/dist/tool-runtime.d.ts +1 -1
  143. package/dist/transcription-client.d.ts +23 -23
  144. package/dist/transcription.d.ts +562 -646
  145. package/dist/utils/sanitize.d.ts +4 -0
  146. package/dist/utils/sanitize.js +23 -6
  147. package/dist/video-client.d.ts +8 -8
  148. package/dist/video.d.ts +416 -372
  149. package/package.json +6 -6
package/dist/video.d.ts CHANGED
@@ -506,16 +506,44 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
506
506
  }>]> & {
507
507
  readonly discriminants: readonly ["generation-queued", "generation-progress", "video", "finish"];
508
508
  readonly cases: {
509
- "generation-queued": Schema.Struct<{
510
- readonly type: Schema.tag<"generation-queued">;
511
- readonly id: Schema.String;
512
- readonly position: Schema.optional<Schema.Number>;
509
+ finish: Schema.Struct<{
510
+ readonly type: Schema.tag<"finish">;
511
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
512
+ readonly type: Schema.Literal<"tokens">;
513
+ readonly input: Schema.optional<Schema.Number>;
514
+ readonly output: Schema.optional<Schema.Number>;
515
+ readonly total: Schema.optional<Schema.Number>;
516
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
517
+ }>, Schema.Struct<{
518
+ readonly type: Schema.Literal<"seconds">;
519
+ readonly seconds: Schema.Number;
520
+ }>, Schema.Struct<{
521
+ readonly type: Schema.Literal<"characters">;
522
+ readonly characters: Schema.Number;
523
+ }>, Schema.Struct<{
524
+ readonly type: Schema.Literal<"credits">;
525
+ readonly credits: Schema.Number;
526
+ }>, Schema.Struct<{
527
+ readonly type: Schema.Literal<"compute">;
528
+ readonly seconds: Schema.Number;
529
+ }>]>>;
530
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
531
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
532
+ readonly message: Schema.String;
533
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
534
+ }>>>;
535
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
513
536
  }>;
514
537
  "generation-progress": Schema.Struct<{
515
538
  readonly type: Schema.tag<"generation-progress">;
516
539
  readonly id: Schema.String;
517
540
  readonly progress: Schema.optional<Schema.Number>;
518
541
  }>;
542
+ "generation-queued": Schema.Struct<{
543
+ readonly type: Schema.tag<"generation-queued">;
544
+ readonly id: Schema.String;
545
+ readonly position: Schema.optional<Schema.Number>;
546
+ }>;
519
547
  video: Schema.Struct<{
520
548
  readonly type: Schema.tag<"video">;
521
549
  readonly index: Schema.Number;
@@ -551,42 +579,14 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
551
579
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
552
580
  }>, never, never>;
553
581
  }>;
554
- finish: Schema.Struct<{
555
- readonly type: Schema.tag<"finish">;
556
- readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
557
- readonly type: Schema.Literal<"tokens">;
558
- readonly input: Schema.optional<Schema.Number>;
559
- readonly output: Schema.optional<Schema.Number>;
560
- readonly total: Schema.optional<Schema.Number>;
561
- readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
562
- }>, Schema.Struct<{
563
- readonly type: Schema.Literal<"seconds">;
564
- readonly seconds: Schema.Number;
565
- }>, Schema.Struct<{
566
- readonly type: Schema.Literal<"characters">;
567
- readonly characters: Schema.Number;
568
- }>, Schema.Struct<{
569
- readonly type: Schema.Literal<"credits">;
570
- readonly credits: Schema.Number;
571
- }>, Schema.Struct<{
572
- readonly type: Schema.Literal<"compute">;
573
- readonly seconds: Schema.Number;
574
- }>]>>;
575
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
576
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
577
- readonly message: Schema.String;
578
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
579
- }>>>;
580
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
581
- }>;
582
582
  };
583
583
  readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
584
- readonly id: string;
585
584
  readonly type: "generation-queued";
585
+ readonly id: string;
586
586
  readonly position?: number | undefined;
587
587
  } | {
588
- readonly id: string;
589
588
  readonly type: "generation-progress";
589
+ readonly id: string;
590
590
  readonly progress?: number | undefined;
591
591
  } | {
592
592
  readonly type: "video";
@@ -594,11 +594,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
594
594
  readonly video: Media.Asset;
595
595
  } | {
596
596
  readonly type: "finish";
597
- readonly providerMetadata?: {
598
- readonly [x: string]: {
599
- readonly [x: string]: unknown;
600
- };
601
- } | undefined;
602
597
  readonly usage?: {
603
598
  readonly type: "tokens";
604
599
  readonly input?: number | undefined;
@@ -621,7 +616,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
621
616
  readonly seconds: number;
622
617
  } | undefined;
623
618
  readonly notices?: readonly {
624
- readonly type: "other" | "moderated" | "filtered";
619
+ readonly type: "filtered" | "moderated" | "other";
625
620
  readonly message: string;
626
621
  readonly providerMetadata?: {
627
622
  readonly [x: string]: {
@@ -629,15 +624,20 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
629
624
  };
630
625
  } | undefined;
631
626
  }[] | undefined;
627
+ readonly providerMetadata?: {
628
+ readonly [x: string]: {
629
+ readonly [x: string]: unknown;
630
+ };
631
+ } | undefined;
632
632
  }) => value is Extract<{
633
- readonly id: string;
634
633
  readonly type: "generation-queued";
634
+ readonly id: string;
635
635
  readonly position?: number | undefined;
636
636
  }, {
637
637
  readonly type: Keys;
638
638
  }> | Extract<{
639
- readonly id: string;
640
639
  readonly type: "generation-progress";
640
+ readonly id: string;
641
641
  readonly progress?: number | undefined;
642
642
  }, {
643
643
  readonly type: Keys;
@@ -649,11 +649,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
649
649
  readonly type: Keys;
650
650
  }> | Extract<{
651
651
  readonly type: "finish";
652
- readonly providerMetadata?: {
653
- readonly [x: string]: {
654
- readonly [x: string]: unknown;
655
- };
656
- } | undefined;
657
652
  readonly usage?: {
658
653
  readonly type: "tokens";
659
654
  readonly input?: number | undefined;
@@ -676,7 +671,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
676
671
  readonly seconds: number;
677
672
  } | undefined;
678
673
  readonly notices?: readonly {
679
- readonly type: "other" | "moderated" | "filtered";
674
+ readonly type: "filtered" | "moderated" | "other";
680
675
  readonly message: string;
681
676
  readonly providerMetadata?: {
682
677
  readonly [x: string]: {
@@ -684,32 +679,17 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
684
679
  };
685
680
  } | undefined;
686
681
  }[] | undefined;
682
+ readonly providerMetadata?: {
683
+ readonly [x: string]: {
684
+ readonly [x: string]: unknown;
685
+ };
686
+ } | undefined;
687
687
  }, {
688
688
  readonly type: Keys;
689
689
  }>;
690
690
  readonly guards: {
691
- "generation-queued": (u: unknown) => u is {
692
- readonly id: string;
693
- readonly type: "generation-queued";
694
- readonly position?: number | undefined;
695
- };
696
- "generation-progress": (u: unknown) => u is {
697
- readonly id: string;
698
- readonly type: "generation-progress";
699
- readonly progress?: number | undefined;
700
- };
701
- video: (u: unknown) => u is {
702
- readonly type: "video";
703
- readonly index: number;
704
- readonly video: Media.Asset;
705
- };
706
691
  finish: (u: unknown) => u is {
707
692
  readonly type: "finish";
708
- readonly providerMetadata?: {
709
- readonly [x: string]: {
710
- readonly [x: string]: unknown;
711
- };
712
- } | undefined;
713
693
  readonly usage?: {
714
694
  readonly type: "tokens";
715
695
  readonly input?: number | undefined;
@@ -732,7 +712,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
732
712
  readonly seconds: number;
733
713
  } | undefined;
734
714
  readonly notices?: readonly {
735
- readonly type: "other" | "moderated" | "filtered";
715
+ readonly type: "filtered" | "moderated" | "other";
736
716
  readonly message: string;
737
717
  readonly providerMetadata?: {
738
718
  readonly [x: string]: {
@@ -740,70 +720,105 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
740
720
  };
741
721
  } | undefined;
742
722
  }[] | undefined;
723
+ readonly providerMetadata?: {
724
+ readonly [x: string]: {
725
+ readonly [x: string]: unknown;
726
+ };
727
+ } | undefined;
728
+ };
729
+ "generation-progress": (u: unknown) => u is {
730
+ readonly type: "generation-progress";
731
+ readonly id: string;
732
+ readonly progress?: number | undefined;
733
+ };
734
+ "generation-queued": (u: unknown) => u is {
735
+ readonly type: "generation-queued";
736
+ readonly id: string;
737
+ readonly position?: number | undefined;
738
+ };
739
+ video: (u: unknown) => u is {
740
+ readonly type: "video";
741
+ readonly index: number;
742
+ readonly video: Media.Asset;
743
743
  };
744
744
  };
745
745
  readonly match: {
746
- <Cases extends {
747
- "generation-queued": (value: {
748
- readonly id: string;
749
- readonly type: "generation-queued";
750
- readonly position?: number | undefined;
751
- }) => any;
752
- "generation-progress": (value: {
753
- readonly id: string;
754
- readonly type: "generation-progress";
755
- readonly progress?: number | undefined;
756
- }) => any;
757
- video: (value: {
758
- readonly type: "video";
759
- readonly index: number;
760
- readonly video: Media.Asset;
761
- }) => any;
762
- finish: (value: {
763
- readonly type: "finish";
764
- readonly providerMetadata?: {
765
- readonly [x: string]: {
766
- readonly [x: string]: unknown;
767
- };
768
- } | undefined;
769
- readonly usage?: {
770
- readonly type: "tokens";
771
- readonly input?: number | undefined;
772
- readonly output?: number | undefined;
773
- readonly total?: number | undefined;
774
- readonly details?: {
775
- readonly [x: string]: unknown;
776
- } | undefined;
777
- } | {
778
- readonly type: "seconds";
779
- readonly seconds: number;
780
- } | {
781
- readonly type: "characters";
782
- readonly characters: number;
783
- } | {
784
- readonly type: "credits";
785
- readonly credits: number;
786
- } | {
787
- readonly type: "compute";
788
- readonly seconds: number;
789
- } | undefined;
790
- readonly notices?: readonly {
791
- readonly type: "other" | "moderated" | "filtered";
792
- readonly message: string;
793
- readonly providerMetadata?: {
794
- readonly [x: string]: {
795
- readonly [x: string]: unknown;
796
- };
797
- } | undefined;
798
- }[] | undefined;
799
- }) => any;
800
- }>(value: {
801
- readonly id: string;
746
+ <Cases extends { [M in Schema.Struct<{
747
+ readonly type: Schema.tag<"generation-queued">;
748
+ readonly id: Schema.String;
749
+ readonly position: Schema.optional<Schema.Number>;
750
+ }> | Schema.Struct<{
751
+ readonly type: Schema.tag<"generation-progress">;
752
+ readonly id: Schema.String;
753
+ readonly progress: Schema.optional<Schema.Number>;
754
+ }> | Schema.Struct<{
755
+ readonly type: Schema.tag<"video">;
756
+ readonly index: Schema.Number;
757
+ readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
758
+ readonly source: Schema.Union<readonly [Schema.Struct<{
759
+ readonly type: Schema.Literal<"bytes">;
760
+ readonly data: Schema.Uint8Array;
761
+ readonly mediaType: Schema.String;
762
+ }>, Schema.Struct<{
763
+ readonly type: Schema.Literal<"base64">;
764
+ readonly data: Schema.String;
765
+ readonly mediaType: Schema.String;
766
+ }>, Schema.Struct<{
767
+ readonly type: Schema.Literal<"url">;
768
+ readonly url: Schema.String;
769
+ readonly mediaType: Schema.optional<Schema.String>;
770
+ readonly expiresAt: Schema.optional<Schema.Number>;
771
+ }>, Schema.Struct<{
772
+ readonly type: Schema.Literal<"ref">;
773
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
774
+ readonly id: Schema.String;
775
+ readonly mediaType: Schema.optional<Schema.String>;
776
+ }>]>;
777
+ readonly info: Schema.optional<Schema.Struct<{
778
+ readonly width: Schema.optional<Schema.Number>;
779
+ readonly height: Schema.optional<Schema.Number>;
780
+ readonly durationSeconds: Schema.optional<Schema.Number>;
781
+ readonly sampleRate: Schema.optional<Schema.Number>;
782
+ readonly channels: Schema.optional<Schema.Number>;
783
+ readonly encoding: Schema.optional<Schema.String>;
784
+ readonly format: Schema.optional<Schema.String>;
785
+ }>>;
786
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
787
+ }>, never, never>;
788
+ }> | Schema.Struct<{
789
+ readonly type: Schema.tag<"finish">;
790
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
791
+ readonly type: Schema.Literal<"tokens">;
792
+ readonly input: Schema.optional<Schema.Number>;
793
+ readonly output: Schema.optional<Schema.Number>;
794
+ readonly total: Schema.optional<Schema.Number>;
795
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
796
+ }>, Schema.Struct<{
797
+ readonly type: Schema.Literal<"seconds">;
798
+ readonly seconds: Schema.Number;
799
+ }>, Schema.Struct<{
800
+ readonly type: Schema.Literal<"characters">;
801
+ readonly characters: Schema.Number;
802
+ }>, Schema.Struct<{
803
+ readonly type: Schema.Literal<"credits">;
804
+ readonly credits: Schema.Number;
805
+ }>, Schema.Struct<{
806
+ readonly type: Schema.Literal<"compute">;
807
+ readonly seconds: Schema.Number;
808
+ }>]>>;
809
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
810
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
811
+ readonly message: Schema.String;
812
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
813
+ }>>>;
814
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
815
+ }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
802
816
  readonly type: "generation-queued";
817
+ readonly id: string;
803
818
  readonly position?: number | undefined;
804
819
  } | {
805
- readonly id: string;
806
820
  readonly type: "generation-progress";
821
+ readonly id: string;
807
822
  readonly progress?: number | undefined;
808
823
  } | {
809
824
  readonly type: "video";
@@ -811,11 +826,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
811
826
  readonly video: Media.Asset;
812
827
  } | {
813
828
  readonly type: "finish";
814
- readonly providerMetadata?: {
815
- readonly [x: string]: {
816
- readonly [x: string]: unknown;
817
- };
818
- } | undefined;
819
829
  readonly usage?: {
820
830
  readonly type: "tokens";
821
831
  readonly input?: number | undefined;
@@ -838,7 +848,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
838
848
  readonly seconds: number;
839
849
  } | undefined;
840
850
  readonly notices?: readonly {
841
- readonly type: "other" | "moderated" | "filtered";
851
+ readonly type: "filtered" | "moderated" | "other";
842
852
  readonly message: string;
843
853
  readonly providerMetadata?: {
844
854
  readonly [x: string]: {
@@ -846,68 +856,88 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
846
856
  };
847
857
  } | undefined;
848
858
  }[] | undefined;
859
+ readonly providerMetadata?: {
860
+ readonly [x: string]: {
861
+ readonly [x: string]: unknown;
862
+ };
863
+ } | undefined;
849
864
  }, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
850
- <Cases extends {
851
- "generation-queued": (value: {
852
- readonly id: string;
853
- readonly type: "generation-queued";
854
- readonly position?: number | undefined;
855
- }) => any;
856
- "generation-progress": (value: {
857
- readonly id: string;
858
- readonly type: "generation-progress";
859
- readonly progress?: number | undefined;
860
- }) => any;
861
- video: (value: {
862
- readonly type: "video";
863
- readonly index: number;
864
- readonly video: Media.Asset;
865
- }) => any;
866
- finish: (value: {
867
- readonly type: "finish";
868
- readonly providerMetadata?: {
869
- readonly [x: string]: {
870
- readonly [x: string]: unknown;
871
- };
872
- } | undefined;
873
- readonly usage?: {
874
- readonly type: "tokens";
875
- readonly input?: number | undefined;
876
- readonly output?: number | undefined;
877
- readonly total?: number | undefined;
878
- readonly details?: {
879
- readonly [x: string]: unknown;
880
- } | undefined;
881
- } | {
882
- readonly type: "seconds";
883
- readonly seconds: number;
884
- } | {
885
- readonly type: "characters";
886
- readonly characters: number;
887
- } | {
888
- readonly type: "credits";
889
- readonly credits: number;
890
- } | {
891
- readonly type: "compute";
892
- readonly seconds: number;
893
- } | undefined;
894
- readonly notices?: readonly {
895
- readonly type: "other" | "moderated" | "filtered";
896
- readonly message: string;
897
- readonly providerMetadata?: {
898
- readonly [x: string]: {
899
- readonly [x: string]: unknown;
900
- };
901
- } | undefined;
902
- }[] | undefined;
903
- }) => any;
904
- }>(cases: Cases): (value: {
905
- readonly id: string;
865
+ <Cases extends { [M in Schema.Struct<{
866
+ readonly type: Schema.tag<"generation-queued">;
867
+ readonly id: Schema.String;
868
+ readonly position: Schema.optional<Schema.Number>;
869
+ }> | Schema.Struct<{
870
+ readonly type: Schema.tag<"generation-progress">;
871
+ readonly id: Schema.String;
872
+ readonly progress: Schema.optional<Schema.Number>;
873
+ }> | Schema.Struct<{
874
+ readonly type: Schema.tag<"video">;
875
+ readonly index: Schema.Number;
876
+ readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
877
+ readonly source: Schema.Union<readonly [Schema.Struct<{
878
+ readonly type: Schema.Literal<"bytes">;
879
+ readonly data: Schema.Uint8Array;
880
+ readonly mediaType: Schema.String;
881
+ }>, Schema.Struct<{
882
+ readonly type: Schema.Literal<"base64">;
883
+ readonly data: Schema.String;
884
+ readonly mediaType: Schema.String;
885
+ }>, Schema.Struct<{
886
+ readonly type: Schema.Literal<"url">;
887
+ readonly url: Schema.String;
888
+ readonly mediaType: Schema.optional<Schema.String>;
889
+ readonly expiresAt: Schema.optional<Schema.Number>;
890
+ }>, Schema.Struct<{
891
+ readonly type: Schema.Literal<"ref">;
892
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
893
+ readonly id: Schema.String;
894
+ readonly mediaType: Schema.optional<Schema.String>;
895
+ }>]>;
896
+ readonly info: Schema.optional<Schema.Struct<{
897
+ readonly width: Schema.optional<Schema.Number>;
898
+ readonly height: Schema.optional<Schema.Number>;
899
+ readonly durationSeconds: Schema.optional<Schema.Number>;
900
+ readonly sampleRate: Schema.optional<Schema.Number>;
901
+ readonly channels: Schema.optional<Schema.Number>;
902
+ readonly encoding: Schema.optional<Schema.String>;
903
+ readonly format: Schema.optional<Schema.String>;
904
+ }>>;
905
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
906
+ }>, never, never>;
907
+ }> | Schema.Struct<{
908
+ readonly type: Schema.tag<"finish">;
909
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
910
+ readonly type: Schema.Literal<"tokens">;
911
+ readonly input: Schema.optional<Schema.Number>;
912
+ readonly output: Schema.optional<Schema.Number>;
913
+ readonly total: Schema.optional<Schema.Number>;
914
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
915
+ }>, Schema.Struct<{
916
+ readonly type: Schema.Literal<"seconds">;
917
+ readonly seconds: Schema.Number;
918
+ }>, Schema.Struct<{
919
+ readonly type: Schema.Literal<"characters">;
920
+ readonly characters: Schema.Number;
921
+ }>, Schema.Struct<{
922
+ readonly type: Schema.Literal<"credits">;
923
+ readonly credits: Schema.Number;
924
+ }>, Schema.Struct<{
925
+ readonly type: Schema.Literal<"compute">;
926
+ readonly seconds: Schema.Number;
927
+ }>]>>;
928
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
929
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
930
+ readonly message: Schema.String;
931
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
932
+ }>>>;
933
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
934
+ }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
906
935
  readonly type: "generation-queued";
936
+ readonly id: string;
907
937
  readonly position?: number | undefined;
908
938
  } | {
909
- readonly id: string;
910
939
  readonly type: "generation-progress";
940
+ readonly id: string;
911
941
  readonly progress?: number | undefined;
912
942
  } | {
913
943
  readonly type: "video";
@@ -915,11 +945,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
915
945
  readonly video: Media.Asset;
916
946
  } | {
917
947
  readonly type: "finish";
918
- readonly providerMetadata?: {
919
- readonly [x: string]: {
920
- readonly [x: string]: unknown;
921
- };
922
- } | undefined;
923
948
  readonly usage?: {
924
949
  readonly type: "tokens";
925
950
  readonly input?: number | undefined;
@@ -942,7 +967,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
942
967
  readonly seconds: number;
943
968
  } | undefined;
944
969
  readonly notices?: readonly {
945
- readonly type: "other" | "moderated" | "filtered";
970
+ readonly type: "filtered" | "moderated" | "other";
946
971
  readonly message: string;
947
972
  readonly providerMetadata?: {
948
973
  readonly [x: string]: {
@@ -950,88 +975,97 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
950
975
  };
951
976
  } | undefined;
952
977
  }[] | undefined;
978
+ readonly providerMetadata?: {
979
+ readonly [x: string]: {
980
+ readonly [x: string]: unknown;
981
+ };
982
+ } | undefined;
953
983
  }) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
954
984
  };
955
985
  readonly matchOrElse: {
956
- <Cases extends {
957
- "generation-queued"?: ((value: {
958
- readonly id: string;
959
- readonly type: "generation-queued";
960
- readonly position?: number | undefined;
961
- }) => any) | undefined;
962
- "generation-progress"?: ((value: {
963
- readonly id: string;
964
- readonly type: "generation-progress";
965
- readonly progress?: number | undefined;
966
- }) => any) | undefined;
967
- video?: ((value: {
968
- readonly type: "video";
969
- readonly index: number;
970
- readonly video: Media.Asset;
971
- }) => any) | undefined;
972
- finish?: ((value: {
973
- readonly type: "finish";
974
- readonly providerMetadata?: {
975
- readonly [x: string]: {
976
- readonly [x: string]: unknown;
977
- };
978
- } | undefined;
979
- readonly usage?: {
980
- readonly type: "tokens";
981
- readonly input?: number | undefined;
982
- readonly output?: number | undefined;
983
- readonly total?: number | undefined;
984
- readonly details?: {
985
- readonly [x: string]: unknown;
986
- } | undefined;
987
- } | {
988
- readonly type: "seconds";
989
- readonly seconds: number;
990
- } | {
991
- readonly type: "characters";
992
- readonly characters: number;
993
- } | {
994
- readonly type: "credits";
995
- readonly credits: number;
996
- } | {
997
- readonly type: "compute";
998
- readonly seconds: number;
999
- } | undefined;
1000
- readonly notices?: readonly {
1001
- readonly type: "other" | "moderated" | "filtered";
1002
- readonly message: string;
1003
- readonly providerMetadata?: {
1004
- readonly [x: string]: {
1005
- readonly [x: string]: unknown;
1006
- };
1007
- } | undefined;
1008
- }[] | undefined;
1009
- }) => any) | undefined;
1010
- } & { [K in Exclude<keyof Cases, "finish" | "generation-queued" | "generation-progress" | "video">]: never; }, OrElse extends (value: Exclude<{
1011
- readonly id: string;
986
+ <Cases extends { [M in Schema.Struct<{
987
+ readonly type: Schema.tag<"generation-queued">;
988
+ readonly id: Schema.String;
989
+ readonly position: Schema.optional<Schema.Number>;
990
+ }> | Schema.Struct<{
991
+ readonly type: Schema.tag<"generation-progress">;
992
+ readonly id: Schema.String;
993
+ readonly progress: Schema.optional<Schema.Number>;
994
+ }> | Schema.Struct<{
995
+ readonly type: Schema.tag<"video">;
996
+ readonly index: Schema.Number;
997
+ readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
998
+ readonly source: Schema.Union<readonly [Schema.Struct<{
999
+ readonly type: Schema.Literal<"bytes">;
1000
+ readonly data: Schema.Uint8Array;
1001
+ readonly mediaType: Schema.String;
1002
+ }>, Schema.Struct<{
1003
+ readonly type: Schema.Literal<"base64">;
1004
+ readonly data: Schema.String;
1005
+ readonly mediaType: Schema.String;
1006
+ }>, Schema.Struct<{
1007
+ readonly type: Schema.Literal<"url">;
1008
+ readonly url: Schema.String;
1009
+ readonly mediaType: Schema.optional<Schema.String>;
1010
+ readonly expiresAt: Schema.optional<Schema.Number>;
1011
+ }>, Schema.Struct<{
1012
+ readonly type: Schema.Literal<"ref">;
1013
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
1014
+ readonly id: Schema.String;
1015
+ readonly mediaType: Schema.optional<Schema.String>;
1016
+ }>]>;
1017
+ readonly info: Schema.optional<Schema.Struct<{
1018
+ readonly width: Schema.optional<Schema.Number>;
1019
+ readonly height: Schema.optional<Schema.Number>;
1020
+ readonly durationSeconds: Schema.optional<Schema.Number>;
1021
+ readonly sampleRate: Schema.optional<Schema.Number>;
1022
+ readonly channels: Schema.optional<Schema.Number>;
1023
+ readonly encoding: Schema.optional<Schema.String>;
1024
+ readonly format: Schema.optional<Schema.String>;
1025
+ }>>;
1026
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1027
+ }>, never, never>;
1028
+ }> | Schema.Struct<{
1029
+ readonly type: Schema.tag<"finish">;
1030
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1031
+ readonly type: Schema.Literal<"tokens">;
1032
+ readonly input: Schema.optional<Schema.Number>;
1033
+ readonly output: Schema.optional<Schema.Number>;
1034
+ readonly total: Schema.optional<Schema.Number>;
1035
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1036
+ }>, Schema.Struct<{
1037
+ readonly type: Schema.Literal<"seconds">;
1038
+ readonly seconds: Schema.Number;
1039
+ }>, Schema.Struct<{
1040
+ readonly type: Schema.Literal<"characters">;
1041
+ readonly characters: Schema.Number;
1042
+ }>, Schema.Struct<{
1043
+ readonly type: Schema.Literal<"credits">;
1044
+ readonly credits: Schema.Number;
1045
+ }>, Schema.Struct<{
1046
+ readonly type: Schema.Literal<"compute">;
1047
+ readonly seconds: Schema.Number;
1048
+ }>]>>;
1049
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1050
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1051
+ readonly message: Schema.String;
1052
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1053
+ }>>>;
1054
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1055
+ }> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "video">]: never; }, OrElse extends (value: Exclude<{
1012
1056
  readonly type: "generation-queued";
1013
- readonly position?: number | undefined;
1014
- }, {
1015
- readonly type: keyof Cases;
1016
- }> | Exclude<{
1017
1057
  readonly id: string;
1058
+ readonly position?: number | undefined;
1059
+ } | {
1018
1060
  readonly type: "generation-progress";
1061
+ readonly id: string;
1019
1062
  readonly progress?: number | undefined;
1020
- }, {
1021
- readonly type: keyof Cases;
1022
- }> | Exclude<{
1063
+ } | {
1023
1064
  readonly type: "video";
1024
1065
  readonly index: number;
1025
1066
  readonly video: Media.Asset;
1026
- }, {
1027
- readonly type: keyof Cases;
1028
- }> | Exclude<{
1067
+ } | {
1029
1068
  readonly type: "finish";
1030
- readonly providerMetadata?: {
1031
- readonly [x: string]: {
1032
- readonly [x: string]: unknown;
1033
- };
1034
- } | undefined;
1035
1069
  readonly usage?: {
1036
1070
  readonly type: "tokens";
1037
1071
  readonly input?: number | undefined;
@@ -1054,7 +1088,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1054
1088
  readonly seconds: number;
1055
1089
  } | undefined;
1056
1090
  readonly notices?: readonly {
1057
- readonly type: "other" | "moderated" | "filtered";
1091
+ readonly type: "filtered" | "moderated" | "other";
1058
1092
  readonly message: string;
1059
1093
  readonly providerMetadata?: {
1060
1094
  readonly [x: string]: {
@@ -1062,15 +1096,18 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1062
1096
  };
1063
1097
  } | undefined;
1064
1098
  }[] | undefined;
1065
- }, {
1066
- readonly type: keyof Cases;
1067
- }>) => any>(value: {
1068
- readonly id: string;
1099
+ readonly providerMetadata?: {
1100
+ readonly [x: string]: {
1101
+ readonly [x: string]: unknown;
1102
+ };
1103
+ } | undefined;
1104
+ }, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
1069
1105
  readonly type: "generation-queued";
1106
+ readonly id: string;
1070
1107
  readonly position?: number | undefined;
1071
1108
  } | {
1072
- readonly id: string;
1073
1109
  readonly type: "generation-progress";
1110
+ readonly id: string;
1074
1111
  readonly progress?: number | undefined;
1075
1112
  } | {
1076
1113
  readonly type: "video";
@@ -1078,11 +1115,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1078
1115
  readonly video: Media.Asset;
1079
1116
  } | {
1080
1117
  readonly type: "finish";
1081
- readonly providerMetadata?: {
1082
- readonly [x: string]: {
1083
- readonly [x: string]: unknown;
1084
- };
1085
- } | undefined;
1086
1118
  readonly usage?: {
1087
1119
  readonly type: "tokens";
1088
1120
  readonly input?: number | undefined;
@@ -1105,7 +1137,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1105
1137
  readonly seconds: number;
1106
1138
  } | undefined;
1107
1139
  readonly notices?: readonly {
1108
- readonly type: "other" | "moderated" | "filtered";
1140
+ readonly type: "filtered" | "moderated" | "other";
1109
1141
  readonly message: string;
1110
1142
  readonly providerMetadata?: {
1111
1143
  readonly [x: string]: {
@@ -1113,86 +1145,95 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1113
1145
  };
1114
1146
  } | undefined;
1115
1147
  }[] | undefined;
1116
- }, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
1117
- <Cases extends {
1118
- "generation-queued"?: ((value: {
1119
- readonly id: string;
1120
- readonly type: "generation-queued";
1121
- readonly position?: number | undefined;
1122
- }) => any) | undefined;
1123
- "generation-progress"?: ((value: {
1124
- readonly id: string;
1125
- readonly type: "generation-progress";
1126
- readonly progress?: number | undefined;
1127
- }) => any) | undefined;
1128
- video?: ((value: {
1129
- readonly type: "video";
1130
- readonly index: number;
1131
- readonly video: Media.Asset;
1132
- }) => any) | undefined;
1133
- finish?: ((value: {
1134
- readonly type: "finish";
1135
- readonly providerMetadata?: {
1136
- readonly [x: string]: {
1137
- readonly [x: string]: unknown;
1138
- };
1139
- } | undefined;
1140
- readonly usage?: {
1141
- readonly type: "tokens";
1142
- readonly input?: number | undefined;
1143
- readonly output?: number | undefined;
1144
- readonly total?: number | undefined;
1145
- readonly details?: {
1146
- readonly [x: string]: unknown;
1147
- } | undefined;
1148
- } | {
1149
- readonly type: "seconds";
1150
- readonly seconds: number;
1151
- } | {
1152
- readonly type: "characters";
1153
- readonly characters: number;
1154
- } | {
1155
- readonly type: "credits";
1156
- readonly credits: number;
1157
- } | {
1158
- readonly type: "compute";
1159
- readonly seconds: number;
1160
- } | undefined;
1161
- readonly notices?: readonly {
1162
- readonly type: "other" | "moderated" | "filtered";
1163
- readonly message: string;
1164
- readonly providerMetadata?: {
1165
- readonly [x: string]: {
1166
- readonly [x: string]: unknown;
1167
- };
1168
- } | undefined;
1169
- }[] | undefined;
1170
- }) => any) | undefined;
1171
- } & { [K in Exclude<keyof Cases, "finish" | "generation-queued" | "generation-progress" | "video">]: never; }, OrElse extends (value: Exclude<{
1172
- readonly id: string;
1148
+ readonly providerMetadata?: {
1149
+ readonly [x: string]: {
1150
+ readonly [x: string]: unknown;
1151
+ };
1152
+ } | undefined;
1153
+ }, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K in keyof Cases]-?: NonNullable<Cases[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
1154
+ <Cases extends { [M in Schema.Struct<{
1155
+ readonly type: Schema.tag<"generation-queued">;
1156
+ readonly id: Schema.String;
1157
+ readonly position: Schema.optional<Schema.Number>;
1158
+ }> | Schema.Struct<{
1159
+ readonly type: Schema.tag<"generation-progress">;
1160
+ readonly id: Schema.String;
1161
+ readonly progress: Schema.optional<Schema.Number>;
1162
+ }> | Schema.Struct<{
1163
+ readonly type: Schema.tag<"video">;
1164
+ readonly index: Schema.Number;
1165
+ readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
1166
+ readonly source: Schema.Union<readonly [Schema.Struct<{
1167
+ readonly type: Schema.Literal<"bytes">;
1168
+ readonly data: Schema.Uint8Array;
1169
+ readonly mediaType: Schema.String;
1170
+ }>, Schema.Struct<{
1171
+ readonly type: Schema.Literal<"base64">;
1172
+ readonly data: Schema.String;
1173
+ readonly mediaType: Schema.String;
1174
+ }>, Schema.Struct<{
1175
+ readonly type: Schema.Literal<"url">;
1176
+ readonly url: Schema.String;
1177
+ readonly mediaType: Schema.optional<Schema.String>;
1178
+ readonly expiresAt: Schema.optional<Schema.Number>;
1179
+ }>, Schema.Struct<{
1180
+ readonly type: Schema.Literal<"ref">;
1181
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
1182
+ readonly id: Schema.String;
1183
+ readonly mediaType: Schema.optional<Schema.String>;
1184
+ }>]>;
1185
+ readonly info: Schema.optional<Schema.Struct<{
1186
+ readonly width: Schema.optional<Schema.Number>;
1187
+ readonly height: Schema.optional<Schema.Number>;
1188
+ readonly durationSeconds: Schema.optional<Schema.Number>;
1189
+ readonly sampleRate: Schema.optional<Schema.Number>;
1190
+ readonly channels: Schema.optional<Schema.Number>;
1191
+ readonly encoding: Schema.optional<Schema.String>;
1192
+ readonly format: Schema.optional<Schema.String>;
1193
+ }>>;
1194
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1195
+ }>, never, never>;
1196
+ }> | Schema.Struct<{
1197
+ readonly type: Schema.tag<"finish">;
1198
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1199
+ readonly type: Schema.Literal<"tokens">;
1200
+ readonly input: Schema.optional<Schema.Number>;
1201
+ readonly output: Schema.optional<Schema.Number>;
1202
+ readonly total: Schema.optional<Schema.Number>;
1203
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1204
+ }>, Schema.Struct<{
1205
+ readonly type: Schema.Literal<"seconds">;
1206
+ readonly seconds: Schema.Number;
1207
+ }>, Schema.Struct<{
1208
+ readonly type: Schema.Literal<"characters">;
1209
+ readonly characters: Schema.Number;
1210
+ }>, Schema.Struct<{
1211
+ readonly type: Schema.Literal<"credits">;
1212
+ readonly credits: Schema.Number;
1213
+ }>, Schema.Struct<{
1214
+ readonly type: Schema.Literal<"compute">;
1215
+ readonly seconds: Schema.Number;
1216
+ }>]>>;
1217
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1218
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1219
+ readonly message: Schema.String;
1220
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1221
+ }>>>;
1222
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1223
+ }> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "video">]: never; }, OrElse extends (value: Exclude<{
1173
1224
  readonly type: "generation-queued";
1174
- readonly position?: number | undefined;
1175
- }, {
1176
- readonly type: keyof Cases;
1177
- }> | Exclude<{
1178
1225
  readonly id: string;
1226
+ readonly position?: number | undefined;
1227
+ } | {
1179
1228
  readonly type: "generation-progress";
1229
+ readonly id: string;
1180
1230
  readonly progress?: number | undefined;
1181
- }, {
1182
- readonly type: keyof Cases;
1183
- }> | Exclude<{
1231
+ } | {
1184
1232
  readonly type: "video";
1185
1233
  readonly index: number;
1186
1234
  readonly video: Media.Asset;
1187
- }, {
1188
- readonly type: keyof Cases;
1189
- }> | Exclude<{
1235
+ } | {
1190
1236
  readonly type: "finish";
1191
- readonly providerMetadata?: {
1192
- readonly [x: string]: {
1193
- readonly [x: string]: unknown;
1194
- };
1195
- } | undefined;
1196
1237
  readonly usage?: {
1197
1238
  readonly type: "tokens";
1198
1239
  readonly input?: number | undefined;
@@ -1215,7 +1256,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1215
1256
  readonly seconds: number;
1216
1257
  } | undefined;
1217
1258
  readonly notices?: readonly {
1218
- readonly type: "other" | "moderated" | "filtered";
1259
+ readonly type: "filtered" | "moderated" | "other";
1219
1260
  readonly message: string;
1220
1261
  readonly providerMetadata?: {
1221
1262
  readonly [x: string]: {
@@ -1223,15 +1264,18 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1223
1264
  };
1224
1265
  } | undefined;
1225
1266
  }[] | undefined;
1226
- }, {
1227
- readonly type: keyof Cases;
1228
- }>) => any>(cases: Cases, orElse: OrElse): (value: {
1229
- readonly id: string;
1267
+ readonly providerMetadata?: {
1268
+ readonly [x: string]: {
1269
+ readonly [x: string]: unknown;
1270
+ };
1271
+ } | undefined;
1272
+ }, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
1230
1273
  readonly type: "generation-queued";
1274
+ readonly id: string;
1231
1275
  readonly position?: number | undefined;
1232
1276
  } | {
1233
- readonly id: string;
1234
1277
  readonly type: "generation-progress";
1278
+ readonly id: string;
1235
1279
  readonly progress?: number | undefined;
1236
1280
  } | {
1237
1281
  readonly type: "video";
@@ -1239,11 +1283,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1239
1283
  readonly video: Media.Asset;
1240
1284
  } | {
1241
1285
  readonly type: "finish";
1242
- readonly providerMetadata?: {
1243
- readonly [x: string]: {
1244
- readonly [x: string]: unknown;
1245
- };
1246
- } | undefined;
1247
1286
  readonly usage?: {
1248
1287
  readonly type: "tokens";
1249
1288
  readonly input?: number | undefined;
@@ -1266,7 +1305,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1266
1305
  readonly seconds: number;
1267
1306
  } | undefined;
1268
1307
  readonly notices?: readonly {
1269
- readonly type: "other" | "moderated" | "filtered";
1308
+ readonly type: "filtered" | "moderated" | "other";
1270
1309
  readonly message: string;
1271
1310
  readonly providerMetadata?: {
1272
1311
  readonly [x: string]: {
@@ -1274,18 +1313,23 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1274
1313
  };
1275
1314
  } | undefined;
1276
1315
  }[] | undefined;
1277
- }) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
1316
+ readonly providerMetadata?: {
1317
+ readonly [x: string]: {
1318
+ readonly [x: string]: unknown;
1319
+ };
1320
+ } | undefined;
1321
+ }) => import("effect/Unify").Unify<{ [K in keyof Cases]-?: NonNullable<Cases[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
1278
1322
  };
1279
1323
  } & {
1280
1324
  is: {
1281
1325
  generationQueued: (u: unknown) => u is {
1282
- readonly id: string;
1283
1326
  readonly type: "generation-queued";
1327
+ readonly id: string;
1284
1328
  readonly position?: number | undefined;
1285
1329
  };
1286
1330
  generationProgress: (u: unknown) => u is {
1287
- readonly id: string;
1288
1331
  readonly type: "generation-progress";
1332
+ readonly id: string;
1289
1333
  readonly progress?: number | undefined;
1290
1334
  };
1291
1335
  video: (u: unknown) => u is {
@@ -1295,11 +1339,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1295
1339
  };
1296
1340
  finish: (u: unknown) => u is {
1297
1341
  readonly type: "finish";
1298
- readonly providerMetadata?: {
1299
- readonly [x: string]: {
1300
- readonly [x: string]: unknown;
1301
- };
1302
- } | undefined;
1303
1342
  readonly usage?: {
1304
1343
  readonly type: "tokens";
1305
1344
  readonly input?: number | undefined;
@@ -1322,7 +1361,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1322
1361
  readonly seconds: number;
1323
1362
  } | undefined;
1324
1363
  readonly notices?: readonly {
1325
- readonly type: "other" | "moderated" | "filtered";
1364
+ readonly type: "filtered" | "moderated" | "other";
1326
1365
  readonly message: string;
1327
1366
  readonly providerMetadata?: {
1328
1367
  readonly [x: string]: {
@@ -1330,6 +1369,11 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1330
1369
  };
1331
1370
  } | undefined;
1332
1371
  }[] | undefined;
1372
+ readonly providerMetadata?: {
1373
+ readonly [x: string]: {
1374
+ readonly [x: string]: unknown;
1375
+ };
1376
+ } | undefined;
1333
1377
  };
1334
1378
  };
1335
1379
  };
@@ -1345,7 +1389,7 @@ export declare const Video: {
1345
1389
  readonly request: typeof request;
1346
1390
  readonly start: typeof start;
1347
1391
  readonly generate: typeof generate;
1348
- readonly resume: (model: VideoModel, token: unknown) => Effect.Effect<Generation<VideoResponse>, AIError, Service>;
1392
+ readonly resume: typeof resume;
1349
1393
  readonly stream: typeof stream;
1350
1394
  };
1351
1395
  export {};