@opencode/ai 2.0.32 → 2.1.0

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/speech.d.ts CHANGED
@@ -349,28 +349,10 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
349
349
  }>]> & {
350
350
  readonly discriminants: readonly ["generation-queued", "generation-progress", "audio-delta", "timestamps", "finish"];
351
351
  readonly cases: {
352
- "generation-queued": Schema.Struct<{
353
- readonly type: Schema.tag<"generation-queued">;
354
- readonly id: Schema.String;
355
- readonly position: Schema.optional<Schema.Number>;
356
- }>;
357
- "generation-progress": Schema.Struct<{
358
- readonly type: Schema.tag<"generation-progress">;
359
- readonly id: Schema.String;
360
- readonly progress: Schema.optional<Schema.Number>;
361
- }>;
362
352
  "audio-delta": Schema.Struct<{
363
353
  readonly type: Schema.tag<"audio-delta">;
364
354
  readonly chunk: Schema.Uint8Array;
365
355
  }>;
366
- timestamps: Schema.Struct<{
367
- readonly type: Schema.tag<"timestamps">;
368
- readonly items: Schema.$Array<Schema.Struct<{
369
- readonly text: Schema.String;
370
- readonly startSeconds: Schema.Number;
371
- readonly endSeconds: Schema.Number;
372
- }>>;
373
- }>;
374
356
  finish: Schema.Struct<{
375
357
  readonly type: Schema.tag<"finish">;
376
358
  readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
@@ -430,14 +412,32 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
430
412
  }>>>;
431
413
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
432
414
  }>;
415
+ "generation-progress": Schema.Struct<{
416
+ readonly type: Schema.tag<"generation-progress">;
417
+ readonly id: Schema.String;
418
+ readonly progress: Schema.optional<Schema.Number>;
419
+ }>;
420
+ "generation-queued": Schema.Struct<{
421
+ readonly type: Schema.tag<"generation-queued">;
422
+ readonly id: Schema.String;
423
+ readonly position: Schema.optional<Schema.Number>;
424
+ }>;
425
+ timestamps: Schema.Struct<{
426
+ readonly type: Schema.tag<"timestamps">;
427
+ readonly items: Schema.$Array<Schema.Struct<{
428
+ readonly text: Schema.String;
429
+ readonly startSeconds: Schema.Number;
430
+ readonly endSeconds: Schema.Number;
431
+ }>>;
432
+ }>;
433
433
  };
434
434
  readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
435
- readonly id: string;
436
435
  readonly type: "generation-queued";
436
+ readonly id: string;
437
437
  readonly position?: number | undefined;
438
438
  } | {
439
- readonly id: string;
440
439
  readonly type: "generation-progress";
440
+ readonly id: string;
441
441
  readonly progress?: number | undefined;
442
442
  } | {
443
443
  readonly type: "audio-delta";
@@ -452,11 +452,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
452
452
  } | {
453
453
  readonly type: "finish";
454
454
  readonly audio: Media.Asset;
455
- readonly providerMetadata?: {
456
- readonly [x: string]: {
457
- readonly [x: string]: unknown;
458
- };
459
- } | undefined;
460
455
  readonly usage?: {
461
456
  readonly type: "tokens";
462
457
  readonly input?: number | undefined;
@@ -479,7 +474,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
479
474
  readonly seconds: number;
480
475
  } | undefined;
481
476
  readonly notices?: readonly {
482
- readonly type: "other" | "moderated" | "filtered";
477
+ readonly type: "filtered" | "moderated" | "other";
483
478
  readonly message: string;
484
479
  readonly providerMetadata?: {
485
480
  readonly [x: string]: {
@@ -487,15 +482,20 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
487
482
  };
488
483
  } | undefined;
489
484
  }[] | undefined;
485
+ readonly providerMetadata?: {
486
+ readonly [x: string]: {
487
+ readonly [x: string]: unknown;
488
+ };
489
+ } | undefined;
490
490
  }) => value is Extract<{
491
- readonly id: string;
492
491
  readonly type: "generation-queued";
492
+ readonly id: string;
493
493
  readonly position?: number | undefined;
494
494
  }, {
495
495
  readonly type: Keys;
496
496
  }> | Extract<{
497
- readonly id: string;
498
497
  readonly type: "generation-progress";
498
+ readonly id: string;
499
499
  readonly progress?: number | undefined;
500
500
  }, {
501
501
  readonly type: Keys;
@@ -516,11 +516,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
516
516
  }> | Extract<{
517
517
  readonly type: "finish";
518
518
  readonly audio: Media.Asset;
519
- readonly providerMetadata?: {
520
- readonly [x: string]: {
521
- readonly [x: string]: unknown;
522
- };
523
- } | undefined;
524
519
  readonly usage?: {
525
520
  readonly type: "tokens";
526
521
  readonly input?: number | undefined;
@@ -543,7 +538,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
543
538
  readonly seconds: number;
544
539
  } | undefined;
545
540
  readonly notices?: readonly {
546
- readonly type: "other" | "moderated" | "filtered";
541
+ readonly type: "filtered" | "moderated" | "other";
547
542
  readonly message: string;
548
543
  readonly providerMetadata?: {
549
544
  readonly [x: string]: {
@@ -551,40 +546,22 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
551
546
  };
552
547
  } | undefined;
553
548
  }[] | undefined;
549
+ readonly providerMetadata?: {
550
+ readonly [x: string]: {
551
+ readonly [x: string]: unknown;
552
+ };
553
+ } | undefined;
554
554
  }, {
555
555
  readonly type: Keys;
556
556
  }>;
