@opencode/ai 0.0.0-dev-416 → 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.
Files changed (52) hide show
  1. package/README.md +2 -0
  2. package/dist/image.d.ts +336 -400
  3. package/dist/providers/alibaba.d.ts +1 -1
  4. package/dist/providers/anthropic-compatible.d.ts +2 -2
  5. package/dist/providers/anthropic-compatible.js +2 -5
  6. package/dist/providers/anthropic.d.ts +2 -2
  7. package/dist/providers/anthropic.js +2 -7
  8. package/dist/providers/assemblyai.d.ts +1 -1
  9. package/dist/providers/assemblyai.js +2 -7
  10. package/dist/providers/azure.d.ts +1 -1
  11. package/dist/providers/azure.js +2 -4
  12. package/dist/providers/baseten.d.ts +1 -1
  13. package/dist/providers/cerebras.d.ts +1 -1
  14. package/dist/providers/cloudflare-ai-gateway.d.ts +2 -2
  15. package/dist/providers/cloudflare-ai-gateway.js +4 -5
  16. package/dist/providers/cloudflare-workers-ai.d.ts +1 -1
  17. package/dist/providers/cohere.d.ts +1 -1
  18. package/dist/providers/deepgram.d.ts +1 -1
  19. package/dist/providers/deepgram.js +2 -7
  20. package/dist/providers/deepinfra.d.ts +1 -1
  21. package/dist/providers/deepseek.d.ts +1 -1
  22. package/dist/providers/digitalocean.d.ts +1 -1
  23. package/dist/providers/elevenlabs.d.ts +1 -1
  24. package/dist/providers/elevenlabs.js +2 -7
  25. package/dist/providers/fireworks.d.ts +1 -1
  26. package/dist/providers/google/interactions.d.ts +1 -1
  27. package/dist/providers/google.d.ts +2 -2
  28. package/dist/providers/google.js +2 -7
  29. package/dist/providers/groq.d.ts +1 -1
  30. package/dist/providers/meta.d.ts +1 -1
  31. package/dist/providers/minimax.d.ts +1 -1
  32. package/dist/providers/mistral.d.ts +1 -1
  33. package/dist/providers/moonshot.d.ts +1 -1
  34. package/dist/providers/openai-compatible-responses.d.ts +1 -1
  35. package/dist/providers/openai-compatible.d.ts +1 -1
  36. package/dist/providers/openai.d.ts +1 -1
  37. package/dist/providers/opencode.d.ts +1 -1
  38. package/dist/providers/openrouter.d.ts +1 -1
  39. package/dist/providers/togetherai.d.ts +1 -1
  40. package/dist/providers/typesafe-ai.d.ts +1 -1
  41. package/dist/providers/venice.d.ts +1 -1
  42. package/dist/providers/vercel-ai-gateway.d.ts +1 -1
  43. package/dist/providers/xai.d.ts +1 -1
  44. package/dist/providers/zai-coding-plan.d.ts +1 -1
  45. package/dist/providers/zai.d.ts +1 -1
  46. package/dist/route/auth-options.d.ts +9 -5
  47. package/dist/route/auth-options.js +10 -7
  48. package/dist/schema/events.d.ts +2456 -2168
  49. package/dist/speech.d.ts +290 -294
  50. package/dist/transcription.d.ts +298 -242
  51. package/dist/video.d.ts +252 -264
  52. package/package.json +5 -5
@@ -579,64 +579,70 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
579
579
  };
580
580
  };
