@opencode/ai 2.1.3 → 2.2.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 (288) hide show
  1. package/README.md +283 -114
  2. package/dist/ai-client.d.ts +2 -2
  3. package/dist/ai-client.js +2 -1
  4. package/dist/cache-policy.d.ts +4 -0
  5. package/dist/cache-policy.js +20 -6
  6. package/dist/decision-client.d.ts +21 -0
  7. package/dist/decision-client.js +55 -0
  8. package/dist/decision.d.ts +472 -0
  9. package/dist/decision.js +158 -0
  10. package/dist/effect.d.ts +38 -0
  11. package/dist/effect.js +27 -0
  12. package/dist/effort-updates.d.ts +2 -2
  13. package/dist/experimental/cloudflare-run-extraction.d.ts +13 -0
  14. package/dist/experimental/cloudflare-run-extraction.js +83 -0
  15. package/dist/experimental/extraction.d.ts +183 -0
  16. package/dist/experimental/extraction.js +102 -0
  17. package/dist/experimental/realtime.d.ts +7 -2
  18. package/dist/experimental/realtime.js +5 -5
  19. package/dist/experimental.d.ts +2 -3
  20. package/dist/experimental.js +1 -2
  21. package/dist/image-client.d.ts +13 -22
  22. package/dist/image-client.js +0 -1
  23. package/dist/image.d.ts +154 -324
  24. package/dist/image.js +4 -11
  25. package/dist/index.d.ts +1426 -34
  26. package/dist/index.js +127 -24
  27. package/dist/llm.d.ts +16 -1
  28. package/dist/llm.js +34 -0
  29. package/dist/media-client.d.ts +2 -1
  30. package/dist/media-model.d.ts +3 -0
  31. package/dist/media-model.js +4 -1
  32. package/dist/media.d.ts +0 -7
  33. package/dist/media.js +0 -6
  34. package/dist/protocols/alibaba-chat.d.ts +32 -12
  35. package/dist/protocols/alibaba-images.d.ts +22 -0
  36. package/dist/protocols/alibaba-images.js +77 -0
  37. package/dist/protocols/alibaba-messages.d.ts +62 -27
  38. package/dist/protocols/alibaba-responses.d.ts +41 -38
  39. package/dist/protocols/anthropic-messages.d.ts +196 -94
  40. package/dist/protocols/anthropic-messages.js +47 -16
  41. package/dist/protocols/bedrock-converse.d.ts +140 -47
  42. package/dist/protocols/bedrock-converse.js +114 -18
  43. package/dist/protocols/bedrock-event-stream.js +1 -0
  44. package/dist/protocols/bfl-images.d.ts +9 -0
  45. package/dist/protocols/bfl-images.js +17 -15
  46. package/dist/protocols/cartesia-speech.d.ts +32 -50
  47. package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
  48. package/dist/protocols/cloudflare-run-decisions.js +36 -0
  49. package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
  50. package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
  51. package/dist/protocols/cohere-chat.d.ts +7 -8
  52. package/dist/protocols/deepgram-speech.d.ts +32 -50
  53. package/dist/protocols/elevenlabs-speech.d.ts +32 -50
  54. package/dist/protocols/fal-images.d.ts +10 -1
  55. package/dist/protocols/fal-images.js +16 -25
  56. package/dist/protocols/fal-video.js +1 -1
  57. package/dist/protocols/gemini.d.ts +37 -34
  58. package/dist/protocols/gemini.js +13 -8
  59. package/dist/protocols/google-images.d.ts +2 -2
  60. package/dist/protocols/google-images.js +8 -37
  61. package/dist/protocols/google-interactions.d.ts +18 -14
  62. package/dist/protocols/google-interactions.js +14 -7
  63. package/dist/protocols/google-speech.d.ts +32 -50
  64. package/dist/protocols/google-speech.js +0 -1
  65. package/dist/protocols/google-transcription.d.ts +32 -50
  66. package/dist/protocols/google-transcription.js +0 -1
  67. package/dist/protocols/google-video.d.ts +1 -1
  68. package/dist/protocols/google-video.js +2 -7
  69. package/dist/protocols/index.d.ts +3 -0
  70. package/dist/protocols/index.js +3 -0
  71. package/dist/protocols/meta-images.d.ts +7 -1
  72. package/dist/protocols/meta-images.js +10 -8
  73. package/dist/protocols/meta-messages.d.ts +73 -38
  74. package/dist/protocols/meta-messages.js +14 -1
  75. package/dist/protocols/meta-responses.d.ts +84 -78
  76. package/dist/protocols/meta-responses.js +29 -1
  77. package/dist/protocols/mistral-chat.d.ts +81 -78
  78. package/dist/protocols/mistral-chat.js +2 -1
  79. package/dist/protocols/open-responses-channel.js +47 -46
  80. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  81. package/dist/protocols/open-responses-continuation.js +3 -1
  82. package/dist/protocols/open-responses.d.ts +426 -396
  83. package/dist/protocols/open-responses.js +16 -25
  84. package/dist/protocols/openai-chat.d.ts +764 -52
  85. package/dist/protocols/openai-chat.js +38 -25
  86. package/dist/protocols/openai-compatible-chat.d.ts +35 -15
  87. package/dist/protocols/openai-compatible-responses.d.ts +44 -42
  88. package/dist/protocols/openai-decisions.d.ts +22 -0
  89. package/dist/protocols/openai-decisions.js +128 -0
  90. package/dist/protocols/openai-images.d.ts +53 -56
  91. package/dist/protocols/openai-images.js +100 -34
  92. package/dist/protocols/openai-responses.d.ts +322 -264
  93. package/dist/protocols/openai-responses.js +33 -3
  94. package/dist/protocols/openai-speech.d.ts +32 -50
  95. package/dist/protocols/openai-speech.js +15 -5
  96. package/dist/protocols/openai-transcription.d.ts +32 -50
  97. package/dist/protocols/openai-transcription.js +15 -11
  98. package/dist/protocols/replicate-images.js +1 -1
  99. package/dist/protocols/runway-video.d.ts +1 -1
  100. package/dist/protocols/runway-video.js +1 -1
  101. package/dist/protocols/shared.d.ts +9 -1
  102. package/dist/protocols/shared.js +13 -2
  103. package/dist/protocols/stability-images.d.ts +5 -0
  104. package/dist/protocols/stability-images.js +4 -9
  105. package/dist/protocols/system-one.d.ts +101 -0
  106. package/dist/protocols/system-one.js +230 -0
  107. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  108. package/dist/protocols/utils/bedrock-cache.js +7 -6
  109. package/dist/protocols/utils/cache.d.ts +14 -3
  110. package/dist/protocols/utils/cache.js +11 -4
  111. package/dist/protocols/utils/gemini-generate-content.d.ts +3 -3
  112. package/dist/protocols/utils/gemini-generate-content.js +10 -16
  113. package/dist/protocols/utils/gemini-json-schema.d.ts +5 -0
  114. package/dist/protocols/utils/gemini-json-schema.js +3 -3
  115. package/dist/protocols/utils/image-sizing.d.ts +31 -0
  116. package/dist/protocols/utils/image-sizing.js +73 -0
  117. package/dist/protocols/utils/media-input.d.ts +4 -5
  118. package/dist/protocols/utils/media-input.js +8 -5
  119. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  120. package/dist/protocols/utils/partial-json-options.js +0 -1
  121. package/dist/protocols/utils/speech-stream.d.ts +0 -1
  122. package/dist/protocols/utils/speech-stream.js +0 -1
  123. package/dist/protocols/utils/tool-schema.js +15 -5
  124. package/dist/protocols/utils/tool-stream.d.ts +10 -1
  125. package/dist/protocols/venice-chat.d.ts +71 -53
  126. package/dist/protocols/venice-chat.js +7 -6
  127. package/dist/protocols/xai-images.d.ts +1 -2
  128. package/dist/protocols/xai-images.js +9 -2
  129. package/dist/protocols/xai-responses.d.ts +88 -78
  130. package/dist/protocols/xai-responses.js +28 -2
  131. package/dist/protocols/xai-video.d.ts +1 -1
  132. package/dist/protocols/xai-video.js +11 -8
  133. package/dist/protocols/zai-chat.d.ts +54 -30
  134. package/dist/protocols/zai-chat.js +8 -3
  135. package/dist/protocols/zai-images.d.ts +3 -1
  136. package/dist/protocols/zai-images.js +12 -11
  137. package/dist/protocols/zai-messages.d.ts +72 -35
  138. package/dist/protocols/zai-messages.js +3 -2
  139. package/dist/provider-error.js +24 -7
  140. package/dist/providers/alibaba/images.d.ts +2 -0
  141. package/dist/providers/alibaba/images.js +1 -0
  142. package/dist/providers/alibaba.d.ts +146 -85
  143. package/dist/providers/alibaba.js +16 -8
  144. package/dist/providers/amazon-bedrock-mantle.d.ts +277 -218
  145. package/dist/providers/amazon-bedrock.d.ts +48 -28
  146. package/dist/providers/amazon-bedrock.js +11 -11
  147. package/dist/providers/anthropic-compatible.d.ts +64 -29
  148. package/dist/providers/anthropic.d.ts +64 -29
  149. package/dist/providers/azure/images.d.ts +2 -0
  150. package/dist/providers/azure/images.js +1 -0
  151. package/dist/providers/azure.d.ts +156 -115
  152. package/dist/providers/azure.js +19 -1
  153. package/dist/providers/baseten/decisions.d.ts +2 -0
  154. package/dist/providers/baseten/decisions.js +1 -0
  155. package/dist/providers/baseten.d.ts +75 -25
  156. package/dist/providers/baseten.js +41 -8
  157. package/dist/providers/cerebras.d.ts +66 -24
  158. package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
  159. package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
  160. package/dist/providers/cloudflare-ai-gateway.d.ts +409 -272
  161. package/dist/providers/cloudflare-ai-gateway.js +33 -6
  162. package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
  163. package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
  164. package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
  165. package/dist/providers/cloudflare-workers-ai/images.js +1 -0
  166. package/dist/providers/cloudflare-workers-ai.d.ts +79 -25
  167. package/dist/providers/cloudflare-workers-ai.js +45 -9
  168. package/dist/providers/cohere.d.ts +117 -75
  169. package/dist/providers/deepinfra.d.ts +66 -24
  170. package/dist/providers/deepseek.d.ts +66 -24
  171. package/dist/providers/digitalocean/decisions.d.ts +2 -0
  172. package/dist/providers/digitalocean/decisions.js +1 -0
  173. package/dist/providers/digitalocean/images.d.ts +2 -0
  174. package/dist/providers/digitalocean/images.js +1 -0
  175. package/dist/providers/digitalocean.d.ts +108 -37
  176. package/dist/providers/digitalocean.js +39 -8
  177. package/dist/providers/fireworks.d.ts +66 -24
  178. package/dist/providers/google/images.d.ts +2 -0
  179. package/dist/providers/google/images.js +1 -0
  180. package/dist/providers/google-vertex/images.d.ts +2 -0
  181. package/dist/providers/google-vertex/images.js +1 -0
  182. package/dist/providers/google-vertex-chat.d.ts +33 -12
  183. package/dist/providers/google-vertex-messages.d.ts +64 -29
  184. package/dist/providers/google-vertex-mistral.d.ts +17 -17
  185. package/dist/providers/google-vertex-responses.d.ts +38 -35
  186. package/dist/providers/google-vertex.d.ts +20 -18
  187. package/dist/providers/google-vertex.js +32 -15
  188. package/dist/providers/google.d.ts +22 -21
  189. package/dist/providers/google.js +15 -8
  190. package/dist/providers/groq.d.ts +66 -28
  191. package/dist/providers/groq.js +0 -6
  192. package/dist/providers/meta.d.ts +144 -85
  193. package/dist/providers/minimax.d.ts +145 -86
  194. package/dist/providers/mistral.d.ts +28 -28
  195. package/dist/providers/moonshot.d.ts +277 -218
  196. package/dist/providers/open-responses-options.d.ts +0 -1
  197. package/dist/providers/open-responses-options.js +1 -1
  198. package/dist/providers/openai/images.d.ts +2 -0
  199. package/dist/providers/openai/images.js +1 -0
  200. package/dist/providers/openai-compatible/images.d.ts +2 -0
  201. package/dist/providers/openai-compatible/images.js +1 -0
  202. package/dist/providers/openai-compatible-responses.d.ts +38 -35
  203. package/dist/providers/openai-compatible.d.ts +36 -13
  204. package/dist/providers/openai-compatible.js +22 -10
  205. package/dist/providers/openai-options.d.ts +3 -2
  206. package/dist/providers/openai-options.js +0 -1
  207. package/dist/providers/openai.d.ts +146 -109
  208. package/dist/providers/openai.js +20 -4
  209. package/dist/providers/opencode/decisions.d.ts +2 -0
  210. package/dist/providers/opencode/decisions.js +1 -0
  211. package/dist/providers/opencode.d.ts +9 -10
  212. package/dist/providers/opencode.js +10 -8
  213. package/dist/providers/openrouter/decisions.d.ts +2 -0
  214. package/dist/providers/openrouter/decisions.js +1 -0
  215. package/dist/providers/openrouter/images.d.ts +2 -0
  216. package/dist/providers/openrouter/images.js +1 -0
  217. package/dist/providers/openrouter.d.ts +128 -47
  218. package/dist/providers/openrouter.js +38 -16
  219. package/dist/providers/togetherai.d.ts +66 -24
  220. package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
  221. package/dist/providers/typesafe-ai/decisions.js +1 -0
  222. package/dist/providers/typesafe-ai.d.ts +9 -10
  223. package/dist/providers/typesafe-ai.js +10 -8
  224. package/dist/providers/venice.d.ts +214 -20
  225. package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
  226. package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
  227. package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
  228. package/dist/providers/vercel-ai-gateway/images.js +1 -0
  229. package/dist/providers/vercel-ai-gateway.d.ts +10 -16
  230. package/dist/providers/vercel-ai-gateway.js +31 -85
  231. package/dist/providers/xai/images.d.ts +2 -0
  232. package/dist/providers/xai/images.js +1 -0
  233. package/dist/providers/xai.d.ts +40 -17
  234. package/dist/providers/xai.js +15 -8
  235. package/dist/providers/zai/images.d.ts +2 -0
  236. package/dist/providers/zai/images.js +1 -0
  237. package/dist/providers/zai-coding-plan.d.ts +224 -85
  238. package/dist/providers/zai.d.ts +110 -23
  239. package/dist/providers/zai.js +15 -8
  240. package/dist/route/auth-options.d.ts +0 -3
  241. package/dist/route/auth.d.ts +0 -2
  242. package/dist/route/auth.js +0 -2
  243. package/dist/route/client.d.ts +2 -4
  244. package/dist/route/client.js +29 -8
  245. package/dist/route/decision.d.ts +58 -0
  246. package/dist/route/decision.js +75 -0
  247. package/dist/route/executor-service.js +1 -1
  248. package/dist/route/executor.d.ts +1 -1
  249. package/dist/route/framing.d.ts +2 -0
  250. package/dist/route/index.d.ts +3 -0
  251. package/dist/route/index.js +3 -0
  252. package/dist/route/media-protocol.d.ts +1 -0
  253. package/dist/route/media-protocol.js +12 -8
  254. package/dist/route/media.d.ts +5 -1
  255. package/dist/route/media.js +6 -2
  256. package/dist/route/transport/http.js +1 -0
  257. package/dist/route/transport/index.d.ts +1 -0
  258. package/dist/schema/events.d.ts +148 -6
  259. package/dist/schema/events.js +20 -0
  260. package/dist/schema/messages.d.ts +6 -2
  261. package/dist/schema/messages.js +3 -0
  262. package/dist/schema/options.d.ts +5 -3
  263. package/dist/schema/options.js +8 -3
  264. package/dist/speech-client.d.ts +13 -22
  265. package/dist/speech-client.js +0 -1
  266. package/dist/speech.d.ts +148 -283
  267. package/dist/speech.js +2 -4
  268. package/dist/testing.d.ts +25 -24
  269. package/dist/testing.js +3 -21
  270. package/dist/transcription-client.d.ts +13 -22
  271. package/dist/transcription.d.ts +148 -283
  272. package/dist/transcription.js +1 -1
  273. package/dist/utils/media-type.js +22 -1
  274. package/dist/video-client.d.ts +13 -22
  275. package/dist/video-client.js +0 -1
  276. package/dist/video.d.ts +115 -250
  277. package/dist/video.js +3 -5
  278. package/package.json +516 -13
  279. package/dist/experimental/evaluation-client.d.ts +0 -21
  280. package/dist/experimental/evaluation-client.js +0 -64
  281. package/dist/experimental/evaluation.d.ts +0 -242
  282. package/dist/experimental/evaluation.js +0 -115
  283. package/dist/experimental/system-one.d.ts +0 -16
  284. package/dist/experimental/system-one.js +0 -135
  285. package/dist/promise.d.ts +0 -1021
  286. package/dist/promise.js +0 -101
  287. package/dist/provider.d.ts +0 -23
  288. package/dist/provider.js +0 -2