557
557
  readonly guards: {
558
- "generation-queued": (u: unknown) => u is {
559
- readonly id: string;
560
- readonly type: "generation-queued";
561
- readonly position?: number | undefined;
562
- };
563
- "generation-progress": (u: unknown) => u is {
564
- readonly id: string;
565
- readonly type: "generation-progress";
566
- readonly progress?: number | undefined;
567
- };
568
558
  "audio-delta": (u: unknown) => u is {
569
559
  readonly type: "audio-delta";
570
560
  readonly chunk: Uint8Array<ArrayBufferLike>;
571
561
  };
572
- timestamps: (u: unknown) => u is {
573
- readonly type: "timestamps";
574
- readonly items: readonly {
575
- readonly text: string;
576
- readonly startSeconds: number;
577
- readonly endSeconds: number;
578
- }[];
579
- };
580
562
  finish: (u: unknown) => u is {
581
563
  readonly type: "finish";
582
564
  readonly audio: Media.Asset;
583
- readonly providerMetadata?: {
584
- readonly [x: string]: {
585
- readonly [x: string]: unknown;
586
- };
587
- } | undefined;
588
565
  readonly usage?: {
589
566
  readonly type: "tokens";
590
567
  readonly input?: number | undefined;
@@ -607,7 +584,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
607
584
  readonly seconds: number;
608
585
  } | undefined;
609
586
  readonly notices?: readonly {
610
- readonly type: "other" | "moderated" | "filtered";
587
+ readonly type: "filtered" | "moderated" | "other";
611
588
  readonly message: string;
612
589
  readonly providerMetadata?: {
613
590
  readonly [x: string]: {
@@ -615,78 +592,115 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
615
592
  };
616
593
  } | undefined;
617
594
  }[] | undefined;
595
+ readonly providerMetadata?: {
596
+ readonly [x: string]: {
597
+ readonly [x: string]: unknown;
598
+ };
599
+ } | undefined;
600
+ };
601
+ "generation-progress": (u: unknown) => u is {
602
+ readonly type: "generation-progress";
603
+ readonly id: string;
604
+ readonly progress?: number | undefined;
605
+ };
606
+ "generation-queued": (u: unknown) => u is {
607
+ readonly type: "generation-queued";
608
+ readonly id: string;
609
+ readonly position?: number | undefined;
610
+ };
611
+ timestamps: (u: unknown) => u is {
612
+ readonly type: "timestamps";
613
+ readonly items: readonly {
614
+ readonly text: string;
615
+ readonly startSeconds: number;
616
+ readonly endSeconds: number;
617
+ }[];
618
618
  };
619
619
  };
