@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/transcription.d.ts
CHANGED
|
@@ -579,64 +579,70 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
579
579
|
};
|
|
580
580
|
};
|
|
581
581
|
readonly match: {
|
|
582
|
-
<
|
|
583
|
-
readonly
|
|
584
|
-
readonly id: Schema.String;
|
|
585
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
586
|
-
}> | Schema.Struct<{
|
|
587
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
588
|
-
readonly id: Schema.String;
|
|
589
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
590
|
-
}> | Schema.Struct<{
|
|
591
|
-
readonly type: Schema.tag<"text-delta">;
|
|
592
|
-
readonly delta: Schema.String;
|
|
593
|
-
}> | Schema.Struct<{
|
|
594
|
-
readonly type: Schema.tag<"segment">;
|
|
595
|
-
readonly segment: Schema.Struct<{
|
|
582
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]: (value: {
|
|
583
|
+
readonly finish: Schema.Struct<{
|
|
596
584
|
readonly text: Schema.String;
|
|
597
|
-
readonly
|
|
598
|
-
|
|
599
|
-
|
|
585
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
586
|
+
readonly text: Schema.String;
|
|
587
|
+
readonly startSeconds: Schema.Number;
|
|
588
|
+
readonly endSeconds: Schema.Number;
|
|
589
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
590
|
+
}>>>;
|
|
591
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
592
|
+
readonly text: Schema.String;
|
|
593
|
+
readonly startSeconds: Schema.Number;
|
|
594
|
+
readonly endSeconds: Schema.Number;
|
|
595
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
596
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
597
|
+
}>>>;
|
|
598
|
+
readonly language: Schema.optional<Schema.String>;
|
|
599
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
600
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
601
|
+
readonly type: Schema.Literal<"tokens">;
|
|
602
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
603
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
604
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
605
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
606
|
+
}>, Schema.Struct<{
|
|
607
|
+
readonly type: Schema.Literal<"seconds">;
|
|
608
|
+
readonly seconds: Schema.Number;
|
|
609
|
+
}>, Schema.Struct<{
|
|
610
|
+
readonly type: Schema.Literal<"characters">;
|
|
611
|
+
readonly characters: Schema.Number;
|
|
612
|
+
}>, Schema.Struct<{
|
|
613
|
+
readonly type: Schema.Literal<"credits">;
|
|
614
|
+
readonly credits: Schema.Number;
|
|
615
|
+
}>, Schema.Struct<{
|
|
616
|
+
readonly type: Schema.Literal<"compute">;
|
|
617
|
+
readonly seconds: Schema.Number;
|
|
618
|
+
}>]>>;
|
|
619
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
620
|
+
readonly type: Schema.tag<"finish">;
|
|
600
621
|
}>;
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
readonly
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
readonly
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
readonly
|
|
613
|
-
readonly
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
readonly
|
|
622
|
-
readonly
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
readonly type: Schema.Literal<"seconds">;
|
|
626
|
-
readonly seconds: Schema.Number;
|
|
627
|
-
}>, Schema.Struct<{
|
|
628
|
-
readonly type: Schema.Literal<"characters">;
|
|
629
|
-
readonly characters: Schema.Number;
|
|
630
|
-
}>, Schema.Struct<{
|
|
631
|
-
readonly type: Schema.Literal<"credits">;
|
|
632
|
-
readonly credits: Schema.Number;
|
|
633
|
-
}>, Schema.Struct<{
|
|
634
|
-
readonly type: Schema.Literal<"compute">;
|
|
635
|
-
readonly seconds: Schema.Number;
|
|
636
|
-
}>]>>;
|
|
637
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
638
|
-
readonly type: Schema.tag<"finish">;
|
|
639
|
-
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
|
|
622
|
+
readonly "generation-progress": Schema.Struct<{
|
|
623
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
624
|
+
readonly id: Schema.String;
|
|
625
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
626
|
+
}>;
|
|
627
|
+
readonly "generation-queued": Schema.Struct<{
|
|
628
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
629
|
+
readonly id: Schema.String;
|
|
630
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
631
|
+
}>;
|
|
632
|
+
readonly segment: Schema.Struct<{
|
|
633
|
+
readonly type: Schema.tag<"segment">;
|
|
634
|
+
readonly segment: Schema.Struct<{
|
|
635
|
+
readonly text: Schema.String;
|
|
636
|
+
readonly startSeconds: Schema.Number;
|
|
637
|
+
readonly endSeconds: Schema.Number;
|
|
638
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
639
|
+
}>;
|
|
640
|
+
}>;
|
|
641
|
+
readonly "text-delta": Schema.Struct<{
|
|
642
|
+
readonly type: Schema.tag<"text-delta">;
|
|
643
|
+
readonly delta: Schema.String;
|
|
644
|
+
}>;
|
|
645
|
+
}[K]["Type"]) => any; }>(value: {
|
|
640
646
|
readonly type: "text-delta";
|
|
641
647
|
readonly delta: string;
|
|
642
648
|
} | {
|
|
@@ -699,65 +705,71 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
699
705
|
};
|
|
700
706
|
} | undefined;
|
|
701
707
|
readonly type: "finish";
|
|
702
|
-
}, cases:
|
|
703
|
-
<
|
|
704
|
-
readonly
|
|
705
|
-
readonly id: Schema.String;
|
|
706
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
707
|
-
}> | Schema.Struct<{
|
|
708
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
709
|
-
readonly id: Schema.String;
|
|
710
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
711
|
-
}> | Schema.Struct<{
|
|
712
|
-
readonly type: Schema.tag<"text-delta">;
|
|
713
|
-
readonly delta: Schema.String;
|
|
714
|
-
}> | Schema.Struct<{
|
|
715
|
-
readonly type: Schema.tag<"segment">;
|
|
716
|
-
readonly segment: Schema.Struct<{
|
|
708
|
+
}, cases: Handlers): import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]>>;
|
|
709
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]: (value: {
|
|
710
|
+
readonly finish: Schema.Struct<{
|
|
717
711
|
readonly text: Schema.String;
|
|
718
|
-
readonly
|
|
719
|
-
|
|
720
|
-
|
|
712
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
713
|
+
readonly text: Schema.String;
|
|
714
|
+
readonly startSeconds: Schema.Number;
|
|
715
|
+
readonly endSeconds: Schema.Number;
|
|
716
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
717
|
+
}>>>;
|
|
718
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
719
|
+
readonly text: Schema.String;
|
|
720
|
+
readonly startSeconds: Schema.Number;
|
|
721
|
+
readonly endSeconds: Schema.Number;
|
|
722
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
723
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
724
|
+
}>>>;
|
|
725
|
+
readonly language: Schema.optional<Schema.String>;
|
|
726
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
727
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
728
|
+
readonly type: Schema.Literal<"tokens">;
|
|
729
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
730
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
731
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
732
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
733
|
+
}>, Schema.Struct<{
|
|
734
|
+
readonly type: Schema.Literal<"seconds">;
|
|
735
|
+
readonly seconds: Schema.Number;
|
|
736
|
+
}>, Schema.Struct<{
|
|
737
|
+
readonly type: Schema.Literal<"characters">;
|
|
738
|
+
readonly characters: Schema.Number;
|
|
739
|
+
}>, Schema.Struct<{
|
|
740
|
+
readonly type: Schema.Literal<"credits">;
|
|
741
|
+
readonly credits: Schema.Number;
|
|
742
|
+
}>, Schema.Struct<{
|
|
743
|
+
readonly type: Schema.Literal<"compute">;
|
|
744
|
+
readonly seconds: Schema.Number;
|
|
745
|
+
}>]>>;
|
|
746
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
747
|
+
readonly type: Schema.tag<"finish">;
|
|
721
748
|
}>;
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
readonly
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
readonly
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
readonly
|
|
734
|
-
readonly
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
readonly
|
|
743
|
-
readonly
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
readonly type: Schema.Literal<"seconds">;
|
|
747
|
-
readonly seconds: Schema.Number;
|
|
748
|
-
}>, Schema.Struct<{
|
|
749
|
-
readonly type: Schema.Literal<"characters">;
|
|
750
|
-
readonly characters: Schema.Number;
|
|
751
|
-
}>, Schema.Struct<{
|
|
752
|
-
readonly type: Schema.Literal<"credits">;
|
|
753
|
-
readonly credits: Schema.Number;
|
|
754
|
-
}>, Schema.Struct<{
|
|
755
|
-
readonly type: Schema.Literal<"compute">;
|
|
756
|
-
readonly seconds: Schema.Number;
|
|
757
|
-
}>]>>;
|
|
758
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
759
|
-
readonly type: Schema.tag<"finish">;
|
|
760
|
-
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
|
|
749
|
+
readonly "generation-progress": Schema.Struct<{
|
|
750
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
751
|
+
readonly id: Schema.String;
|
|
752
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
753
|
+
}>;
|
|
754
|
+
readonly "generation-queued": Schema.Struct<{
|
|
755
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
756
|
+
readonly id: Schema.String;
|
|
757
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
758
|
+
}>;
|
|
759
|
+
readonly segment: Schema.Struct<{
|
|
760
|
+
readonly type: Schema.tag<"segment">;
|
|
761
|
+
readonly segment: Schema.Struct<{
|
|
762
|
+
readonly text: Schema.String;
|
|
763
|
+
readonly startSeconds: Schema.Number;
|
|
764
|
+
readonly endSeconds: Schema.Number;
|
|
765
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
766
|
+
}>;
|
|
767
|
+
}>;
|
|
768
|
+
readonly "text-delta": Schema.Struct<{
|
|
769
|
+
readonly type: Schema.tag<"text-delta">;
|
|
770
|
+
readonly delta: Schema.String;
|
|
771
|
+
}>;
|
|
772
|
+
}[K]["Type"]) => any; }>(cases: Handlers): (value: {
|
|
761
773
|
readonly type: "text-delta";
|
|
762
774
|
readonly delta: string;
|
|
763
775
|
} | {
|
|
@@ -820,67 +832,10 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
820
832
|
};
|
|
821
833
|
} | undefined;
|
|
822
834
|
readonly type: "finish";
|
|
823
|
-
}) =>
|
|
835
|
+
}) => import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]>>;
|
|
824
836
|
};
|
|
825
837
|
readonly matchOrElse: {
|
|
826
|
-
<
|
|
827
|
-
readonly type: Schema.tag<"generation-queued">;
|
|
828
|
-
readonly id: Schema.String;
|
|
829
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
830
|
-
}> | Schema.Struct<{
|
|
831
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
832
|
-
readonly id: Schema.String;
|
|
833
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
834
|
-
}> | Schema.Struct<{
|
|
835
|
-
readonly type: Schema.tag<"text-delta">;
|
|
836
|
-
readonly delta: Schema.String;
|
|
837
|
-
}> | Schema.Struct<{
|
|
838
|
-
readonly type: Schema.tag<"segment">;
|
|
839
|
-
readonly segment: Schema.Struct<{
|
|
840
|
-
readonly text: Schema.String;
|
|
841
|
-
readonly startSeconds: Schema.Number;
|
|
842
|
-
readonly endSeconds: Schema.Number;
|
|
843
|
-
readonly speaker: Schema.optional<Schema.String>;
|
|
844
|
-
}>;
|
|
845
|
-
}> | Schema.Struct<{
|
|
846
|
-
readonly text: Schema.String;
|
|
847
|
-
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
848
|
-
readonly text: Schema.String;
|
|
849
|
-
readonly startSeconds: Schema.Number;
|
|
850
|
-
readonly endSeconds: Schema.Number;
|
|
851
|
-
readonly speaker: Schema.optional<Schema.String>;
|
|
852
|
-
}>>>;
|
|
853
|
-
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
854
|
-
readonly text: Schema.String;
|
|
855
|
-
readonly startSeconds: Schema.Number;
|
|
856
|
-
readonly endSeconds: Schema.Number;
|
|
857
|
-
readonly speaker: Schema.optional<Schema.String>;
|
|
858
|
-
readonly confidence: Schema.optional<Schema.Number>;
|
|
859
|
-
}>>>;
|
|
860
|
-
readonly language: Schema.optional<Schema.String>;
|
|
861
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
862
|
-
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
863
|
-
readonly type: Schema.Literal<"tokens">;
|
|
864
|
-
readonly input: Schema.optional<Schema.Number>;
|
|
865
|
-
readonly output: Schema.optional<Schema.Number>;
|
|
866
|
-
readonly total: Schema.optional<Schema.Number>;
|
|
867
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
868
|
-
}>, Schema.Struct<{
|
|
869
|
-
readonly type: Schema.Literal<"seconds">;
|
|
870
|
-
readonly seconds: Schema.Number;
|
|
871
|
-
}>, Schema.Struct<{
|
|
872
|
-
readonly type: Schema.Literal<"characters">;
|
|
873
|
-
readonly characters: Schema.Number;
|
|
874
|
-
}>, Schema.Struct<{
|
|
875
|
-
readonly type: Schema.Literal<"credits">;
|
|
876
|
-
readonly credits: Schema.Number;
|
|
877
|
-
}>, Schema.Struct<{
|
|
878
|
-
readonly type: Schema.Literal<"compute">;
|
|
879
|
-
readonly seconds: Schema.Number;
|
|
880
|
-
}>]>>;
|
|
881
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
882
|
-
readonly type: Schema.tag<"finish">;
|
|
883
|
-
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta">]: never; }, OrElse extends (value: Exclude<{
|
|
838
|
+
<Handlers, OrElse>(value: {
|
|
884
839
|
readonly type: "text-delta";
|
|
885
840
|
readonly delta: string;
|
|
886
841
|
} | {
|
|
@@ -943,10 +898,81 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
943
898
|
};
|
|
944
899
|
} | undefined;
|
|
945
900
|
readonly type: "finish";
|
|
946
|
-
},
|
|
901
|
+
}, cases: Handlers & {
|
|
902
|
+
readonly finish?: ((value: {
|
|
903
|
+
readonly text: string;
|
|
904
|
+
readonly segments?: readonly {
|
|
905
|
+
readonly text: string;
|
|
906
|
+
readonly startSeconds: number;
|
|
907
|
+
readonly endSeconds: number;
|
|
908
|
+
readonly speaker?: string | undefined;
|
|
909
|
+
}[] | undefined;
|
|
910
|
+
readonly words?: readonly {
|
|
911
|
+
readonly text: string;
|
|
912
|
+
readonly startSeconds: number;
|
|
913
|
+
readonly endSeconds: number;
|
|
914
|
+
readonly speaker?: string | undefined;
|
|
915
|
+
readonly confidence?: number | undefined;
|
|
916
|
+
}[] | undefined;
|
|
917
|
+
readonly language?: string | undefined;
|
|
918
|
+
readonly durationSeconds?: number | undefined;
|
|
919
|
+
readonly usage?: {
|
|
920
|
+
readonly type: "seconds";
|
|
921
|
+
readonly seconds: number;
|
|
922
|
+
} | {
|
|
923
|
+
readonly type: "characters";
|
|
924
|
+
readonly characters: number;
|
|
925
|
+
} | {
|
|
926
|
+
readonly type: "credits";
|
|
927
|
+
readonly credits: number;
|
|
928
|
+
} | {
|
|
929
|
+
readonly type: "compute";
|
|
930
|
+
readonly seconds: number;
|
|
931
|
+
} | {
|
|
932
|
+
readonly type: "tokens";
|
|
933
|
+
readonly input?: number | undefined;
|
|
934
|
+
readonly output?: number | undefined;
|
|
935
|
+
readonly total?: number | undefined;
|
|
936
|
+
readonly details?: {
|
|
937
|
+
readonly [x: string]: unknown;
|
|
938
|
+
} | undefined;
|
|
939
|
+
} | undefined;
|
|
940
|
+
readonly providerMetadata?: {
|
|
941
|
+
readonly [x: string]: {
|
|
942
|
+
readonly [x: string]: unknown;
|
|
943
|
+
};
|
|
944
|
+
} | undefined;
|
|
945
|
+
readonly type: "finish";
|
|
946
|
+
}) => any) | undefined;
|
|
947
|
+
readonly "generation-progress"?: ((value: {
|
|
948
|
+
readonly type: "generation-progress";
|
|
949
|
+
readonly id: string;
|
|
950
|
+
readonly progress?: number | undefined;
|
|
951
|
+
}) => any) | undefined;
|
|
952
|
+
readonly "generation-queued"?: ((value: {
|
|
953
|
+
readonly type: "generation-queued";
|
|
954
|
+
readonly id: string;
|
|
955
|
+
readonly position?: number | undefined;
|
|
956
|
+
}) => any) | undefined;
|
|
957
|
+
readonly segment?: ((value: {
|
|
958
|
+
readonly type: "segment";
|
|
959
|
+
readonly segment: {
|
|
960
|
+
readonly text: string;
|
|
961
|
+
readonly startSeconds: number;
|
|
962
|
+
readonly endSeconds: number;
|
|
963
|
+
readonly speaker?: string | undefined;
|
|
964
|
+
};
|
|
965
|
+
}) => any) | undefined;
|
|
966
|
+
readonly "text-delta"?: ((value: {
|
|
967
|
+
readonly type: "text-delta";
|
|
968
|
+
readonly delta: string;
|
|
969
|
+
}) => any) | undefined;
|
|
970
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
947
971
|
readonly type: "text-delta";
|
|
948
972
|
readonly delta: string;
|
|
949
|
-
}
|
|
973
|
+
}, {
|
|
974
|
+
readonly type: keyof Handlers;
|
|
975
|
+
}> | Exclude<{
|
|
950
976
|
readonly type: "segment";
|
|
951
977
|
readonly segment: {
|
|
952
978
|
readonly text: string;
|
|
@@ -954,15 +980,21 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
954
980
|
readonly endSeconds: number;
|
|
955
981
|
readonly speaker?: string | undefined;
|
|
956
982
|
};
|
|
957
|
-
}
|
|
983
|
+
}, {
|
|
984
|
+
readonly type: keyof Handlers;
|
|
985
|
+
}> | Exclude<{
|
|
958
986
|
readonly type: "generation-queued";
|
|
959
987
|
readonly id: string;
|
|
960
988
|
readonly position?: number | undefined;
|
|
961
|
-
}
|
|
989
|
+
}, {
|
|
990
|
+
readonly type: keyof Handlers;
|
|
991
|
+
}> | Exclude<{
|
|
962
992
|
readonly type: "generation-progress";
|
|
963
993
|
readonly id: string;
|
|
964
994
|
readonly progress?: number | undefined;
|
|
965
|
-
}
|
|
995
|
+
}, {
|
|
996
|
+
readonly type: keyof Handlers;
|
|
997
|
+
}> | Exclude<{
|
|
966
998
|
readonly text: string;
|
|
967
999
|
readonly segments?: readonly {
|
|
968
1000
|
readonly text: string;
|
|
@@ -1006,68 +1038,84 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1006
1038
|
};
|
|
1007
1039
|
} | undefined;
|
|
1008
1040
|
readonly type: "finish";
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
readonly
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
readonly
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
readonly type:
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
readonly type:
|
|
1060
|
-
readonly
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1041
|
+
}, {
|
|
1042
|
+
readonly type: keyof Handlers;
|
|
1043
|
+
}>) => 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)>;
|
|
1044
|
+
<Handlers, OrElse>(cases: Handlers & {
|
|
1045
|
+
readonly finish?: ((value: {
|
|
1046
|
+
readonly text: string;
|
|
1047
|
+
readonly segments?: readonly {
|
|
1048
|
+
readonly text: string;
|
|
1049
|
+
readonly startSeconds: number;
|
|
1050
|
+
readonly endSeconds: number;
|
|
1051
|
+
readonly speaker?: string | undefined;
|
|
1052
|
+
}[] | undefined;
|
|
1053
|
+
readonly words?: readonly {
|
|
1054
|
+
readonly text: string;
|
|
1055
|
+
readonly startSeconds: number;
|
|
1056
|
+
readonly endSeconds: number;
|
|
1057
|
+
readonly speaker?: string | undefined;
|
|
1058
|
+
readonly confidence?: number | undefined;
|
|
1059
|
+
}[] | undefined;
|
|
1060
|
+
readonly language?: string | undefined;
|
|
1061
|
+
readonly durationSeconds?: number | undefined;
|
|
1062
|
+
readonly usage?: {
|
|
1063
|
+
readonly type: "seconds";
|
|
1064
|
+
readonly seconds: number;
|
|
1065
|
+
} | {
|
|
1066
|
+
readonly type: "characters";
|
|
1067
|
+
readonly characters: number;
|
|
1068
|
+
} | {
|
|
1069
|
+
readonly type: "credits";
|
|
1070
|
+
readonly credits: number;
|
|
1071
|
+
} | {
|
|
1072
|
+
readonly type: "compute";
|
|
1073
|
+
readonly seconds: number;
|
|
1074
|
+
} | {
|
|
1075
|
+
readonly type: "tokens";
|
|
1076
|
+
readonly input?: number | undefined;
|
|
1077
|
+
readonly output?: number | undefined;
|
|
1078
|
+
readonly total?: number | undefined;
|
|
1079
|
+
readonly details?: {
|
|
1080
|
+
readonly [x: string]: unknown;
|
|
1081
|
+
} | undefined;
|
|
1082
|
+
} | undefined;
|
|
1083
|
+
readonly providerMetadata?: {
|
|
1084
|
+
readonly [x: string]: {
|
|
1085
|
+
readonly [x: string]: unknown;
|
|
1086
|
+
};
|
|
1087
|
+
} | undefined;
|
|
1088
|
+
readonly type: "finish";
|
|
1089
|
+
}) => any) | undefined;
|
|
1090
|
+
readonly "generation-progress"?: ((value: {
|
|
1091
|
+
readonly type: "generation-progress";
|
|
1092
|
+
readonly id: string;
|
|
1093
|
+
readonly progress?: number | undefined;
|
|
1094
|
+
}) => any) | undefined;
|
|
1095
|
+
readonly "generation-queued"?: ((value: {
|
|
1096
|
+
readonly type: "generation-queued";
|
|
1097
|
+
readonly id: string;
|
|
1098
|
+
readonly position?: number | undefined;
|
|
1099
|
+
}) => any) | undefined;
|
|
1100
|
+
readonly segment?: ((value: {
|
|
1101
|
+
readonly type: "segment";
|
|
1102
|
+
readonly segment: {
|
|
1103
|
+
readonly text: string;
|
|
1104
|
+
readonly startSeconds: number;
|
|
1105
|
+
readonly endSeconds: number;
|
|
1106
|
+
readonly speaker?: string | undefined;
|
|
1107
|
+
};
|
|
1108
|
+
}) => any) | undefined;
|
|
1109
|
+
readonly "text-delta"?: ((value: {
|
|
1110
|
+
readonly type: "text-delta";
|
|
1111
|
+
readonly delta: string;
|
|
1112
|
+
}) => any) | undefined;
|
|
1113
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
1068
1114
|
readonly type: "text-delta";
|
|
1069
1115
|
readonly delta: string;
|
|
1070
|
-
}
|
|
1116
|
+
}, {
|
|
1117
|
+
readonly type: keyof Handlers;
|
|
1118
|
+
}> | Exclude<{
|
|
1071
1119
|
readonly type: "segment";
|
|
1072
1120
|
readonly segment: {
|
|
1073
1121
|
readonly text: string;
|
|
@@ -1075,15 +1123,21 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1075
1123
|
readonly endSeconds: number;
|
|
1076
1124
|
readonly speaker?: string | undefined;
|
|
1077
1125
|
};
|
|
1078
|
-
}
|
|
1126
|
+
}, {
|
|
1127
|
+
readonly type: keyof Handlers;
|
|
1128
|
+
}> | Exclude<{
|
|
1079
1129
|
readonly type: "generation-queued";
|
|
1080
1130
|
readonly id: string;
|
|
1081
1131
|
readonly position?: number | undefined;
|
|
1082
|
-
}
|
|
1132
|
+
}, {
|
|
1133
|
+
readonly type: keyof Handlers;
|
|
1134
|
+
}> | Exclude<{
|
|
1083
1135
|
readonly type: "generation-progress";
|
|
1084
1136
|
readonly id: string;
|
|
1085
1137
|
readonly progress?: number | undefined;
|
|
1086
|
-
}
|
|
1138
|
+
}, {
|
|
1139
|
+
readonly type: keyof Handlers;
|
|
1140
|
+
}> | Exclude<{
|
|
1087
1141
|
readonly text: string;
|
|
1088
1142
|
readonly segments?: readonly {
|
|
1089
1143
|
readonly text: string;
|
|
@@ -1127,7 +1181,9 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1127
1181
|
};
|
|
1128
1182
|
} | undefined;
|
|
1129
1183
|
readonly type: "finish";
|
|
1130
|
-
}, {
|
|
1184
|
+
}, {
|
|
1185
|
+
readonly type: keyof Handlers;
|
|
1186
|
+
}>) => any)): (value: {
|
|
1131
1187
|
readonly type: "text-delta";
|
|
1132
1188
|
readonly delta: string;
|
|
1133
1189
|
} | {
|
|
@@ -1190,7 +1246,7 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1190
1246
|
};
|
|
1191
1247
|
} | undefined;
|
|
1192
1248
|
readonly type: "finish";
|
|
1193
|
-
}) => import("effect/Unify").Unify<{ [K in keyof
|
|
1249
|
+
}) => 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)>;
|
|
1194
1250
|
};
|
|
1195
1251
|
} & {
|
|
1196
1252
|
is: {
|