package/dist/video.d.ts CHANGED
@@ -224,7 +224,7 @@ declare const VideoRequest_base: Schema.Class<VideoRequest, Schema.Struct<{
224
224
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
225
225
  }>, never, never>>;
226
226
  readonly durationSeconds: Schema.optional<Schema.Number>;
227
- readonly aspectRatio: Schema.optional<Schema.declare<`${number}:${number}`, `${number}:${number}`>>;
227
+ readonly aspect: Schema.optional<Schema.declare<`${number}:${number}`, `${number}:${number}`>>;
228
228
  readonly resolution: Schema.optional<Schema.String>;
229
229
  /** Whether to generate an audio track; routes whose audio is always on fail typed on `false`. */
230
230
  readonly audio: Schema.optional<Schema.Boolean>;
@@ -299,11 +299,6 @@ declare const VideoResponse_base: Schema.Class<VideoResponse, Schema.Struct<{
299
299
  readonly type: Schema.Literal<"compute">;
300
300
  readonly seconds: Schema.Number;
301
301
  }>]>>;
302
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
303
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
304
- readonly message: Schema.String;
305
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
306
- }>>>;
307
302
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
308
303
  }>, {}>;
309
304
  export declare class VideoResponse extends VideoResponse_base {
@@ -365,11 +360,6 @@ export declare const VideoFinishEvent: Schema.Struct<{
365
360
  readonly type: Schema.Literal<"compute">;
366
361
  readonly seconds: Schema.Number;
367
362
  }>]>>;