620
620
  readonly match: {
621
- <Cases extends {
622
- "generation-queued": (value: {
623
- readonly id: string;
624
- readonly type: "generation-queued";
625
- readonly position?: number | undefined;
626
- }) => any;
627
- "generation-progress": (value: {
628
- readonly id: string;
629
- readonly type: "generation-progress";
630
- readonly progress?: number | undefined;
631
- }) => any;
632
- "audio-delta": (value: {
633
- readonly type: "audio-delta";
634
- readonly chunk: Uint8Array<ArrayBufferLike>;
635
- }) => any;
636
- timestamps: (value: {
637
- readonly type: "timestamps";
638
- readonly items: readonly {
639
- readonly text: string;
640
- readonly startSeconds: number;
641
- readonly endSeconds: number;
642
- }[];
643
- }) => any;
644
- finish: (value: {
645
- readonly type: "finish";
646
- readonly audio: Media.Asset;
647
- readonly providerMetadata?: {
648
- readonly [x: string]: {
649
- readonly [x: string]: unknown;
650
- };
651
- } | undefined;
652
- readonly usage?: {
653
- readonly type: "tokens";
654
- readonly input?: number | undefined;
655
- readonly output?: number | undefined;
656
- readonly total?: number | undefined;
657
- readonly details?: {
658
- readonly [x: string]: unknown;
659
- } | undefined;
660
- } | {
661
- readonly type: "seconds";
662
- readonly seconds: number;
663
- } | {
664
- readonly type: "characters";
665
- readonly characters: number;
666
- } | {
667
- readonly type: "credits";
668
- readonly credits: number;
669
- } | {
670
- readonly type: "compute";
671
- readonly seconds: number;
672
- } | undefined;
673
- readonly notices?: readonly {
674
- readonly type: "other" | "moderated" | "filtered";
675
- readonly message: string;
676
- readonly providerMetadata?: {
677
- readonly [x: string]: {
678
- readonly [x: string]: unknown;
679
- };
680
- } | undefined;
681
- }[] | undefined;
682
- }) => any;
683
- }>(value: {
684
- readonly id: string;
621
+ <Cases extends { [M in Schema.Struct<{
622
+ readonly type: Schema.tag<"generation-queued">;
623
+ readonly id: Schema.String;
624
+ readonly position: Schema.optional<Schema.Number>;
625
+ }> | Schema.Struct<{
626
+ readonly type: Schema.tag<"generation-progress">;
627
+ readonly id: Schema.String;
628
+ readonly progress: Schema.optional<Schema.Number>;
629
+ }> | Schema.Struct<{
630
+ readonly type: Schema.tag<"audio-delta">;
631
+ readonly chunk: Schema.Uint8Array;
632
+ }> | Schema.Struct<{
633
+ readonly type: Schema.tag<"timestamps">;
634
+ readonly items: Schema.$Array<Schema.Struct<{
635
+ readonly text: Schema.String;
636
+ readonly startSeconds: Schema.Number;
637
+ readonly endSeconds: Schema.Number;
638
+ }>>;
639
+ }> | Schema.Struct<{
640
+ readonly type: Schema.tag<"finish">;
641
+ readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
642
+ readonly source: Schema.Union<readonly [Schema.Struct<{
643
+ readonly type: Schema.Literal<"bytes">;
644
+ readonly data: Schema.Uint8Array;
645
+ readonly mediaType: Schema.String;
646
+ }>, Schema.Struct<{
647
+ readonly type: Schema.Literal<"base64">;
648
+ readonly data: Schema.String;
649
+ readonly mediaType: Schema.String;
650
+ }>, Schema.Struct<{
651
+ readonly type: Schema.Literal<"url">;
652
+ readonly url: Schema.String;
653
+ readonly mediaType: Schema.optional<Schema.String>;
654
+ readonly expiresAt: Schema.optional<Schema.Number>;
655
+ }>, Schema.Struct<{
656
+ readonly type: Schema.Literal<"ref">;
657
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
658
+ readonly id: Schema.String;
659
+ readonly mediaType: Schema.optional<Schema.String>;
660
+ }>]>;
661
+ readonly info: Schema.optional<Schema.Struct<{
662
+ readonly width: Schema.optional<Schema.Number>;
663
+ readonly height: Schema.optional<Schema.Number>;
664
+ readonly durationSeconds: Schema.optional<Schema.Number>;
665
+ readonly sampleRate: Schema.optional<Schema.Number>;
666
+ readonly channels: Schema.optional<Schema.Number>;
667
+ readonly encoding: Schema.optional<Schema.String>;
668
+ readonly format: Schema.optional<Schema.String>;
669
+ }>>;
670
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
671
+ }>, never, never>;
672
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
673
+ readonly type: Schema.Literal<"tokens">;
674
+ readonly input: Schema.optional<Schema.Number>;
675
+ readonly output: Schema.optional<Schema.Number>;
676
+ readonly total: Schema.optional<Schema.Number>;
677
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
678
+ }>, Schema.Struct<{
679
+ readonly type: Schema.Literal<"seconds">;
680
+ readonly seconds: Schema.Number;
681
+ }>, Schema.Struct<{
682
+ readonly type: Schema.Literal<"characters">;
683
+ readonly characters: Schema.Number;
684
+ }>, Schema.Struct<{
685
+ readonly type: Schema.Literal<"credits">;
686
+ readonly credits: Schema.Number;
687
+ }>, Schema.Struct<{
688
+ readonly type: Schema.Literal<"compute">;
689
+ readonly seconds: Schema.Number;
690
+ }>]>>;
691
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
692
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
693
+ readonly message: Schema.String;
694
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
695
+ }>>>;
696
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
697
+ }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
685
698
  readonly type: "generation-queued";
699
+ readonly id: string;
686
700
  readonly position?: number | undefined;
687
701
  } | {
688
- readonly id: string;
689
702
  readonly type: "generation-progress";
703
+ readonly id: string;
690
704
  readonly progress?: number | undefined;
691
705
  } | {
692
706
  readonly type: "audio-delta";
@@ -701,11 +715,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
701
715
  } | {
702
716
  readonly type: "finish";
703
717
  readonly audio: Media.Asset;
704
- readonly providerMetadata?: {
705
- readonly [x: string]: {
706
- readonly [x: string]: unknown;
707
- };
708
- } | undefined;
709
718
  readonly usage?: {
710
719
  readonly type: "tokens";
711
720
  readonly input?: number | undefined;
@@ -728,7 +737,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
728
737
  readonly seconds: number;
729
738
  } | undefined;
730
739
  readonly notices?: readonly {
731
- readonly type: "other" | "moderated" | "filtered";
740
+ readonly type: "filtered" | "moderated" | "other";
732
741
  readonly message: string;
733
742
  readonly providerMetadata?: {
734
743
  readonly [x: string]: {
@@ -736,76 +745,95 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
736
745
  };
737
746
  } | undefined;
738
747
  }[] | undefined;
748
+ readonly providerMetadata?: {
749
+ readonly [x: string]: {
750
+ readonly [x: string]: unknown;
751
+ };
752
+ } | undefined;
739
753
  }, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