581
581
  readonly match: {
582
- <Cases extends { [M in Schema.Struct<{
583
- readonly type: Schema.tag<"generation-queued">;
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 startSeconds: Schema.Number;
598
- readonly endSeconds: Schema.Number;
599
- readonly speaker: Schema.optional<Schema.String>;
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
- }> | Schema.Struct<{
602
- readonly text: Schema.String;
603
- readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
604
- readonly text: Schema.String;
605
- readonly startSeconds: Schema.Number;
606
- readonly endSeconds: Schema.Number;
607
- readonly speaker: Schema.optional<Schema.String>;
608
- }>>>;
609
- readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
610
- readonly text: Schema.String;
611
- readonly startSeconds: Schema.Number;
612
- readonly endSeconds: Schema.Number;
613
- readonly speaker: Schema.optional<Schema.String>;
614
- readonly confidence: Schema.optional<Schema.Number>;
615
- }>>>;
616
- readonly language: Schema.optional<Schema.String>;
617
- readonly durationSeconds: Schema.optional<Schema.Number>;
618
- readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
619
- readonly type: Schema.Literal<"tokens">;
620
- readonly input: Schema.optional<Schema.Number>;
621
- readonly output: Schema.optional<Schema.Number>;
622
- readonly total: Schema.optional<Schema.Number>;
623
- readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
624
- }>, Schema.Struct<{
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: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
703
- <Cases extends { [M in Schema.Struct<{
704
- readonly type: Schema.tag<"generation-queued">;
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 startSeconds: Schema.Number;
719
- readonly endSeconds: Schema.Number;
720
- readonly speaker: Schema.optional<Schema.String>;
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
- }> | Schema.Struct<{
723
- readonly text: Schema.String;
724
- readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
725
- readonly text: Schema.String;
726
- readonly startSeconds: Schema.Number;
727
- readonly endSeconds: Schema.Number;
728
- readonly speaker: Schema.optional<Schema.String>;
729
- }>>>;
730
- readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
731
- readonly text: Schema.String;
732
- readonly startSeconds: Schema.Number;
733
- readonly endSeconds: Schema.Number;
734
- readonly speaker: Schema.optional<Schema.String>;
735
- readonly confidence: Schema.optional<Schema.Number>;
736
- }>>>;
737
- readonly language: Schema.optional<Schema.String>;
738
- readonly durationSeconds: Schema.optional<Schema.Number>;
739
- readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
740
- readonly type: Schema.Literal<"tokens">;
741
- readonly input: Schema.optional<Schema.Number>;
742
- readonly output: Schema.optional<Schema.Number>;
743
- readonly total: Schema.optional<Schema.Number>;
744
- readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
745
- }>, Schema.Struct<{
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
- }) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
835
+ }) => import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]>>;
824
836
  };
825
837
  readonly matchOrElse: {
826
- <Cases extends { [M in Schema.Struct<{
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
- }, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
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
- }, 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>>;
1010
- <Cases extends { [M in Schema.Struct<{
1011
- readonly type: Schema.tag<"generation-queued">;
1012
- readonly id: Schema.String;
1013
- readonly position: Schema.optional<Schema.Number>;
1014
- }> | Schema.Struct<{
1015
- readonly type: Schema.tag<"generation-progress">;
1016
- readonly id: Schema.String;
1017
- readonly progress: Schema.optional<Schema.Number>;
1018
- }> | Schema.Struct<{
1019
- readonly type: Schema.tag<"text-delta">;
1020
- readonly delta: Schema.String;
1021
- }> | Schema.Struct<{
1022
- readonly type: Schema.tag<"segment">;
1023
- readonly segment: Schema.Struct<{
1024
- readonly text: Schema.String;
1025
- readonly startSeconds: Schema.Number;
1026
- readonly endSeconds: Schema.Number;
1027
- readonly speaker: Schema.optional<Schema.String>;
1028
- }>;
1029
- }> | Schema.Struct<{
1030
- readonly text: Schema.String;
1031
- readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
1032
- readonly text: Schema.String;
1033
- readonly startSeconds: Schema.Number;
1034
- readonly endSeconds: Schema.Number;
1035
- readonly speaker: Schema.optional<Schema.String>;
1036
- }>>>;
1037
- readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
1038
- readonly text: Schema.String;
1039
- readonly startSeconds: Schema.Number;
1040
- readonly endSeconds: Schema.Number;
1041
- readonly speaker: Schema.optional<Schema.String>;
1042
- readonly confidence: Schema.optional<Schema.Number>;
1043
- }>>>;
1044
- readonly language: Schema.optional<Schema.String>;
1045
- readonly durationSeconds: Schema.optional<Schema.Number>;
1046
- readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1047
- readonly type: Schema.Literal<"tokens">;
1048
- readonly input: Schema.optional<Schema.Number>;
1049
- readonly output: Schema.optional<Schema.Number>;
1050
- readonly total: Schema.optional<Schema.Number>;
1051
- readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1052
- }>, Schema.Struct<{
1053
- readonly type: Schema.Literal<"seconds">;
1054
- readonly seconds: Schema.Number;
1055
- }>, Schema.Struct<{
1056
- readonly type: Schema.Literal<"characters">;
1057
- readonly characters: Schema.Number;
1058
- }>, Schema.Struct<{
1059
- readonly type: Schema.Literal<"credits">;
1060
- readonly credits: Schema.Number;
1061
- }>, Schema.Struct<{
1062
- readonly type: Schema.Literal<"compute">;
1063
- readonly seconds: Schema.Number;
1064
- }>]>>;
1065
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1066
- readonly type: Schema.tag<"finish">;
1067
- }> 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<{
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
- }, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
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 Cases]-?: NonNullable<Cases[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
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: {