368
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
369
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
370
- readonly message: Schema.String;
371
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
372
- }>>>;
373
363
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
374
364
  }>;
375
365
  declare const videoEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
@@ -435,11 +425,6 @@ declare const videoEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.St
435
425
  readonly type: Schema.Literal<"compute">;
436
426
  readonly seconds: Schema.Number;
437
427
  }>]>>;
438
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
439
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
440
- readonly message: Schema.String;
441
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
442
- }>>>;
443
428
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
444
429
  }>]>;
445
430
  export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
@@ -505,11 +490,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
505
490
  readonly type: Schema.Literal<"compute">;
506
491
  readonly seconds: Schema.Number;
507
492
  }>]>>;
508
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
509
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
510
- readonly message: Schema.String;
511
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
512
- }>>>;
513
493
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
514
494
  }>]> & {
515
495
  readonly discriminants: readonly ["generation-queued", "generation-progress", "video", "finish"];
@@ -535,11 +515,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
535
515
  readonly type: Schema.Literal<"compute">;
536
516
  readonly seconds: Schema.Number;
537
517
  }>]>>;
538
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
539
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
540
- readonly message: Schema.String;
541
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
542
- }>>>;
543
518
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
544
519
  }>;
545
520
  "generation-progress": Schema.Struct<{
@@ -589,6 +564,10 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
589
564
  }>;