740
- <Cases extends {
741
- "generation-queued": (value: {
742
- readonly id: string;
743
- readonly type: "generation-queued";
744
- readonly position?: number | undefined;
745
- }) => any;
746
- "generation-progress": (value: {
747
- readonly id: string;
748
- readonly type: "generation-progress";
749
- readonly progress?: number | undefined;
750
- }) => any;
751
- "audio-delta": (value: {
752
- readonly type: "audio-delta";
753
- readonly chunk: Uint8Array<ArrayBufferLike>;
754
- }) => any;
755
- timestamps: (value: {
756
- readonly type: "timestamps";
757
- readonly items: readonly {
758
- readonly text: string;
759
- readonly startSeconds: number;
760
- readonly endSeconds: number;
761
- }[];
762
- }) => any;
763
- finish: (value: {
764
- readonly type: "finish";
765
- readonly audio: Media.Asset;
766
- readonly providerMetadata?: {
767
- readonly [x: string]: {
768
- readonly [x: string]: unknown;
769
- };
770
- } | undefined;
771
- readonly usage?: {
772
- readonly type: "tokens";
773
- readonly input?: number | undefined;
774
- readonly output?: number | undefined;
775
- readonly total?: number | undefined;
776
- readonly details?: {
777
- readonly [x: string]: unknown;
778
- } | undefined;
779
- } | {
780
- readonly type: "seconds";
781
- readonly seconds: number;
782
- } | {
783
- readonly type: "characters";
784
- readonly characters: number;
785
- } | {
786
- readonly type: "credits";
787
- readonly credits: number;
788
- } | {
789
- readonly type: "compute";
790
- readonly seconds: number;
791
- } | undefined;
792
- readonly notices?: readonly {
793
- readonly type: "other" | "moderated" | "filtered";
794
- readonly message: string;
795
- readonly providerMetadata?: {
796
- readonly [x: string]: {
797
- readonly [x: string]: unknown;
798
- };
799
- } | undefined;
800
- }[] | undefined;
801
- }) => any;
802
- }>(cases: Cases): (value: {
803
- readonly id: string;
754
+ <Cases extends { [M in Schema.Struct<{
755
+ readonly type: Schema.tag<"generation-queued">;
756
+ readonly id: Schema.String;
757
+ readonly position: Schema.optional<Schema.Number>;
758
+ }> | Schema.Struct<{
759
+ readonly type: Schema.tag<"generation-progress">;
760
+ readonly id: Schema.String;
761
+ readonly progress: Schema.optional<Schema.Number>;
762
+ }> | Schema.Struct<{
763
+ readonly type: Schema.tag<"audio-delta">;
764
+ readonly chunk: Schema.Uint8Array;
765
+ }> | Schema.Struct<{
766
+ readonly type: Schema.tag<"timestamps">;
767
+ readonly items: Schema.$Array<Schema.Struct<{
768
+ readonly text: Schema.String;
769
+ readonly startSeconds: Schema.Number;
770
+ readonly endSeconds: Schema.Number;
771
+ }>>;
772
+ }> | Schema.Struct<{
773
+ readonly type: Schema.tag<"finish">;
774
+ readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
775
+ readonly source: Schema.Union<readonly [Schema.Struct<{
776
+ readonly type: Schema.Literal<"bytes">;
777
+ readonly data: Schema.Uint8Array;
778
+ readonly mediaType: Schema.String;
779
+ }>, Schema.Struct<{
780
+ readonly type: Schema.Literal<"base64">;
781
+ readonly data: Schema.String;
782
+ readonly mediaType: Schema.String;
783
+ }>, Schema.Struct<{
784
+ readonly type: Schema.Literal<"url">;
785
+ readonly url: Schema.String;
786
+ readonly mediaType: Schema.optional<Schema.String>;
787
+ readonly expiresAt: Schema.optional<Schema.Number>;
788
+ }>, Schema.Struct<{
789
+ readonly type: Schema.Literal<"ref">;
790
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
791
+ readonly id: Schema.String;
792
+ readonly mediaType: Schema.optional<Schema.String>;
793
+ }>]>;
794
+ readonly info: Schema.optional<Schema.Struct<{
795
+ readonly width: Schema.optional<Schema.Number>;
796
+ readonly height: Schema.optional<Schema.Number>;
797
+ readonly durationSeconds: Schema.optional<Schema.Number>;
798
+ readonly sampleRate: Schema.optional<Schema.Number>;
799
+ readonly channels: Schema.optional<Schema.Number>;
800
+ readonly encoding: Schema.optional<Schema.String>;
801
+ readonly format: Schema.optional<Schema.String>;
802
+ }>>;
803
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
804
+ }>, never, never>;
805
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
806
+ readonly type: Schema.Literal<"tokens">;
807
+ readonly input: Schema.optional<Schema.Number>;
808
+ readonly output: Schema.optional<Schema.Number>;
809
+ readonly total: Schema.optional<Schema.Number>;
810
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
811
+ }>, Schema.Struct<{
812
+ readonly type: Schema.Literal<"seconds">;
813
+ readonly seconds: Schema.Number;
814
+ }>, Schema.Struct<{
815
+ readonly type: Schema.Literal<"characters">;
816
+ readonly characters: Schema.Number;
817
+ }>, Schema.Struct<{
818
+ readonly type: Schema.Literal<"credits">;
819
+ readonly credits: Schema.Number;
820
+ }>, Schema.Struct<{
821
+ readonly type: Schema.Literal<"compute">;
822
+ readonly seconds: Schema.Number;
823
+ }>]>>;
824
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
825
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
826
+ readonly message: Schema.String;
827
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
828
+ }>>>;
829
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
830
+ }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
804
831
  readonly type: "generation-queued";
832
+ readonly id: string;
805
833
  readonly position?: number | undefined;
806
834
  } | {
807
- readonly id: string;
808
835
  readonly type: "generation-progress";
836
+ readonly id: string;
809
837
  readonly progress?: number | undefined;
810
838
  } | {
811
839
  readonly type: "audio-delta";
@@ -820,11 +848,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
820
848
  } | {
821
849
  readonly type: "finish";
822
850
  readonly audio: Media.Asset;
823
- readonly providerMetadata?: {
824
- readonly [x: string]: {
825
- readonly [x: string]: unknown;
826
- };
827
- } | undefined;
828
851
  readonly usage?: {
829
852
  readonly type: "tokens";
830
853
  readonly input?: number | undefined;
@@ -847,7 +870,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
847
870
  readonly seconds: number;
848
871
  } | undefined;
849
872
  readonly notices?: readonly {
850
- readonly type: "other" | "moderated" | "filtered";
873
+ readonly type: "filtered" | "moderated" | "other";
851
874
  readonly message: string;
852
875
  readonly providerMetadata?: {
853
876
  readonly [x: string]: {
@@ -855,105 +878,111 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
855
878
  };
856
879
  } | undefined;
857
880
  }[] | undefined;
881
+ readonly providerMetadata?: {
882
+ readonly [x: string]: {
883
+ readonly [x: string]: unknown;
884
+ };
885
+ } | undefined;
858
886
  }) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
