@opencode/ai 0.0.0-dev-420 → 0.0.0-dev-425
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/image.d.ts +336 -400
- package/dist/schema/events.d.ts +2456 -2168
- package/dist/speech.d.ts +290 -294
- package/dist/transcription.d.ts +298 -242
- package/dist/video.d.ts +252 -264
- package/package.json +5 -5
package/dist/speech.d.ts
CHANGED
|
@@ -575,78 +575,84 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
575
575
|
};
|
|
576
576
|
};
|
|
577
577
|
readonly match: {
|
|
578
|
-
<
|
|
579
|
-
readonly
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
readonly
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
578
|
+
<Handlers extends { [K in "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps"]: (value: {
|
|
579
|
+
readonly "audio-delta": Schema.Struct<{
|
|
580
|
+
readonly type: Schema.tag<"audio-delta">;
|
|
581
|
+
readonly chunk: Schema.Uint8Array;
|
|
582
|
+
}>;
|
|
583
|
+
readonly finish: Schema.Struct<{
|
|
584
|
+
readonly type: Schema.tag<"finish">;
|
|
585
|
+
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
586
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
587
|
+
readonly type: Schema.Literal<"bytes">;
|
|
588
|
+
readonly data: Schema.Uint8Array;
|
|
589
|
+
readonly mediaType: Schema.String;
|
|
590
|
+
}>, Schema.Struct<{
|
|
591
|
+
readonly type: Schema.Literal<"base64">;
|
|
592
|
+
readonly data: Schema.String;
|
|
593
|
+
readonly mediaType: Schema.String;
|
|
594
|
+
}>, Schema.Struct<{
|
|
595
|
+
readonly type: Schema.Literal<"url">;
|
|
596
|
+
readonly url: Schema.String;
|
|
597
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
598
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
599
|
+
}>, Schema.Struct<{
|
|
600
|
+
readonly type: Schema.Literal<"ref">;
|
|
601
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
602
|
+
readonly id: Schema.String;
|
|
603
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
604
|
+
}>]>;
|
|
605
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
606
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
607
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
608
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
609
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
610
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
611
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
612
|
+
readonly format: Schema.optional<Schema.String>;
|
|
613
|
+
}>>;
|
|
614
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
615
|
+
}>, never, never>;
|
|
616
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
617
|
+
readonly type: Schema.Literal<"tokens">;
|
|
618
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
619
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
620
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
621
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
603
622
|
}>, Schema.Struct<{
|
|
604
|
-
readonly type: Schema.Literal<"
|
|
605
|
-
readonly
|
|
606
|
-
readonly mediaType: Schema.String;
|
|
623
|
+
readonly type: Schema.Literal<"seconds">;
|
|
624
|
+
readonly seconds: Schema.Number;
|
|
607
625
|
}>, Schema.Struct<{
|
|
608
|
-
readonly type: Schema.Literal<"
|
|
609
|
-
readonly
|
|
610
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
611
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
626
|
+
readonly type: Schema.Literal<"characters">;
|
|
627
|
+
readonly characters: Schema.Number;
|
|
612
628
|
}>, Schema.Struct<{
|
|
613
|
-
readonly type: Schema.Literal<"
|
|
614
|
-
readonly
|
|
615
|
-
|
|
616
|
-
readonly
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
620
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
621
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
622
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
623
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
624
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
625
|
-
readonly format: Schema.optional<Schema.String>;
|
|
626
|
-
}>>;
|
|
629
|
+
readonly type: Schema.Literal<"credits">;
|
|
630
|
+
readonly credits: Schema.Number;
|
|
631
|
+
}>, Schema.Struct<{
|
|
632
|
+
readonly type: Schema.Literal<"compute">;
|
|
633
|
+
readonly seconds: Schema.Number;
|
|
634
|
+
}>]>>;
|
|
627
635
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
628
|
-
}
|
|
629
|
-
readonly
|
|
630
|
-
readonly type: Schema.
|
|
631
|
-
readonly
|
|
632
|
-
readonly
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
readonly
|
|
637
|
-
readonly
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
readonly
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
649
|
-
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
|
|
636
|
+
}>;
|
|
637
|
+
readonly "generation-progress": Schema.Struct<{
|
|
638
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
639
|
+
readonly id: Schema.String;
|
|
640
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
641
|
+
}>;
|
|
642
|
+
readonly "generation-queued": Schema.Struct<{
|
|
643
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
644
|
+
readonly id: Schema.String;
|
|
645
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
646
|
+
}>;
|
|
647
|
+
readonly timestamps: Schema.Struct<{
|
|
648
|
+
readonly type: Schema.tag<"timestamps">;
|
|
649
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
650
|
+
readonly text: Schema.String;
|
|
651
|
+
readonly startSeconds: Schema.Number;
|
|
652
|
+
readonly endSeconds: Schema.Number;
|
|
653
|
+
}>>;
|
|
654
|
+
}>;
|
|
655
|
+
}[K]["Type"]) => any; }>(value: {
|
|
650
656
|
readonly type: "audio-delta";
|
|
651
657
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
652
658
|
} | {
|
|
@@ -693,79 +699,85 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
693
699
|
readonly [x: string]: unknown;
|
|
694
700
|
};
|
|
695
701
|
} | undefined;
|
|
696
|
-
}, cases:
|
|
697
|
-
<
|
|
698
|
-
readonly
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
readonly
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
702
|
+
}, cases: Handlers): import("effect/Unify").Unify<ReturnType<Handlers["audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps"]>>;
|
|
703
|
+
<Handlers extends { [K in "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps"]: (value: {
|
|
704
|
+
readonly "audio-delta": Schema.Struct<{
|
|
705
|
+
readonly type: Schema.tag<"audio-delta">;
|
|
706
|
+
readonly chunk: Schema.Uint8Array;
|
|
707
|
+
}>;
|
|
708
|
+
readonly finish: Schema.Struct<{
|
|
709
|
+
readonly type: Schema.tag<"finish">;
|
|
710
|
+
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
711
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
712
|
+
readonly type: Schema.Literal<"bytes">;
|
|
713
|
+
readonly data: Schema.Uint8Array;
|
|
714
|
+
readonly mediaType: Schema.String;
|
|
715
|
+
}>, Schema.Struct<{
|
|
716
|
+
readonly type: Schema.Literal<"base64">;
|
|
717
|
+
readonly data: Schema.String;
|
|
718
|
+
readonly mediaType: Schema.String;
|
|
719
|
+
}>, Schema.Struct<{
|
|
720
|
+
readonly type: Schema.Literal<"url">;
|
|
721
|
+
readonly url: Schema.String;
|
|
722
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
723
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
724
|
+
}>, Schema.Struct<{
|
|
725
|
+
readonly type: Schema.Literal<"ref">;
|
|
726
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
727
|
+
readonly id: Schema.String;
|
|
728
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
729
|
+
}>]>;
|
|
730
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
731
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
732
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
733
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
734
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
735
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
736
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
737
|
+
readonly format: Schema.optional<Schema.String>;
|
|
738
|
+
}>>;
|
|
739
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
740
|
+
}>, never, never>;
|
|
741
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
742
|
+
readonly type: Schema.Literal<"tokens">;
|
|
743
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
744
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
745
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
746
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
722
747
|
}>, Schema.Struct<{
|
|
723
|
-
readonly type: Schema.Literal<"
|
|
724
|
-
readonly
|
|
725
|
-
readonly mediaType: Schema.String;
|
|
748
|
+
readonly type: Schema.Literal<"seconds">;
|
|
749
|
+
readonly seconds: Schema.Number;
|
|
726
750
|
}>, Schema.Struct<{
|
|
727
|
-
readonly type: Schema.Literal<"
|
|
728
|
-
readonly
|
|
729
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
730
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
751
|
+
readonly type: Schema.Literal<"characters">;
|
|
752
|
+
readonly characters: Schema.Number;
|
|
731
753
|
}>, Schema.Struct<{
|
|
732
|
-
readonly type: Schema.Literal<"
|
|
733
|
-
readonly
|
|
734
|
-
|
|
735
|
-
readonly
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
739
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
740
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
741
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
742
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
743
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
744
|
-
readonly format: Schema.optional<Schema.String>;
|
|
745
|
-
}>>;
|
|
754
|
+
readonly type: Schema.Literal<"credits">;
|
|
755
|
+
readonly credits: Schema.Number;
|
|
756
|
+
}>, Schema.Struct<{
|
|
757
|
+
readonly type: Schema.Literal<"compute">;
|
|
758
|
+
readonly seconds: Schema.Number;
|
|
759
|
+
}>]>>;
|
|
746
760
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
747
|
-
}
|
|
748
|
-
readonly
|
|
749
|
-
readonly type: Schema.
|
|
750
|
-
readonly
|
|
751
|
-
readonly
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
readonly
|
|
756
|
-
readonly
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
readonly
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
768
|
-
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
|
|
761
|
+
}>;
|
|
762
|
+
readonly "generation-progress": Schema.Struct<{
|
|
763
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
764
|
+
readonly id: Schema.String;
|
|
765
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
766
|
+
}>;
|
|
767
|
+
readonly "generation-queued": Schema.Struct<{
|
|
768
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
769
|
+
readonly id: Schema.String;
|
|
770
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
771
|
+
}>;
|
|
772
|
+
readonly timestamps: Schema.Struct<{
|
|
773
|
+
readonly type: Schema.tag<"timestamps">;
|
|
774
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
775
|
+
readonly text: Schema.String;
|
|
776
|
+
readonly startSeconds: Schema.Number;
|
|
777
|
+
readonly endSeconds: Schema.Number;
|
|
778
|
+
}>>;
|
|
779
|
+
}>;
|
|
780
|
+
}[K]["Type"]) => any; }>(cases: Handlers): (value: {
|
|
769
781
|
readonly type: "audio-delta";
|
|
770
782
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
771
783
|
} | {
|
|
@@ -812,81 +824,10 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
812
824
|
readonly [x: string]: unknown;
|
|
813
825
|
};
|
|
814
826
|
} | undefined;
|
|
815
|
-
}) =>
|
|
827
|
+
}) => import("effect/Unify").Unify<ReturnType<Handlers["audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps"]>>;
|
|
816
828
|
};
|
|
817
829
|
readonly matchOrElse: {
|
|
818
|
-
<
|
|
819
|
-
readonly type: Schema.tag<"generation-queued">;
|
|
820
|
-
readonly id: Schema.String;
|
|
821
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
822
|
-
}> | Schema.Struct<{
|
|
823
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
824
|
-
readonly id: Schema.String;
|
|
825
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
826
|
-
}> | Schema.Struct<{
|
|
827
|
-
readonly type: Schema.tag<"audio-delta">;
|
|
828
|
-
readonly chunk: Schema.Uint8Array;
|
|
829
|
-
}> | Schema.Struct<{
|
|
830
|
-
readonly type: Schema.tag<"timestamps">;
|
|
831
|
-
readonly items: Schema.$Array<Schema.Struct<{
|
|
832
|
-
readonly text: Schema.String;
|
|
833
|
-
readonly startSeconds: Schema.Number;
|
|
834
|
-
readonly endSeconds: Schema.Number;
|
|
835
|
-
}>>;
|
|
836
|
-
}> | Schema.Struct<{
|
|
837
|
-
readonly type: Schema.tag<"finish">;
|
|
838
|
-
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
839
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
840
|
-
readonly type: Schema.Literal<"bytes">;
|
|
841
|
-
readonly data: Schema.Uint8Array;
|
|
842
|
-
readonly mediaType: Schema.String;
|
|
843
|
-
}>, Schema.Struct<{
|
|
844
|
-
readonly type: Schema.Literal<"base64">;
|
|
845
|
-
readonly data: Schema.String;
|
|
846
|
-
readonly mediaType: Schema.String;
|
|
847
|
-
}>, Schema.Struct<{
|
|
848
|
-
readonly type: Schema.Literal<"url">;
|
|
849
|
-
readonly url: Schema.String;
|
|
850
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
851
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
852
|
-
}>, Schema.Struct<{
|
|
853
|
-
readonly type: Schema.Literal<"ref">;
|
|
854
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
855
|
-
readonly id: Schema.String;
|
|
856
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
857
|
-
}>]>;
|
|
858
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
859
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
860
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
861
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
862
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
863
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
864
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
865
|
-
readonly format: Schema.optional<Schema.String>;
|
|
866
|
-
}>>;
|
|
867
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
868
|
-
}>, never, never>;
|
|
869
|
-
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
870
|
-
readonly type: Schema.Literal<"tokens">;
|
|
871
|
-
readonly input: Schema.optional<Schema.Number>;
|
|
872
|
-
readonly output: Schema.optional<Schema.Number>;
|
|
873
|
-
readonly total: Schema.optional<Schema.Number>;
|
|
874
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
875
|
-
}>, Schema.Struct<{
|
|
876
|
-
readonly type: Schema.Literal<"seconds">;
|
|
877
|
-
readonly seconds: Schema.Number;
|
|
878
|
-
}>, Schema.Struct<{
|
|
879
|
-
readonly type: Schema.Literal<"characters">;
|
|
880
|
-
readonly characters: Schema.Number;
|
|
881
|
-
}>, Schema.Struct<{
|
|
882
|
-
readonly type: Schema.Literal<"credits">;
|
|
883
|
-
readonly credits: Schema.Number;
|
|
884
|
-
}>, Schema.Struct<{
|
|
885
|
-
readonly type: Schema.Literal<"compute">;
|
|
886
|
-
readonly seconds: Schema.Number;
|
|
887
|
-
}>]>>;
|
|
888
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
889
|
-
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps">]: never; }, OrElse extends (value: Exclude<{
|
|
830
|
+
<Handlers, OrElse>(value: {
|
|
890
831
|
readonly type: "audio-delta";
|
|
891
832
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
892
833
|
} | {
|
|
@@ -933,25 +874,86 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
933
874
|
readonly [x: string]: unknown;
|
|
934
875
|
};
|
|
935
876
|
} | undefined;
|
|
936
|
-
},
|
|
877
|
+
}, cases: Handlers & {
|
|
878
|
+
readonly "audio-delta"?: ((value: {
|
|
879
|
+
readonly type: "audio-delta";
|
|
880
|
+
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
881
|
+
}) => any) | undefined;
|
|
882
|
+
readonly finish?: ((value: {
|
|
883
|
+
readonly type: "finish";
|
|
884
|
+
readonly audio: Media.Asset;
|
|
885
|
+
readonly usage?: {
|
|
886
|
+
readonly type: "seconds";
|
|
887
|
+
readonly seconds: number;
|
|
888
|
+
} | {
|
|
889
|
+
readonly type: "characters";
|
|
890
|
+
readonly characters: number;
|
|
891
|
+
} | {
|
|
892
|
+
readonly type: "credits";
|
|
893
|
+
readonly credits: number;
|
|
894
|
+
} | {
|
|
895
|
+
readonly type: "compute";
|
|
896
|
+
readonly seconds: number;
|
|
897
|
+
} | {
|
|
898
|
+
readonly type: "tokens";
|
|
899
|
+
readonly input?: number | undefined;
|
|
900
|
+
readonly output?: number | undefined;
|
|
901
|
+
readonly total?: number | undefined;
|
|
902
|
+
readonly details?: {
|
|
903
|
+
readonly [x: string]: unknown;
|
|
904
|
+
} | undefined;
|
|
905
|
+
} | undefined;
|
|
906
|
+
readonly providerMetadata?: {
|
|
907
|
+
readonly [x: string]: {
|
|
908
|
+
readonly [x: string]: unknown;
|
|
909
|
+
};
|
|
910
|
+
} | undefined;
|
|
911
|
+
}) => any) | undefined;
|
|
912
|
+
readonly "generation-progress"?: ((value: {
|
|
913
|
+
readonly type: "generation-progress";
|
|
914
|
+
readonly id: string;
|
|
915
|
+
readonly progress?: number | undefined;
|
|
916
|
+
}) => any) | undefined;
|
|
917
|
+
readonly "generation-queued"?: ((value: {
|
|
918
|
+
readonly type: "generation-queued";
|
|
919
|
+
readonly id: string;
|
|
920
|
+
readonly position?: number | undefined;
|
|
921
|
+
}) => any) | undefined;
|
|
922
|
+
readonly timestamps?: ((value: {
|
|
923
|
+
readonly type: "timestamps";
|
|
924
|
+
readonly items: readonly {
|
|
925
|
+
readonly text: string;
|
|
926
|
+
readonly startSeconds: number;
|
|
927
|
+
readonly endSeconds: number;
|
|
928
|
+
}[];
|
|
929
|
+
}) => any) | undefined;
|
|
930
|
+
} & (Exclude<keyof Handlers, "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
937
931
|
readonly type: "audio-delta";
|
|
938
932
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
939
|
-
}
|
|
933
|
+
}, {
|
|
934
|
+
readonly type: keyof Handlers;
|
|
935
|
+
}> | Exclude<{
|
|
940
936
|
readonly type: "timestamps";
|
|
941
937
|
readonly items: readonly {
|
|
942
938
|
readonly text: string;
|
|
943
939
|
readonly startSeconds: number;
|
|
944
940
|
readonly endSeconds: number;
|
|
945
941
|
}[];
|
|
946
|
-
}
|
|
942
|
+
}, {
|
|
943
|
+
readonly type: keyof Handlers;
|
|
944
|
+
}> | Exclude<{
|
|
947
945
|
readonly type: "generation-queued";
|
|
948
946
|
readonly id: string;
|
|
949
947
|
readonly position?: number | undefined;
|
|
950
|
-
}
|
|
948
|
+
}, {
|
|
949
|
+
readonly type: keyof Handlers;
|
|
950
|
+
}> | Exclude<{
|
|
951
951
|
readonly type: "generation-progress";
|
|
952
952
|
readonly id: string;
|
|
953
953
|
readonly progress?: number | undefined;
|
|
954
|
-
}
|
|
954
|
+
}, {
|
|
955
|
+
readonly type: keyof Handlers;
|
|
956
|
+
}> | Exclude<{
|
|
955
957
|
readonly type: "finish";
|
|
956
958
|
readonly audio: Media.Asset;
|
|
957
959
|
readonly usage?: {
|
|
@@ -980,97 +982,89 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
980
982
|
readonly [x: string]: unknown;
|
|
981
983
|
};
|
|
982
984
|
} | undefined;
|
|
983
|
-
},
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
readonly
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
readonly
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
readonly
|
|
1008
|
-
readonly
|
|
1009
|
-
|
|
1010
|
-
readonly
|
|
1011
|
-
readonly
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
readonly
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
readonly
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
readonly
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
1041
|
-
}>, Schema.Struct<{
|
|
1042
|
-
readonly type: Schema.Literal<"seconds">;
|
|
1043
|
-
readonly seconds: Schema.Number;
|
|
1044
|
-
}>, Schema.Struct<{
|
|
1045
|
-
readonly type: Schema.Literal<"characters">;
|
|
1046
|
-
readonly characters: Schema.Number;
|
|
1047
|
-
}>, Schema.Struct<{
|
|
1048
|
-
readonly type: Schema.Literal<"credits">;
|
|
1049
|
-
readonly credits: Schema.Number;
|
|
1050
|
-
}>, Schema.Struct<{
|
|
1051
|
-
readonly type: Schema.Literal<"compute">;
|
|
1052
|
-
readonly seconds: Schema.Number;
|
|
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, "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps">]: never; }, OrElse extends (value: Exclude<{
|
|
985
|
+
}, {
|
|
986
|
+
readonly type: keyof Handlers;
|
|
987
|
+
}>) => any)): import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
988
|
+
<Handlers, OrElse>(cases: Handlers & {
|
|
989
|
+
readonly "audio-delta"?: ((value: {
|
|
990
|
+
readonly type: "audio-delta";
|
|
991
|
+
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
992
|
+
}) => any) | undefined;
|
|
993
|
+
readonly finish?: ((value: {
|
|
994
|
+
readonly type: "finish";
|
|
995
|
+
readonly audio: Media.Asset;
|
|
996
|
+
readonly usage?: {
|
|
997
|
+
readonly type: "seconds";
|
|
998
|
+
readonly seconds: number;
|
|
999
|
+
} | {
|
|
1000
|
+
readonly type: "characters";
|
|
1001
|
+
readonly characters: number;
|
|
1002
|
+
} | {
|
|
1003
|
+
readonly type: "credits";
|
|
1004
|
+
readonly credits: number;
|
|
1005
|
+
} | {
|
|
1006
|
+
readonly type: "compute";
|
|
1007
|
+
readonly seconds: number;
|
|
1008
|
+
} | {
|
|
1009
|
+
readonly type: "tokens";
|
|
1010
|
+
readonly input?: number | undefined;
|
|
1011
|
+
readonly output?: number | undefined;
|
|
1012
|
+
readonly total?: number | undefined;
|
|
1013
|
+
readonly details?: {
|
|
1014
|
+
readonly [x: string]: unknown;
|
|
1015
|
+
} | undefined;
|
|
1016
|
+
} | undefined;
|
|
1017
|
+
readonly providerMetadata?: {
|
|
1018
|
+
readonly [x: string]: {
|
|
1019
|
+
readonly [x: string]: unknown;
|
|
1020
|
+
};
|
|
1021
|
+
} | undefined;
|
|
1022
|
+
}) => any) | undefined;
|
|
1023
|
+
readonly "generation-progress"?: ((value: {
|
|
1024
|
+
readonly type: "generation-progress";
|
|
1025
|
+
readonly id: string;
|
|
1026
|
+
readonly progress?: number | undefined;
|
|
1027
|
+
}) => any) | undefined;
|
|
1028
|
+
readonly "generation-queued"?: ((value: {
|
|
1029
|
+
readonly type: "generation-queued";
|
|
1030
|
+
readonly id: string;
|
|
1031
|
+
readonly position?: number | undefined;
|
|
1032
|
+
}) => any) | undefined;
|
|
1033
|
+
readonly timestamps?: ((value: {
|
|
1034
|
+
readonly type: "timestamps";
|
|
1035
|
+
readonly items: readonly {
|
|
1036
|
+
readonly text: string;
|
|
1037
|
+
readonly startSeconds: number;
|
|
1038
|
+
readonly endSeconds: number;
|
|
1039
|
+
}[];
|
|
1040
|
+
}) => any) | undefined;
|
|
1041
|
+
} & (Exclude<keyof Handlers, "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
1056
1042
|
readonly type: "audio-delta";
|
|
1057
1043
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
1058
|
-
}
|
|
1044
|
+
}, {
|
|
1045
|
+
readonly type: keyof Handlers;
|
|
1046
|
+
}> | Exclude<{
|
|
1059
1047
|
readonly type: "timestamps";
|
|
1060
1048
|
readonly items: readonly {
|
|
1061
1049
|
readonly text: string;
|
|
1062
1050
|
readonly startSeconds: number;
|
|
1063
1051
|
readonly endSeconds: number;
|
|
1064
1052
|
}[];
|
|
1065
|
-
}
|
|
1053
|
+
}, {
|
|
1054
|
+
readonly type: keyof Handlers;
|
|
1055
|
+
}> | Exclude<{
|
|
1066
1056
|
readonly type: "generation-queued";
|
|
1067
1057
|
readonly id: string;
|
|
1068
1058
|
readonly position?: number | undefined;
|
|
1069
|
-
}
|
|
1059
|
+
}, {
|
|
1060
|
+
readonly type: keyof Handlers;
|
|
1061
|
+
}> | Exclude<{
|
|
1070
1062
|
readonly type: "generation-progress";
|
|
1071
1063
|
readonly id: string;
|
|
1072
1064
|
readonly progress?: number | undefined;
|
|
1073
|
-
}
|
|
1065
|
+
}, {
|
|
1066
|
+
readonly type: keyof Handlers;
|
|
1067
|
+
}> | Exclude<{
|
|
1074
1068
|
readonly type: "finish";
|
|
1075
1069
|
readonly audio: Media.Asset;
|
|
1076
1070
|
readonly usage?: {
|
|
@@ -1099,7 +1093,9 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1099
1093
|
readonly [x: string]: unknown;
|
|
1100
1094
|
};
|
|
1101
1095
|
} | undefined;
|
|
1102
|
-
}, {
|
|
1096
|
+
}, {
|
|
1097
|
+
readonly type: keyof Handlers;
|
|
1098
|
+
}>) => any)): (value: {
|
|
1103
1099
|
readonly type: "audio-delta";
|
|
1104
1100
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
1105
1101
|
} | {
|
|
@@ -1146,7 +1142,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1146
1142
|
readonly [x: string]: unknown;
|
|
1147
1143
|
};
|
|
1148
1144
|
} | undefined;
|
|
1149
|
-
}) => import("effect/Unify").Unify<{ [K in keyof
|
|
1145
|
+
}) => import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
1150
1146
|
};
|
|
1151
1147
|
} & {
|
|
1152
1148
|
is: {
|