590
565
  };
591
566
  readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
567
+ readonly type: "video";
568
+ readonly index: number;
569
+ readonly video: Media.Asset;
570
+ } | {
592
571
  readonly type: "generation-queued";
593
572
  readonly id: string;
594
573
  readonly position?: number | undefined;
@@ -596,21 +575,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
596
575
  readonly type: "generation-progress";
597
576
  readonly id: string;
598
577
  readonly progress?: number | undefined;
599
- } | {
600
- readonly type: "video";
601
- readonly index: number;
602
- readonly video: Media.Asset;
603
578
  } | {
604
579
  readonly type: "finish";
605
580
  readonly usage?: {
606
- readonly type: "tokens";
607
- readonly input?: number | undefined;
608
- readonly output?: number | undefined;
609
- readonly total?: number | undefined;
610
- readonly details?: {
611
- readonly [x: string]: unknown;
612
- } | undefined;
613
- } | {
614
581
  readonly type: "seconds";
615
582
  readonly seconds: number;
616
583
  } | {
@@ -622,22 +589,27 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
622
589
  } | {
623
590
  readonly type: "compute";
624
591
  readonly seconds: number;
625
- } | undefined;
626
- readonly notices?: readonly {
627
- readonly type: "filtered" | "moderated" | "other";
628
- readonly message: string;
629
- readonly providerMetadata?: {
630
- readonly [x: string]: {
631
- readonly [x: string]: unknown;
632
- };
592
+ } | {
593
+ readonly type: "tokens";
594
+ readonly input?: number | undefined;
595
+ readonly output?: number | undefined;
596
+ readonly total?: number | undefined;
597
+ readonly details?: {
598
+ readonly [x: string]: unknown;
633
599
  } | undefined;
634
- }[] | undefined;
600
+ } | undefined;
635
601
  readonly providerMetadata?: {
636
602
  readonly [x: string]: {
637
603
  readonly [x: string]: unknown;
638
604
  };
639
605
  } | undefined;
640
606
  }) => value is Extract<{
607
+ readonly type: "video";
608
+ readonly index: number;
609
+ readonly video: Media.Asset;
610
+ }, {
611
+ readonly type: Keys;
612
+ }> | Extract<{
641
613
  readonly type: "generation-queued";
642
614
  readonly id: string;
643
615
  readonly position?: number | undefined;
@@ -649,23 +621,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
649
621
  readonly progress?: number | undefined;
650
622
  }, {
651
623
  readonly type: Keys;
652
- }> | Extract<{
653
- readonly type: "video";
654
- readonly index: number;
655
- readonly video: Media.Asset;
656
- }, {
657
- readonly type: Keys;
658
624
  }> | Extract<{
659
625
  readonly type: "finish";
660
626
  readonly usage?: {
661
- readonly type: "tokens";
662
- readonly input?: number | undefined;
663
- readonly output?: number | undefined;
664
- readonly total?: number | undefined;
665
- readonly details?: {
666
- readonly [x: string]: unknown;
667
- } | undefined;
668
- } | {
669
627
  readonly type: "seconds";
670
628
  readonly seconds: number;
671
629
  } | {
@@ -677,16 +635,15 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
677
635
  } | {
678
636
  readonly type: "compute";
679
637
  readonly seconds: number;
680
- } | undefined;
681
- readonly notices?: readonly {
682
- readonly type: "filtered" | "moderated" | "other";
683
- readonly message: string;
684
- readonly providerMetadata?: {
685
- readonly [x: string]: {
686
- readonly [x: string]: unknown;
687
- };
638
+ } | {
639
+ readonly type: "tokens";
640
+ readonly input?: number | undefined;
641
+ readonly output?: number | undefined;
642
+ readonly total?: number | undefined;
643
+ readonly details?: {
644
+ readonly [x: string]: unknown;
688
645
  } | undefined;
689
- }[] | undefined;
646
+ } | undefined;
690
647
  readonly providerMetadata?: {
691
648
  readonly [x: string]: {
692
649
  readonly [x: string]: unknown;
@@ -699,14 +656,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
699
656
  finish: (u: unknown) => u is {
700
657
  readonly type: "finish";
701
658
  readonly usage?: {
702
- readonly type: "tokens";
703
- readonly input?: number | undefined;
704
- readonly output?: number | undefined;
705
- readonly total?: number | undefined;
706
- readonly details?: {
707
- readonly [x: string]: unknown;
708
- } | undefined;
709
- } | {
710
659
  readonly type: "seconds";
711
660
  readonly seconds: number;
712
661
  } | {
@@ -718,16 +667,15 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
718
667
  } | {
719
668
  readonly type: "compute";
720
669
  readonly seconds: number;
721
- } | undefined;
722
- readonly notices?: readonly {
723
- readonly type: "filtered" | "moderated" | "other";
724
- readonly message: string;
725
- readonly providerMetadata?: {
726
- readonly [x: string]: {
727
- readonly [x: string]: unknown;
728
- };
670
+ } | {
671
+ readonly type: "tokens";
672
+ readonly input?: number | undefined;
673
+ readonly output?: number | undefined;
674
+ readonly total?: number | undefined;
675
+ readonly details?: {
676
+ readonly [x: string]: unknown;
729
677
  } | undefined;
730
- }[] | undefined;
678
+ } | undefined;
731
679
  readonly providerMetadata?: {
732
680
  readonly [x: string]: {
733
681
  readonly [x: string]: unknown;
@@ -814,13 +762,12 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
814
762
  readonly type: Schema.Literal<"compute">;
815
763
  readonly seconds: Schema.Number;
816
764
  }>]>>;
817
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
818
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
819
- readonly message: Schema.String;
820
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
821
- }>>>;
822
765
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
823
766
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
767
+ readonly type: "video";
768
+ readonly index: number;
769
+ readonly video: Media.Asset;
770
+ } | {
824
771
  readonly type: "generation-queued";
825
772
  readonly id: string;
826
773
  readonly position?: number | undefined;
@@ -828,21 +775,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
828
775
  readonly type: "generation-progress";
829
776
  readonly id: string;
830
777
  readonly progress?: number | undefined;
831
- } | {
832
- readonly type: "video";
833
- readonly index: number;
834
- readonly video: Media.Asset;
835
778
  } | {
836
779
  readonly type: "finish";
837
780
  readonly usage?: {
838
- readonly type: "tokens";
839
- readonly input?: number | undefined;
840
- readonly output?: number | undefined;
841
- readonly total?: number | undefined;
842
- readonly details?: {
843
- readonly [x: string]: unknown;
844
- } | undefined;
845
- } | {
846
781
  readonly type: "seconds";
847
782
  readonly seconds: number;
848
783
  } | {
@@ -854,16 +789,15 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
854
789
  } | {
855
790
  readonly type: "compute";
856
791
  readonly seconds: number;
857
- } | undefined;
858
- readonly notices?: readonly {
859
- readonly type: "filtered" | "moderated" | "other";
860
- readonly message: string;
861
- readonly providerMetadata?: {
862
- readonly [x: string]: {
863
- readonly [x: string]: unknown;
864
- };
792
+ } | {
793
+ readonly type: "tokens";
794
+ readonly input?: number | undefined;
795
+ readonly output?: number | undefined;
796
+ readonly total?: number | undefined;
797
+ readonly details?: {
798
+ readonly [x: string]: unknown;
865
799
  } | undefined;
866
- }[] | undefined;
800
+ } | undefined;
867
801
  readonly providerMetadata?: {
868
802
  readonly [x: string]: {
869
803
  readonly [x: string]: unknown;
@@ -933,13 +867,12 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
933
867
  readonly type: Schema.Literal<"compute">;
934
868
  readonly seconds: Schema.Number;
935
869
  }>]>>;
936
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
937
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
938
- readonly message: Schema.String;
939
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
940
- }>>>;
941
870
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
942
871
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
872
+ readonly type: "video";
873
+ readonly index: number;
874
+ readonly video: Media.Asset;
875
+ } | {
943
876
  readonly type: "generation-queued";
944
877
  readonly id: string;
945
878
  readonly position?: number | undefined;
@@ -947,21 +880,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
947
880
  readonly type: "generation-progress";
948
881
  readonly id: string;
949
882
  readonly progress?: number | undefined;
950
- } | {
951
- readonly type: "video";
952
- readonly index: number;
953
- readonly video: Media.Asset;
954
883
  } | {
955
884
  readonly type: "finish";
956
885
  readonly usage?: {
957
- readonly type: "tokens";
958
- readonly input?: number | undefined;
959
- readonly output?: number | undefined;
960
- readonly total?: number | undefined;
961
- readonly details?: {
962
- readonly [x: string]: unknown;
963
- } | undefined;
964
- } | {
965
886
  readonly type: "seconds";
966
887
  readonly seconds: number;
967
888
  } | {
@@ -973,16 +894,15 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
973
894
  } | {
974
895
  readonly type: "compute";
975
896
  readonly seconds: number;
976
- } | undefined;
977
- readonly notices?: readonly {
978
- readonly type: "filtered" | "moderated" | "other";
979
- readonly message: string;
980
- readonly providerMetadata?: {
981
- readonly [x: string]: {
982
- readonly [x: string]: unknown;
983
- };
897
+ } | {
898
+ readonly type: "tokens";
899
+ readonly input?: number | undefined;
900
+ readonly output?: number | undefined;
901
+ readonly total?: number | undefined;
902
+ readonly details?: {
903
+ readonly [x: string]: unknown;
984
904
  } | undefined;
985
- }[] | undefined;
905
+ } | undefined;
986
906
  readonly providerMetadata?: {
987
907
  readonly [x: string]: {
988
908
  readonly [x: string]: unknown;
@@ -1054,13 +974,12 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1054
974
  readonly type: Schema.Literal<"compute">;
1055
975
  readonly seconds: Schema.Number;
1056
976
  }>]>>;
1057
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1058
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1059
- readonly message: Schema.String;
1060
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1061
- }>>>;
1062
977
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1063
978
  }> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "video">]: never; }, OrElse extends (value: Exclude<{
979
+ readonly type: "video";
980
+ readonly index: number;
981
+ readonly video: Media.Asset;
982
+ } | {
1064
983
  readonly type: "generation-queued";
1065
984
  readonly id: string;
1066
985
  readonly position?: number | undefined;
@@ -1068,21 +987,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1068
987
  readonly type: "generation-progress";
1069
988
  readonly id: string;
1070
989
  readonly progress?: number | undefined;
1071
- } | {
1072
- readonly type: "video";
1073
- readonly index: number;
1074
- readonly video: Media.Asset;
1075
990
  } | {
1076
991
  readonly type: "finish";
1077
992
  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
993
  readonly type: "seconds";
1087
994
  readonly seconds: number;
1088
995
  } | {
@@ -1094,22 +1001,25 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1094
1001
  } | {
1095
1002
  readonly type: "compute";
1096
1003
  readonly seconds: number;
1097
- } | undefined;
1098
- readonly notices?: readonly {
1099
- readonly type: "filtered" | "moderated" | "other";
1100
- readonly message: string;
1101
- readonly providerMetadata?: {
1102
- readonly [x: string]: {
1103
- readonly [x: string]: unknown;
1104
- };
1004
+ } | {
1005
+ readonly type: "tokens";
1006
+ readonly input?: number | undefined;
1007
+ readonly output?: number | undefined;
1008
+ readonly total?: number | undefined;
1009
+ readonly details?: {
1010
+ readonly [x: string]: unknown;
1105
1011
  } | undefined;
1106
- }[] | undefined;
1012
+ } | undefined;
1107
1013
  readonly providerMetadata?: {
1108
1014
  readonly [x: string]: {
1109
1015
  readonly [x: string]: unknown;
1110
1016
  };
1111
1017
  } | undefined;
1112
1018
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
1019
+ readonly type: "video";
1020
+ readonly index: number;
1021
+ readonly video: Media.Asset;
1022
+ } | {
1113
1023
  readonly type: "generation-queued";
1114
1024
  readonly id: string;
1115
1025
  readonly position?: number | undefined;
@@ -1117,21 +1027,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1117
1027
  readonly type: "generation-progress";
1118
1028
  readonly id: string;
1119
1029
  readonly progress?: number | undefined;
1120
- } | {
1121
- readonly type: "video";
1122
- readonly index: number;
1123
- readonly video: Media.Asset;
1124
1030
  } | {
1125
1031
  readonly type: "finish";
1126
1032
  readonly usage?: {
1127
- readonly type: "tokens";
1128
- readonly input?: number | undefined;
1129
- readonly output?: number | undefined;
1130
- readonly total?: number | undefined;
1131
- readonly details?: {
1132
- readonly [x: string]: unknown;
1133
- } | undefined;
1134
- } | {
1135
1033
  readonly type: "seconds";
1136
1034
  readonly seconds: number;
1137
1035
  } | {
@@ -1143,16 +1041,15 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1143
1041
  } | {
1144
1042
  readonly type: "compute";
1145
1043
  readonly seconds: number;
1146
- } | undefined;
1147
- readonly notices?: readonly {
1148
- readonly type: "filtered" | "moderated" | "other";
1149
- readonly message: string;
1150
- readonly providerMetadata?: {
1151
- readonly [x: string]: {
1152
- readonly [x: string]: unknown;
1153
- };
1044
+ } | {
1045
+ readonly type: "tokens";
1046
+ readonly input?: number | undefined;
1047
+ readonly output?: number | undefined;
1048
+ readonly total?: number | undefined;
1049
+ readonly details?: {
1050
+ readonly [x: string]: unknown;
1154
1051
  } | undefined;
1155
- }[] | undefined;
1052
+ } | undefined;
1156
1053
  readonly providerMetadata?: {
1157
1054
  readonly [x: string]: {
1158
1055
  readonly [x: string]: unknown;
@@ -1222,13 +1119,12 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1222
1119
  readonly type: Schema.Literal<"compute">;
1223
1120
  readonly seconds: Schema.Number;
1224
1121
  }>]>>;
1225
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1226
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1227
- readonly message: Schema.String;
1228
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1229
- }>>>;
1230
1122
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1231
1123
  }> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "video">]: never; }, OrElse extends (value: Exclude<{
1124
+ readonly type: "video";
1125
+ readonly index: number;
1126
+ readonly video: Media.Asset;
1127
+ } | {
1232
1128
  readonly type: "generation-queued";
1233
1129
  readonly id: string;
1234
1130
  readonly position?: number | undefined;
@@ -1236,21 +1132,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1236
1132
  readonly type: "generation-progress";
1237
1133
  readonly id: string;
1238
1134
  readonly progress?: number | undefined;
1239
- } | {
1240
- readonly type: "video";
1241
- readonly index: number;
1242
- readonly video: Media.Asset;
1243
1135
  } | {
1244
1136
  readonly type: "finish";
1245
1137
  readonly usage?: {
1246
- readonly type: "tokens";
1247
- readonly input?: number | undefined;
1248
- readonly output?: number | undefined;
1249
- readonly total?: number | undefined;
1250
- readonly details?: {
1251
- readonly [x: string]: unknown;
1252
- } | undefined;
1253
- } | {
1254
1138
  readonly type: "seconds";
1255
1139
  readonly seconds: number;
1256
1140
  } | {
@@ -1262,22 +1146,25 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1262
1146
  } | {
1263
1147
  readonly type: "compute";
1264
1148
  readonly seconds: number;
1265
- } | undefined;
1266
- readonly notices?: readonly {
1267
- readonly type: "filtered" | "moderated" | "other";
1268
- readonly message: string;
1269
- readonly providerMetadata?: {
1270
- readonly [x: string]: {
1271
- readonly [x: string]: unknown;
1272
- };
1149
+ } | {
1150
+ readonly type: "tokens";
1151
+ readonly input?: number | undefined;
1152
+ readonly output?: number | undefined;
1153
+ readonly total?: number | undefined;
1154
+ readonly details?: {
1155
+ readonly [x: string]: unknown;
1273
1156
  } | undefined;
1274
- }[] | undefined;
1157
+ } | undefined;
1275
1158
  readonly providerMetadata?: {
1276
1159
  readonly [x: string]: {
1277
1160
  readonly [x: string]: unknown;
1278
1161
  };
1279
1162
  } | undefined;
1280
1163
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
1164
+ readonly type: "video";
1165
+ readonly index: number;
1166
+ readonly video: Media.Asset;
1167
+ } | {
1281
1168
  readonly type: "generation-queued";
1282
1169
  readonly id: string;
1283
1170
  readonly position?: number | undefined;
@@ -1285,21 +1172,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1285
1172
  readonly type: "generation-progress";
1286
1173
  readonly id: string;
1287
1174
  readonly progress?: number | undefined;
1288
- } | {
1289
- readonly type: "video";
1290
- readonly index: number;
1291
- readonly video: Media.Asset;
1292
1175
  } | {
1293
1176
  readonly type: "finish";
1294
1177
  readonly usage?: {
1295
- readonly type: "tokens";
1296
- readonly input?: number | undefined;
1297
- readonly output?: number | undefined;
1298
- readonly total?: number | undefined;
1299
- readonly details?: {
1300
- readonly [x: string]: unknown;
1301
- } | undefined;
1302
- } | {
1303
1178
  readonly type: "seconds";
1304
1179
  readonly seconds: number;
1305
1180
  } | {
@@ -1311,16 +1186,15 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1311
1186
  } | {
1312
1187
  readonly type: "compute";
1313
1188
  readonly seconds: number;
1314
- } | undefined;
1315
- readonly notices?: readonly {
1316
- readonly type: "filtered" | "moderated" | "other";
1317
- readonly message: string;
1318
- readonly providerMetadata?: {
1319
- readonly [x: string]: {
1320
- readonly [x: string]: unknown;
1321
- };
1189
+ } | {
1190
+ readonly type: "tokens";
1191
+ readonly input?: number | undefined;
1192
+ readonly output?: number | undefined;
1193
+ readonly total?: number | undefined;
1194
+ readonly details?: {
1195
+ readonly [x: string]: unknown;
1322
1196
  } | undefined;
1323
- }[] | undefined;
1197
+ } | undefined;
1324
1198
  readonly providerMetadata?: {
1325
1199
  readonly [x: string]: {
1326
1200
  readonly [x: string]: unknown;
@@ -1348,14 +1222,6 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1348
1222
  finish: (u: unknown) => u is {
1349
1223
  readonly type: "finish";
1350
1224
  readonly usage?: {
1351
- readonly type: "tokens";
1352
- readonly input?: number | undefined;
1353
- readonly output?: number | undefined;
1354
- readonly total?: number | undefined;
1355
- readonly details?: {
1356
- readonly [x: string]: unknown;
1357
- } | undefined;
1358
- } | {
1359
1225
  readonly type: "seconds";
1360
1226
  readonly seconds: number;
1361
1227
  } | {
@@ -1367,16 +1233,15 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
1367
1233
  } | {
1368
1234
  readonly type: "compute";
1369
1235
  readonly seconds: number;
1370
- } | undefined;
1371
- readonly notices?: readonly {
1372
- readonly type: "filtered" | "moderated" | "other";
1373
- readonly message: string;
1374
- readonly providerMetadata?: {
1375
- readonly [x: string]: {
1376
- readonly [x: string]: unknown;
1377
- };
1236
+ } | {
1237
+ readonly type: "tokens";
1238
+ readonly input?: number | undefined;
1239
+ readonly output?: number | undefined;
1240
+ readonly total?: number | undefined;
1241
+ readonly details?: {
1242
+ readonly [x: string]: unknown;
1378
1243
  } | undefined;
1379
- }[] | undefined;
1244
+ } | undefined;
1380
1245
  readonly providerMetadata?: {
1381
1246
  readonly [x: string]: {
1382
1247
  readonly [x: string]: unknown;