859
887
  };
860
888
  readonly matchOrElse: {
861
- <Cases extends {
862
- "generation-queued"?: ((value: {
863
- readonly id: string;
864
- readonly type: "generation-queued";
865
- readonly position?: number | undefined;
866
- }) => any) | undefined;
867
- "generation-progress"?: ((value: {
868
- readonly id: string;
869
- readonly type: "generation-progress";
870
- readonly progress?: number | undefined;
871
- }) => any) | undefined;
872
- "audio-delta"?: ((value: {
873
- readonly type: "audio-delta";
874
- readonly chunk: Uint8Array<ArrayBufferLike>;
875
- }) => any) | undefined;
876
- timestamps?: ((value: {
877
- readonly type: "timestamps";
878
- readonly items: readonly {
879
- readonly text: string;
880
- readonly startSeconds: number;
881
- readonly endSeconds: number;
882
- }[];
883
- }) => any) | undefined;
884
- finish?: ((value: {
885
- readonly type: "finish";
886
- readonly audio: Media.Asset;
887
- readonly providerMetadata?: {
888
- readonly [x: string]: {
889
- readonly [x: string]: unknown;
890
- };
891
- } | undefined;
892
- readonly usage?: {
893
- readonly type: "tokens";
894
- readonly input?: number | undefined;
895
- readonly output?: number | undefined;
896
- readonly total?: number | undefined;
897
- readonly details?: {
898
- readonly [x: string]: unknown;
899
- } | undefined;
900
- } | {
901
- readonly type: "seconds";
902
- readonly seconds: number;
903
- } | {
904
- readonly type: "characters";
905
- readonly characters: number;
906
- } | {
907
- readonly type: "credits";
908
- readonly credits: number;
909
- } | {
910
- readonly type: "compute";
911
- readonly seconds: number;
912
- } | undefined;
913
- readonly notices?: readonly {
914
- readonly type: "other" | "moderated" | "filtered";
915
- readonly message: string;
916
- readonly providerMetadata?: {
917
- readonly [x: string]: {
918
- readonly [x: string]: unknown;
919
- };
920
- } | undefined;
921
- }[] | undefined;
922
- }) => any) | undefined;
923
- } & { [K in Exclude<keyof Cases, "finish" | "generation-queued" | "generation-progress" | "timestamps" | "audio-delta">]: never; }, OrElse extends (value: Exclude<{
924
- readonly id: string;
889
+ <Cases extends { [M in Schema.Struct<{
890
+ readonly type: Schema.tag<"generation-queued">;
891
+ readonly id: Schema.String;
892
+ readonly position: Schema.optional<Schema.Number>;
893
+ }> | Schema.Struct<{
894
+ readonly type: Schema.tag<"generation-progress">;
895
+ readonly id: Schema.String;
896
+ readonly progress: Schema.optional<Schema.Number>;
897
+ }> | Schema.Struct<{
898
+ readonly type: Schema.tag<"audio-delta">;
899
+ readonly chunk: Schema.Uint8Array;
900
+ }> | Schema.Struct<{
901
+ readonly type: Schema.tag<"timestamps">;
902
+ readonly items: Schema.$Array<Schema.Struct<{
903
+ readonly text: Schema.String;
904
+ readonly startSeconds: Schema.Number;
905
+ readonly endSeconds: Schema.Number;
906
+ }>>;
907
+ }> | Schema.Struct<{
908
+ readonly type: Schema.tag<"finish">;
909
+ readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
910
+ readonly source: Schema.Union<readonly [Schema.Struct<{
911
+ readonly type: Schema.Literal<"bytes">;
912
+ readonly data: Schema.Uint8Array;
913
+ readonly mediaType: Schema.String;
914
+ }>, Schema.Struct<{
915
+ readonly type: Schema.Literal<"base64">;
916
+ readonly data: Schema.String;
917
+ readonly mediaType: Schema.String;
918
+ }>, Schema.Struct<{
919
+ readonly type: Schema.Literal<"url">;
920
+ readonly url: Schema.String;
921
+ readonly mediaType: Schema.optional<Schema.String>;
922
+ readonly expiresAt: Schema.optional<Schema.Number>;
923
+ }>, Schema.Struct<{
924
+ readonly type: Schema.Literal<"ref">;
925
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
926
+ readonly id: Schema.String;
927
+ readonly mediaType: Schema.optional<Schema.String>;
928
+ }>]>;
929
+ readonly info: Schema.optional<Schema.Struct<{
930
+ readonly width: Schema.optional<Schema.Number>;
931
+ readonly height: Schema.optional<Schema.Number>;
932
+ readonly durationSeconds: Schema.optional<Schema.Number>;
933
+ readonly sampleRate: Schema.optional<Schema.Number>;
934
+ readonly channels: Schema.optional<Schema.Number>;
935
+ readonly encoding: Schema.optional<Schema.String>;
936
+ readonly format: Schema.optional<Schema.String>;
937
+ }>>;
938
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
939
+ }>, never, never>;
940
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
941
+ readonly type: Schema.Literal<"tokens">;
942
+ readonly input: Schema.optional<Schema.Number>;
943
+ readonly output: Schema.optional<Schema.Number>;
944
+ readonly total: Schema.optional<Schema.Number>;
945
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
946
+ }>, Schema.Struct<{
947
+ readonly type: Schema.Literal<"seconds">;
948
+ readonly seconds: Schema.Number;
949
+ }>, Schema.Struct<{
950
+ readonly type: Schema.Literal<"characters">;
951
+ readonly characters: Schema.Number;
952
+ }>, Schema.Struct<{
953
+ readonly type: Schema.Literal<"credits">;
954
+ readonly credits: Schema.Number;
955
+ }>, Schema.Struct<{
956
+ readonly type: Schema.Literal<"compute">;
957
+ readonly seconds: Schema.Number;
958
+ }>]>>;
959
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
960
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
961
+ readonly message: Schema.String;
962
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
963
+ }>>>;
964
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
965
+ }> 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<{
925
966
  readonly type: "generation-queued";
926
- readonly position?: number | undefined;
927
- }, {
928
- readonly type: keyof Cases;
929
- }> | Exclude<{
930
967
  readonly id: string;
968
+ readonly position?: number | undefined;
969
+ } | {
931
970
  readonly type: "generation-progress";
971
+ readonly id: string;
932
972
  readonly progress?: number | undefined;
933
- }, {
934
- readonly type: keyof Cases;
935
- }> | Exclude<{
973
+ } | {
936
974
  readonly type: "audio-delta";
937
975
  readonly chunk: Uint8Array<ArrayBufferLike>;
938
- }, {
939
- readonly type: keyof Cases;
940
- }> | Exclude<{
976
+ } | {
941
977
  readonly type: "timestamps";
942
978
  readonly items: readonly {
943
979
  readonly text: string;
944
980
  readonly startSeconds: number;
945
981
  readonly endSeconds: number;
946
982
  }[];
947
- }, {
948
- readonly type: keyof Cases;
949
- }> | Exclude<{
983
+ } | {
950
984
  readonly type: "finish";
951
985
  readonly audio: Media.Asset;
952
- readonly providerMetadata?: {
953
- readonly [x: string]: {
954
- readonly [x: string]: unknown;
955
- };
956
- } | undefined;
957
986
  readonly usage?: {
958
987
  readonly type: "tokens";
959
988
  readonly input?: number | undefined;
@@ -976,7 +1005,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
976
1005
  readonly seconds: number;
977
1006
  } | undefined;
978
1007
  readonly notices?: readonly {
979
- readonly type: "other" | "moderated" | "filtered";
1008
+ readonly type: "filtered" | "moderated" | "other";
980
1009
  readonly message: string;
981
1010
  readonly providerMetadata?: {
982
1011
  readonly [x: string]: {
@@ -984,15 +1013,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
984
1013
  };
985
1014
  } | undefined;
986
1015
  }[] | undefined;
987
- }, {
988
- readonly type: keyof Cases;
989
- }>) => any>(value: {
990
- readonly id: string;
1016
+ readonly providerMetadata?: {
1017
+ readonly [x: string]: {
1018
+ readonly [x: string]: unknown;
1019
+ };
1020
+ } | undefined;
1021
+ }, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
991
1022
  readonly type: "generation-queued";
1023
+ readonly id: string;
992
1024
  readonly position?: number | undefined;
993
1025
  } | {
994
- readonly id: string;
995
1026
  readonly type: "generation-progress";
1027
+ readonly id: string;
996
1028
  readonly progress?: number | undefined;
997
1029
  } | {
998
1030
  readonly type: "audio-delta";
@@ -1007,11 +1039,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1007
1039
  } | {
1008
1040
  readonly type: "finish";
1009
1041
  readonly audio: Media.Asset;
1010
- readonly providerMetadata?: {
1011
- readonly [x: string]: {
1012
- readonly [x: string]: unknown;
1013
- };
1014
- } | undefined;
1015
1042
  readonly usage?: {
1016
1043
  readonly type: "tokens";
1017
1044
  readonly input?: number | undefined;
@@ -1034,7 +1061,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1034
1061
  readonly seconds: number;
1035
1062
  } | undefined;
1036
1063
  readonly notices?: readonly {
1037
- readonly type: "other" | "moderated" | "filtered";
1064
+ readonly type: "filtered" | "moderated" | "other";
1038
1065
  readonly message: string;
1039
1066
  readonly providerMetadata?: {
1040
1067
  readonly [x: string]: {
@@ -1042,103 +1069,109 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1042
1069
  };
1043
1070
  } | undefined;
1044
1071
  }[] | undefined;
1045
- }, 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>>;
1046
- <Cases extends {
1047
- "generation-queued"?: ((value: {
1048
- readonly id: string;
1049
- readonly type: "generation-queued";
1050
- readonly position?: number | undefined;
1051
- }) => any) | undefined;
1052
- "generation-progress"?: ((value: {
1053
- readonly id: string;
1054
- readonly type: "generation-progress";
1055
- readonly progress?: number | undefined;
1056
- }) => any) | undefined;
1057
- "audio-delta"?: ((value: {
1058
- readonly type: "audio-delta";
1059
- readonly chunk: Uint8Array<ArrayBufferLike>;
1060
- }) => any) | undefined;
1061
- timestamps?: ((value: {
1062
- readonly type: "timestamps";
1063
- readonly items: readonly {
1064
- readonly text: string;
1065
- readonly startSeconds: number;
1066
- readonly endSeconds: number;
1067
- }[];
1068
- }) => any) | undefined;
1069
- finish?: ((value: {
1070
- readonly type: "finish";
1071
- readonly audio: Media.Asset;
1072
- readonly providerMetadata?: {
1073
- readonly [x: string]: {
1074
- readonly [x: string]: unknown;
1075
- };
1076
- } | undefined;
1077
- readonly usage?: {
1078
- readonly type: "tokens";
1079
- readonly input?: number | undefined;
1080
- readonly output?: number | undefined;
1081
- readonly total?: number | undefined;
1082
- readonly details?: {
1083
- readonly [x: string]: unknown;
1084
- } | undefined;
1085
- } | {
1086
- readonly type: "seconds";
1087
- readonly seconds: number;
1088
- } | {
1089
- readonly type: "characters";
1090
- readonly characters: number;
1091
- } | {
1092
- readonly type: "credits";
1093
- readonly credits: number;
1094
- } | {
1095
- readonly type: "compute";
1096
- readonly seconds: number;
1097
- } | undefined;
1098
- readonly notices?: readonly {
1099
- readonly type: "other" | "moderated" | "filtered";
1100
- readonly message: string;
1101
- readonly providerMetadata?: {
1102
- readonly [x: string]: {
1103
- readonly [x: string]: unknown;
1104
- };
1105
- } | undefined;
1106
- }[] | undefined;
1107
- }) => any) | undefined;
1108
- } & { [K in Exclude<keyof Cases, "finish" | "generation-queued" | "generation-progress" | "timestamps" | "audio-delta">]: never; }, OrElse extends (value: Exclude<{
1109
- readonly id: string;
1072
+ readonly providerMetadata?: {
1073
+ readonly [x: string]: {
1074
+ readonly [x: string]: unknown;
1075
+ };
1076
+ } | undefined;
1077
+ }, 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>>;
1078
+ <Cases extends { [M in Schema.Struct<{
1079
+ readonly type: Schema.tag<"generation-queued">;
1080
+ readonly id: Schema.String;
1081
+ readonly position: Schema.optional<Schema.Number>;
1082
+ }> | Schema.Struct<{
1083
+ readonly type: Schema.tag<"generation-progress">;
1084
+ readonly id: Schema.String;
1085
+ readonly progress: Schema.optional<Schema.Number>;
1086
+ }> | Schema.Struct<{
1087
+ readonly type: Schema.tag<"audio-delta">;
1088
+ readonly chunk: Schema.Uint8Array;
1089
+ }> | Schema.Struct<{
1090
+ readonly type: Schema.tag<"timestamps">;
1091
+ readonly items: Schema.$Array<Schema.Struct<{
1092
+ readonly text: Schema.String;
1093
+ readonly startSeconds: Schema.Number;
1094
+ readonly endSeconds: Schema.Number;
1095
+ }>>;
1096
+ }> | Schema.Struct<{
1097
+ readonly type: Schema.tag<"finish">;
1098
+ readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
1099
+ readonly source: Schema.Union<readonly [Schema.Struct<{
1100
+ readonly type: Schema.Literal<"bytes">;
1101
+ readonly data: Schema.Uint8Array;
1102
+ readonly mediaType: Schema.String;
1103
+ }>, Schema.Struct<{
1104
+ readonly type: Schema.Literal<"base64">;
1105
+ readonly data: Schema.String;
1106
+ readonly mediaType: Schema.String;
1107
+ }>, Schema.Struct<{
1108
+ readonly type: Schema.Literal<"url">;
1109
+ readonly url: Schema.String;
1110
+ readonly mediaType: Schema.optional<Schema.String>;
1111
+ readonly expiresAt: Schema.optional<Schema.Number>;
1112
+ }>, Schema.Struct<{
1113
+ readonly type: Schema.Literal<"ref">;
1114
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
1115
+ readonly id: Schema.String;
1116
+ readonly mediaType: Schema.optional<Schema.String>;
1117
+ }>]>;
1118
+ readonly info: Schema.optional<Schema.Struct<{
1119
+ readonly width: Schema.optional<Schema.Number>;
1120
+ readonly height: Schema.optional<Schema.Number>;
1121
+ readonly durationSeconds: Schema.optional<Schema.Number>;
1122
+ readonly sampleRate: Schema.optional<Schema.Number>;
1123
+ readonly channels: Schema.optional<Schema.Number>;
1124
+ readonly encoding: Schema.optional<Schema.String>;
1125
+ readonly format: Schema.optional<Schema.String>;
1126
+ }>>;
1127
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1128
+ }>, never, never>;
1129
+ readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1130
+ readonly type: Schema.Literal<"tokens">;
1131
+ readonly input: Schema.optional<Schema.Number>;
1132
+ readonly output: Schema.optional<Schema.Number>;
1133
+ readonly total: Schema.optional<Schema.Number>;
1134
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1135
+ }>, Schema.Struct<{
1136
+ readonly type: Schema.Literal<"seconds">;
1137
+ readonly seconds: Schema.Number;
1138
+ }>, Schema.Struct<{
1139
+ readonly type: Schema.Literal<"characters">;
1140
+ readonly characters: Schema.Number;
1141
+ }>, Schema.Struct<{
1142
+ readonly type: Schema.Literal<"credits">;
1143
+ readonly credits: Schema.Number;
1144
+ }>, Schema.Struct<{
1145
+ readonly type: Schema.Literal<"compute">;
1146
+ readonly seconds: Schema.Number;
1147
+ }>]>>;
1148
+ readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1149
+ readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1150
+ readonly message: Schema.String;
1151
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1152
+ }>>>;
1153
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1154
+ }> 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<{
1110
1155
  readonly type: "generation-queued";
1111
- readonly position?: number | undefined;
1112
- }, {
1113
- readonly type: keyof Cases;
1114
- }> | Exclude<{
1115
1156
  readonly id: string;
1157
+ readonly position?: number | undefined;
1158
+ } | {
1116
1159
  readonly type: "generation-progress";
1160
+ readonly id: string;
1117
1161
  readonly progress?: number | undefined;
1118
- }, {
1119
- readonly type: keyof Cases;
1120
- }> | Exclude<{
1162
+ } | {
1121
1163
  readonly type: "audio-delta";
1122
1164
  readonly chunk: Uint8Array<ArrayBufferLike>;
1123
- }, {
1124
- readonly type: keyof Cases;
1125
- }> | Exclude<{
1165
+ } | {
1126
1166
  readonly type: "timestamps";
1127
1167
  readonly items: readonly {
1128
1168
  readonly text: string;
1129
1169
  readonly startSeconds: number;
1130
1170
  readonly endSeconds: number;
1131
1171
  }[];
1132
- }, {
1133
- readonly type: keyof Cases;
1134
- }> | Exclude<{
1172
+ } | {
1135
1173
  readonly type: "finish";
1136
1174
  readonly audio: Media.Asset;
1137
- readonly providerMetadata?: {
1138
- readonly [x: string]: {
1139
- readonly [x: string]: unknown;
1140
- };
1141
- } | undefined;
1142
1175
  readonly usage?: {
1143
1176
  readonly type: "tokens";
1144
1177
  readonly input?: number | undefined;
@@ -1161,7 +1194,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1161
1194
  readonly seconds: number;
1162
1195
  } | undefined;
1163
1196
  readonly notices?: readonly {
1164
- readonly type: "other" | "moderated" | "filtered";
1197
+ readonly type: "filtered" | "moderated" | "other";
1165
1198
  readonly message: string;
1166
1199
  readonly providerMetadata?: {
1167
1200
  readonly [x: string]: {
@@ -1169,15 +1202,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1169
1202
  };
1170
1203
  } | undefined;
1171
1204
  }[] | undefined;
1172
- }, {
1173
- readonly type: keyof Cases;
1174
- }>) => any>(cases: Cases, orElse: OrElse): (value: {
1175
- readonly id: string;
1205
+ readonly providerMetadata?: {
1206
+ readonly [x: string]: {
1207
+ readonly [x: string]: unknown;
1208
+ };
1209
+ } | undefined;
1210
+ }, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
1176
1211
  readonly type: "generation-queued";
1212
+ readonly id: string;
1177
1213
  readonly position?: number | undefined;
1178
1214
  } | {
1179
- readonly id: string;
1180
1215
  readonly type: "generation-progress";
1216
+ readonly id: string;
1181
1217
  readonly progress?: number | undefined;
1182
1218
  } | {
1183
1219
  readonly type: "audio-delta";
@@ -1192,11 +1228,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1192
1228
  } | {
1193
1229
  readonly type: "finish";
1194
1230
  readonly audio: Media.Asset;
1195
- readonly providerMetadata?: {
1196
- readonly [x: string]: {
1197
- readonly [x: string]: unknown;
1198
- };
1199
- } | undefined;
1200
1231
  readonly usage?: {
1201
1232
  readonly type: "tokens";
1202
1233
  readonly input?: number | undefined;
@@ -1219,7 +1250,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1219
1250
  readonly seconds: number;
1220
1251
  } | undefined;
1221
1252
  readonly notices?: readonly {
1222
- readonly type: "other" | "moderated" | "filtered";
1253
+ readonly type: "filtered" | "moderated" | "other";
1223
1254
  readonly message: string;
1224
1255
  readonly providerMetadata?: {
1225
1256
  readonly [x: string]: {
@@ -1227,18 +1258,23 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1227
1258
  };
1228
1259
  } | undefined;
1229
1260
  }[] | undefined;
1230
- }) => 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>>;
1261
+ readonly providerMetadata?: {
1262
+ readonly [x: string]: {
1263
+ readonly [x: string]: unknown;
1264
+ };
1265
+ } | undefined;
1266
+ }) => import("effect/Unify").Unify<{ [K in keyof Cases]-?: NonNullable<Cases[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
1231
1267
  };
1232
1268
  } & {
1233
1269
  is: {
1234
1270
  generationQueued: (u: unknown) => u is {
1235
- readonly id: string;
1236
1271
  readonly type: "generation-queued";
1272
+ readonly id: string;
1237
1273
  readonly position?: number | undefined;
1238
1274
  };
1239
1275
  generationProgress: (u: unknown) => u is {
1240
- readonly id: string;
1241
1276
  readonly type: "generation-progress";
1277
+ readonly id: string;
1242
1278
  readonly progress?: number | undefined;
1243
1279
  };
1244
1280
  audioDelta: (u: unknown) => u is {
@@ -1256,11 +1292,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1256
1292
  finish: (u: unknown) => u is {
1257
1293
  readonly type: "finish";
1258
1294
  readonly audio: Media.Asset;
1259
- readonly providerMetadata?: {
1260
- readonly [x: string]: {
1261
- readonly [x: string]: unknown;
1262
- };
1263
- } | undefined;
1264
1295
  readonly usage?: {
1265
1296
  readonly type: "tokens";
1266
1297
  readonly input?: number | undefined;
@@ -1283,7 +1314,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1283
1314
  readonly seconds: number;
1284
1315
  } | undefined;
1285
1316
  readonly notices?: readonly {
1286
- readonly type: "other" | "moderated" | "filtered";
1317
+ readonly type: "filtered" | "moderated" | "other";
1287
1318
  readonly message: string;
1288
1319
  readonly providerMetadata?: {
1289
1320
  readonly [x: string]: {
@@ -1291,6 +1322,11 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1291
1322
  };
1292
1323
  } | undefined;
1293
1324
  }[] | undefined;
1325
+ readonly providerMetadata?: {
1326
+ readonly [x: string]: {
1327
+ readonly [x: string]: unknown;
1328
+ };
1329
+ } | undefined;
1294
1330
  };
1295
1331
  };
1296
1332
  };