@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/image.d.ts CHANGED
@@ -19,11 +19,10 @@ export declare const ImageModelSchema: Schema.declare<ImageModel<{
19
19
  }>, ImageModel<{
20
20
  readonly [x: string]: unknown;
21
21
  }>>;
22
- export type ImageSize = `${number}x${number}`;
23
- export declare const ImageSize: Schema.declare<`${number}x${number}`, `${number}x${number}`>;
24
22
  export type ImageAspectRatio = Media.AspectRatio;
25
23
  export declare const ImageAspectRatio: Schema.declare<`${number}:${number}`, `${number}:${number}`>;
26
- export type ImageFormat = OpenString<"png" | "jpeg" | "webp">;
24
+ /** Size tier: `1K` is about as many pixels as 1024×1024 at the requested aspect, `2K` as 2048×2048. */
25
+ export type ImageResolution = OpenString<"1K" | "2K" | "4K">;
27
26
  declare const ImageRequest_base: Schema.Class<ImageRequest, Schema.Struct<{
28
27
  readonly model: Schema.declare<ImageModel<{
29
28
  readonly [x: string]: unknown;
@@ -63,43 +62,9 @@ declare const ImageRequest_base: Schema.Class<ImageRequest, Schema.Struct<{
63
62
  }>>;
64
63
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
65
64
  }>, never, never>>>;
66
- /** Inpainting mask; routes that cannot honor it fail with `UnsupportedOperation`. */
67
- readonly mask: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
68
- readonly source: Schema.Union<readonly [Schema.Struct<{
69
- readonly type: Schema.Literal<"bytes">;
70
- readonly data: Schema.Uint8Array;
71
- readonly mediaType: Schema.String;
72
- }>, Schema.Struct<{
73
- readonly type: Schema.Literal<"base64">;
74
- readonly data: Schema.String;
75
- readonly mediaType: Schema.String;
76
- }>, Schema.Struct<{
77
- readonly type: Schema.Literal<"url">;
78
- readonly url: Schema.String;
79
- readonly mediaType: Schema.optional<Schema.String>;
80
- readonly expiresAt: Schema.optional<Schema.Number>;
81
- }>, Schema.Struct<{
82
- readonly type: Schema.Literal<"ref">;
83
- readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
84
- readonly id: Schema.String;
85
- readonly mediaType: Schema.optional<Schema.String>;
86
- }>]>;
87
- readonly info: Schema.optional<Schema.Struct<{
88
- readonly width: Schema.optional<Schema.Number>;
89
- readonly height: Schema.optional<Schema.Number>;
90
- readonly durationSeconds: Schema.optional<Schema.Number>;
91
- readonly sampleRate: Schema.optional<Schema.Number>;
92
- readonly channels: Schema.optional<Schema.Number>;
93
- readonly encoding: Schema.optional<Schema.String>;
94
- readonly format: Schema.optional<Schema.String>;
95
- }>>;
96
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
97
- }>, never, never>>;
98
65
  readonly n: Schema.optional<Schema.Int>;
99
- readonly size: Schema.optional<Schema.declare<`${number}x${number}`, `${number}x${number}`>>;
100
- readonly aspectRatio: Schema.optional<Schema.declare<`${number}:${number}`, `${number}:${number}`>>;
101
- readonly seed: Schema.optional<Schema.Number>;
102
- readonly format: Schema.optional<Schema.String>;
66
+ readonly aspect: Schema.optional<Schema.declare<`${number}:${number}`, `${number}:${number}`>>;
67
+ readonly resolution: Schema.optional<Schema.String>;
103
68
  readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
104
69
  readonly http: Schema.optional<typeof HttpOptions>;
105
70
  }>, {}>;
@@ -111,9 +76,9 @@ export type ImageRequestFor<Options extends ImageOptions = ImageOptions> = Omit<
111
76
  readonly providerOptions?: Options;
112
77
  };
113
78
  export type ImageModelOptions<Model> = Model extends ImageModel<infer Options> ? Options : never;
114
- export type ImageRequestInput<Model extends ImageModel = ImageModel> = Omit<ConstructorParameters<typeof ImageRequest>[0], "model" | "providerOptions" | "http"> & {
79
+ export type ImageRequestInput<Model extends ImageModel = ImageModel> = Omit<ConstructorParameters<typeof ImageRequest>[0], "model" | "providerOptions" | "http" | "resolution"> & {
115
80
  readonly model: Model;
116
- readonly format?: ImageFormat;
81
+ readonly resolution?: ImageResolution;
117
82
  readonly providerOptions?: NoInfer<ImageModelOptions<Model>>;
118
83
  readonly http?: HttpOptions.Input;
119
84
  };
@@ -168,11 +133,6 @@ declare const ImageResponse_base: Schema.Class<ImageResponse, Schema.Struct<{
168
133
  readonly type: Schema.Literal<"compute">;
169
134
  readonly seconds: Schema.Number;
170
135
  }>]>>;
171
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
172
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
173
- readonly message: Schema.String;
174
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
175
- }>>>;
176
136
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
177
137
  }>, {}>;
178
138
  export declare class ImageResponse extends ImageResponse_base {
@@ -270,11 +230,6 @@ export declare const ImageFinishEvent: Schema.Struct<{
270
230
  readonly type: Schema.Literal<"compute">;
271
231
  readonly seconds: Schema.Number;
272
232
  }>]>>;
273
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
274
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
275
- readonly message: Schema.String;
276
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
277
- }>>>;
278
233
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
279
234
  }>;
280
235
  declare const imageEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
@@ -374,11 +329,6 @@ declare const imageEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.St
374
329
  readonly type: Schema.Literal<"compute">;
375
330
  readonly seconds: Schema.Number;
376
331
  }>]>>;
377
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
378
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
379
- readonly message: Schema.String;
380
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
381
- }>>>;
382
332
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
383
333
  }>]>;
384
334
  export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
@@ -478,11 +428,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
478
428
  readonly type: Schema.Literal<"compute">;
479
429
  readonly seconds: Schema.Number;
480
430
  }>]>>;
481
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
482
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
483
- readonly message: Schema.String;
484
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
485
- }>>>;
486
431
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
487
432
  }>]> & {
488
433
  readonly discriminants: readonly ["generation-queued", "generation-progress", "image-partial", "image", "finish"];
@@ -508,11 +453,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
508
453
  readonly type: Schema.Literal<"compute">;
509
454
  readonly seconds: Schema.Number;
510
455
  }>]>>;
511
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
512
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
513
- readonly message: Schema.String;
514
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
515
- }>>>;
516
456
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
517
457
  }>;
518
458
  "generation-progress": Schema.Struct<{
@@ -597,14 +537,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
597
537
  }>;
598
538
  };
599
539
  readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
600
- readonly type: "generation-queued";
601
- readonly id: string;
602
- readonly position?: number | undefined;
603
- } | {
604
- readonly type: "generation-progress";
605
- readonly id: string;
606
- readonly progress?: number | undefined;
607
- } | {
608
540
  readonly type: "image-partial";
609
541
  readonly index: number;
610
542
  readonly image: Media.Asset;
@@ -612,17 +544,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
612
544
  readonly type: "image";
613
545
  readonly index: number;
614
546
  readonly image: Media.Asset;
547
+ } | {
548
+ readonly type: "generation-queued";
549
+ readonly id: string;
550
+ readonly position?: number | undefined;
551
+ } | {
552
+ readonly type: "generation-progress";
553
+ readonly id: string;
554
+ readonly progress?: number | undefined;
615
555
  } | {
616
556
  readonly type: "finish";
617
557
  readonly usage?: {
618
- readonly type: "tokens";
619
- readonly input?: number | undefined;
620
- readonly output?: number | undefined;
621
- readonly total?: number | undefined;
622
- readonly details?: {
623
- readonly [x: string]: unknown;
624
- } | undefined;
625
- } | {
626
558
  readonly type: "seconds";
627
559
  readonly seconds: number;
628
560
  } | {
@@ -634,34 +566,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
634
566
  } | {
635
567
  readonly type: "compute";
636
568
  readonly seconds: number;
637
- } | undefined;
638
- readonly notices?: readonly {
639
- readonly type: "filtered" | "moderated" | "other";
640
- readonly message: string;
641
- readonly providerMetadata?: {
642
- readonly [x: string]: {
643
- readonly [x: string]: unknown;
644
- };
569
+ } | {
570
+ readonly type: "tokens";
571
+ readonly input?: number | undefined;
572
+ readonly output?: number | undefined;
573
+ readonly total?: number | undefined;
574
+ readonly details?: {
575
+ readonly [x: string]: unknown;
645
576
  } | undefined;
646
- }[] | undefined;
577
+ } | undefined;
647
578
  readonly providerMetadata?: {
648
579
  readonly [x: string]: {
649
580
  readonly [x: string]: unknown;
650
581
  };
651
582
  } | undefined;
652
583
  }) => value is Extract<{
653
- readonly type: "generation-queued";
654
- readonly id: string;
655
- readonly position?: number | undefined;
656
- }, {
657
- readonly type: Keys;
658
- }> | Extract<{
659
- readonly type: "generation-progress";
660
- readonly id: string;
661
- readonly progress?: number | undefined;
662
- }, {
663
- readonly type: Keys;
664
- }> | Extract<{
665
584
  readonly type: "image-partial";
666
585
  readonly index: number;
667
586
  readonly image: Media.Asset;
@@ -673,17 +592,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
673
592
  readonly image: Media.Asset;
674
593
  }, {
675
594
  readonly type: Keys;
595
+ }> | Extract<{
596
+ readonly type: "generation-queued";
597
+ readonly id: string;
598
+ readonly position?: number | undefined;
599
+ }, {
600
+ readonly type: Keys;
601
+ }> | Extract<{
602
+ readonly type: "generation-progress";
603
+ readonly id: string;
604
+ readonly progress?: number | undefined;
605
+ }, {
606
+ readonly type: Keys;
676
607
  }> | Extract<{
677
608
  readonly type: "finish";
678
609
  readonly usage?: {
679
- readonly type: "tokens";
680
- readonly input?: number | undefined;
681
- readonly output?: number | undefined;
682
- readonly total?: number | undefined;
683
- readonly details?: {
684
- readonly [x: string]: unknown;
685
- } | undefined;
686
- } | {
687
610
  readonly type: "seconds";
688
611
  readonly seconds: number;
689
612
  } | {
@@ -695,16 +618,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
695
618
  } | {
696
619
  readonly type: "compute";
697
620
  readonly seconds: number;
698
- } | undefined;
699
- readonly notices?: readonly {
700
- readonly type: "filtered" | "moderated" | "other";
701
- readonly message: string;
702
- readonly providerMetadata?: {
703
- readonly [x: string]: {
704
- readonly [x: string]: unknown;
705
- };
621
+ } | {
622
+ readonly type: "tokens";
623
+ readonly input?: number | undefined;
624
+ readonly output?: number | undefined;
625
+ readonly total?: number | undefined;
626
+ readonly details?: {
627
+ readonly [x: string]: unknown;
706
628
  } | undefined;
707
- }[] | undefined;
629
+ } | undefined;
708
630
  readonly providerMetadata?: {
709
631
  readonly [x: string]: {
710
632
  readonly [x: string]: unknown;
@@ -717,14 +639,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
717
639
  finish: (u: unknown) => u is {
718
640
  readonly type: "finish";
719
641
  readonly usage?: {
720
- readonly type: "tokens";
721
- readonly input?: number | undefined;
722
- readonly output?: number | undefined;
723
- readonly total?: number | undefined;
724
- readonly details?: {
725
- readonly [x: string]: unknown;
726
- } | undefined;
727
- } | {
728
642
  readonly type: "seconds";
729
643
  readonly seconds: number;
730
644
  } | {
@@ -736,16 +650,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
736
650
  } | {
737
651
  readonly type: "compute";
738
652
  readonly seconds: number;
739
- } | undefined;
740
- readonly notices?: readonly {
741
- readonly type: "filtered" | "moderated" | "other";
742
- readonly message: string;
743
- readonly providerMetadata?: {
744
- readonly [x: string]: {
745
- readonly [x: string]: unknown;
746
- };
653
+ } | {
654
+ readonly type: "tokens";
655
+ readonly input?: number | undefined;
656
+ readonly output?: number | undefined;
657
+ readonly total?: number | undefined;
658
+ readonly details?: {
659
+ readonly [x: string]: unknown;
747
660
  } | undefined;
748
- }[] | undefined;
661
+ } | undefined;
749
662
  readonly providerMetadata?: {
750
663
  readonly [x: string]: {
751
664
  readonly [x: string]: unknown;
@@ -871,21 +784,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
871
784
  readonly type: Schema.Literal<"compute">;
872
785
  readonly seconds: Schema.Number;
873
786
  }>]>>;
874
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
875
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
876
- readonly message: Schema.String;
877
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
878
- }>>>;
879
787
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
880
788
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
881
- readonly type: "generation-queued";
882
- readonly id: string;
883
- readonly position?: number | undefined;
884
- } | {
885
- readonly type: "generation-progress";
886
- readonly id: string;
887
- readonly progress?: number | undefined;
888
- } | {
889
789
  readonly type: "image-partial";
890
790
  readonly index: number;
891
791
  readonly image: Media.Asset;
@@ -893,17 +793,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
893
793
  readonly type: "image";
894
794
  readonly index: number;
895
795
  readonly image: Media.Asset;
796
+ } | {
797
+ readonly type: "generation-queued";
798
+ readonly id: string;
799
+ readonly position?: number | undefined;
800
+ } | {
801
+ readonly type: "generation-progress";
802
+ readonly id: string;
803
+ readonly progress?: number | undefined;
896
804
  } | {
897
805
  readonly type: "finish";
898
806
  readonly usage?: {
899
- readonly type: "tokens";
900
- readonly input?: number | undefined;
901
- readonly output?: number | undefined;
902
- readonly total?: number | undefined;
903
- readonly details?: {
904
- readonly [x: string]: unknown;
905
- } | undefined;
906
- } | {
907
807
  readonly type: "seconds";
908
808
  readonly seconds: number;
909
809
  } | {
@@ -915,16 +815,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
915
815
  } | {
916
816
  readonly type: "compute";
917
817
  readonly seconds: number;
918
- } | undefined;
919
- readonly notices?: readonly {
920
- readonly type: "filtered" | "moderated" | "other";
921
- readonly message: string;
922
- readonly providerMetadata?: {
923
- readonly [x: string]: {
924
- readonly [x: string]: unknown;
925
- };
818
+ } | {
819
+ readonly type: "tokens";
820
+ readonly input?: number | undefined;
821
+ readonly output?: number | undefined;
822
+ readonly total?: number | undefined;
823
+ readonly details?: {
824
+ readonly [x: string]: unknown;
926
825
  } | undefined;
927
- }[] | undefined;
826
+ } | undefined;
928
827
  readonly providerMetadata?: {
929
828
  readonly [x: string]: {
930
829
  readonly [x: string]: unknown;
@@ -1028,21 +927,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1028
927
  readonly type: Schema.Literal<"compute">;
1029
928
  readonly seconds: Schema.Number;
1030
929
  }>]>>;
1031
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1032
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1033
- readonly message: Schema.String;
1034
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1035
- }>>>;
1036
930
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1037
931
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
1038
- readonly type: "generation-queued";
1039
- readonly id: string;
1040
- readonly position?: number | undefined;
1041
- } | {
1042
- readonly type: "generation-progress";
1043
- readonly id: string;
1044
- readonly progress?: number | undefined;
1045
- } | {
1046
932
  readonly type: "image-partial";
1047
933
  readonly index: number;
1048
934
  readonly image: Media.Asset;
@@ -1050,17 +936,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1050
936
  readonly type: "image";
1051
937
  readonly index: number;
1052
938
  readonly image: Media.Asset;
939
+ } | {
940
+ readonly type: "generation-queued";
941
+ readonly id: string;
942
+ readonly position?: number | undefined;
943
+ } | {
944
+ readonly type: "generation-progress";
945
+ readonly id: string;
946
+ readonly progress?: number | undefined;
1053
947
  } | {
1054
948
  readonly type: "finish";
1055
949
  readonly usage?: {
1056
- readonly type: "tokens";
1057
- readonly input?: number | undefined;
1058
- readonly output?: number | undefined;
1059
- readonly total?: number | undefined;
1060
- readonly details?: {
1061
- readonly [x: string]: unknown;
1062
- } | undefined;
1063
- } | {
1064
950
  readonly type: "seconds";
1065
951
  readonly seconds: number;
1066
952
  } | {
@@ -1072,16 +958,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1072
958
  } | {
1073
959
  readonly type: "compute";
1074
960
  readonly seconds: number;
1075
- } | undefined;
1076
- readonly notices?: readonly {
1077
- readonly type: "filtered" | "moderated" | "other";
1078
- readonly message: string;
1079
- readonly providerMetadata?: {
1080
- readonly [x: string]: {
1081
- readonly [x: string]: unknown;
1082
- };
961
+ } | {
962
+ readonly type: "tokens";
963
+ readonly input?: number | undefined;
964
+ readonly output?: number | undefined;
965
+ readonly total?: number | undefined;
966
+ readonly details?: {
967
+ readonly [x: string]: unknown;
1083
968
  } | undefined;
1084
- }[] | undefined;
969
+ } | undefined;
1085
970
  readonly providerMetadata?: {
1086
971
  readonly [x: string]: {
1087
972
  readonly [x: string]: unknown;
@@ -1187,21 +1072,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1187
1072
  readonly type: Schema.Literal<"compute">;
1188
1073
  readonly seconds: Schema.Number;
1189
1074
  }>]>>;
1190
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1191
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1192
- readonly message: Schema.String;
1193
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1194
- }>>>;
1195
1075
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1196
1076
  }> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial">]: never; }, OrElse extends (value: Exclude<{
1197
- readonly type: "generation-queued";
1198
- readonly id: string;
1199
- readonly position?: number | undefined;
1200
- } | {
1201
- readonly type: "generation-progress";
1202
- readonly id: string;
1203
- readonly progress?: number | undefined;
1204
- } | {
1205
1077
  readonly type: "image-partial";
1206
1078
  readonly index: number;
1207
1079
  readonly image: Media.Asset;
@@ -1209,17 +1081,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1209
1081
  readonly type: "image";
1210
1082
  readonly index: number;
1211
1083
  readonly image: Media.Asset;
1084
+ } | {
1085
+ readonly type: "generation-queued";
1086
+ readonly id: string;
1087
+ readonly position?: number | undefined;
1088
+ } | {
1089
+ readonly type: "generation-progress";
1090
+ readonly id: string;
1091
+ readonly progress?: number | undefined;
1212
1092
  } | {
1213
1093
  readonly type: "finish";
1214
1094
  readonly usage?: {
1215
- readonly type: "tokens";
1216
- readonly input?: number | undefined;
1217
- readonly output?: number | undefined;
1218
- readonly total?: number | undefined;
1219
- readonly details?: {
1220
- readonly [x: string]: unknown;
1221
- } | undefined;
1222
- } | {
1223
1095
  readonly type: "seconds";
1224
1096
  readonly seconds: number;
1225
1097
  } | {
@@ -1231,30 +1103,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1231
1103
  } | {
1232
1104
  readonly type: "compute";
1233
1105
  readonly seconds: number;
1234
- } | undefined;
1235
- readonly notices?: readonly {
1236
- readonly type: "filtered" | "moderated" | "other";
1237
- readonly message: string;
1238
- readonly providerMetadata?: {
1239
- readonly [x: string]: {
1240
- readonly [x: string]: unknown;
1241
- };
1106
+ } | {
1107
+ readonly type: "tokens";
1108
+ readonly input?: number | undefined;
1109
+ readonly output?: number | undefined;
1110
+ readonly total?: number | undefined;
1111
+ readonly details?: {
1112
+ readonly [x: string]: unknown;
1242
1113
  } | undefined;
1243
- }[] | undefined;
1114
+ } | undefined;
1244
1115
  readonly providerMetadata?: {
1245
1116
  readonly [x: string]: {
1246
1117
  readonly [x: string]: unknown;
1247
1118
  };
1248
1119
  } | undefined;
1249
1120
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
1250
- readonly type: "generation-queued";
1251
- readonly id: string;
1252
- readonly position?: number | undefined;
1253
- } | {
1254
- readonly type: "generation-progress";
1255
- readonly id: string;
1256
- readonly progress?: number | undefined;
1257
- } | {
1258
1121
  readonly type: "image-partial";
1259
1122
  readonly index: number;
1260
1123
  readonly image: Media.Asset;
@@ -1262,17 +1125,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1262
1125
  readonly type: "image";
1263
1126
  readonly index: number;
1264
1127
  readonly image: Media.Asset;
1128
+ } | {
1129
+ readonly type: "generation-queued";
1130
+ readonly id: string;
1131
+ readonly position?: number | undefined;
1132
+ } | {
1133
+ readonly type: "generation-progress";
1134
+ readonly id: string;
1135
+ readonly progress?: number | undefined;
1265
1136
  } | {
1266
1137
  readonly type: "finish";
1267
1138
  readonly usage?: {
1268
- readonly type: "tokens";
1269
- readonly input?: number | undefined;
1270
- readonly output?: number | undefined;
1271
- readonly total?: number | undefined;
1272
- readonly details?: {
1273
- readonly [x: string]: unknown;
1274
- } | undefined;
1275
- } | {
1276
1139
  readonly type: "seconds";
1277
1140
  readonly seconds: number;
1278
1141
  } | {
@@ -1284,16 +1147,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1284
1147
  } | {
1285
1148
  readonly type: "compute";
1286
1149
  readonly seconds: number;
1287
- } | undefined;
1288
- readonly notices?: readonly {
1289
- readonly type: "filtered" | "moderated" | "other";
1290
- readonly message: string;
1291
- readonly providerMetadata?: {
1292
- readonly [x: string]: {
1293
- readonly [x: string]: unknown;
1294
- };
1150
+ } | {
1151
+ readonly type: "tokens";
1152
+ readonly input?: number | undefined;
1153
+ readonly output?: number | undefined;
1154
+ readonly total?: number | undefined;
1155
+ readonly details?: {
1156
+ readonly [x: string]: unknown;
1295
1157
  } | undefined;
1296
- }[] | undefined;
1158
+ } | undefined;
1297
1159
  readonly providerMetadata?: {
1298
1160
  readonly [x: string]: {
1299
1161
  readonly [x: string]: unknown;
@@ -1397,21 +1259,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1397
1259
  readonly type: Schema.Literal<"compute">;
1398
1260
  readonly seconds: Schema.Number;
1399
1261
  }>]>>;
1400
- readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
1401
- readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
1402
- readonly message: Schema.String;
1403
- readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1404
- }>>>;
1405
1262
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1406
1263
  }> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial">]: never; }, OrElse extends (value: Exclude<{
1407
- readonly type: "generation-queued";
1408
- readonly id: string;
1409
- readonly position?: number | undefined;
1410
- } | {
1411
- readonly type: "generation-progress";
1412
- readonly id: string;
1413
- readonly progress?: number | undefined;
1414
- } | {
1415
1264
  readonly type: "image-partial";
1416
1265
  readonly index: number;
1417
1266
  readonly image: Media.Asset;
@@ -1419,17 +1268,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1419
1268
  readonly type: "image";
1420
1269
  readonly index: number;
1421
1270
  readonly image: Media.Asset;
1271
+ } | {
1272
+ readonly type: "generation-queued";
1273
+ readonly id: string;
1274
+ readonly position?: number | undefined;
1275
+ } | {
1276
+ readonly type: "generation-progress";
1277
+ readonly id: string;
1278
+ readonly progress?: number | undefined;
1422
1279
  } | {
1423
1280
  readonly type: "finish";
1424
1281
  readonly usage?: {
1425
- readonly type: "tokens";
1426
- readonly input?: number | undefined;
1427
- readonly output?: number | undefined;
1428
- readonly total?: number | undefined;
1429
- readonly details?: {
1430
- readonly [x: string]: unknown;
1431
- } | undefined;
1432
- } | {
1433
1282
  readonly type: "seconds";
1434
1283
  readonly seconds: number;
1435
1284
  } | {
@@ -1441,30 +1290,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1441
1290
  } | {
1442
1291
  readonly type: "compute";
1443
1292
  readonly seconds: number;
1444
- } | undefined;
1445
- readonly notices?: readonly {
1446
- readonly type: "filtered" | "moderated" | "other";
1447
- readonly message: string;
1448
- readonly providerMetadata?: {
1449
- readonly [x: string]: {
1450
- readonly [x: string]: unknown;
1451
- };
1293
+ } | {
1294
+ readonly type: "tokens";
1295
+ readonly input?: number | undefined;
1296
+ readonly output?: number | undefined;
1297
+ readonly total?: number | undefined;
1298
+ readonly details?: {
1299
+ readonly [x: string]: unknown;
1452
1300
  } | undefined;
1453
- }[] | undefined;
1301
+ } | undefined;
1454
1302
  readonly providerMetadata?: {
1455
1303
  readonly [x: string]: {
1456
1304
  readonly [x: string]: unknown;
1457
1305
  };
1458
1306
  } | undefined;
1459
1307
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
1460
- readonly type: "generation-queued";
1461
- readonly id: string;
1462
- readonly position?: number | undefined;
1463
- } | {
1464
- readonly type: "generation-progress";
1465
- readonly id: string;
1466
- readonly progress?: number | undefined;
1467
- } | {
1468
1308
  readonly type: "image-partial";
1469
1309
  readonly index: number;
1470
1310
  readonly image: Media.Asset;
@@ -1472,17 +1312,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1472
1312
  readonly type: "image";
1473
1313
  readonly index: number;
1474
1314
  readonly image: Media.Asset;
1315
+ } | {
1316
+ readonly type: "generation-queued";
1317
+ readonly id: string;
1318
+ readonly position?: number | undefined;
1319
+ } | {
1320
+ readonly type: "generation-progress";
1321
+ readonly id: string;
1322
+ readonly progress?: number | undefined;
1475
1323
  } | {
1476
1324
  readonly type: "finish";
1477
1325
  readonly usage?: {
1478
- readonly type: "tokens";
1479
- readonly input?: number | undefined;
1480
- readonly output?: number | undefined;
1481
- readonly total?: number | undefined;
1482
- readonly details?: {
1483
- readonly [x: string]: unknown;
1484
- } | undefined;
1485
- } | {
1486
1326
  readonly type: "seconds";
1487
1327
  readonly seconds: number;
1488
1328
  } | {
@@ -1494,16 +1334,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1494
1334
  } | {
1495
1335
  readonly type: "compute";
1496
1336
  readonly seconds: number;
1497
- } | undefined;
1498
- readonly notices?: readonly {
1499
- readonly type: "filtered" | "moderated" | "other";
1500
- readonly message: string;
1501
- readonly providerMetadata?: {
1502
- readonly [x: string]: {
1503
- readonly [x: string]: unknown;
1504
- };
1337
+ } | {
1338
+ readonly type: "tokens";
1339
+ readonly input?: number | undefined;
1340
+ readonly output?: number | undefined;
1341
+ readonly total?: number | undefined;
1342
+ readonly details?: {
1343
+ readonly [x: string]: unknown;
1505
1344
  } | undefined;
1506
- }[] | undefined;
1345
+ } | undefined;
1507
1346
  readonly providerMetadata?: {
1508
1347
  readonly [x: string]: {
1509
1348
  readonly [x: string]: unknown;
@@ -1536,14 +1375,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1536
1375
  finish: (u: unknown) => u is {
1537
1376
  readonly type: "finish";
1538
1377
  readonly usage?: {
1539
- readonly type: "tokens";
1540
- readonly input?: number | undefined;
1541
- readonly output?: number | undefined;
1542
- readonly total?: number | undefined;
1543
- readonly details?: {
1544
- readonly [x: string]: unknown;
1545
- } | undefined;
1546
- } | {
1547
1378
  readonly type: "seconds";
1548
1379
  readonly seconds: number;
1549
1380
  } | {
@@ -1555,16 +1386,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
1555
1386
  } | {
1556
1387
  readonly type: "compute";
1557
1388
  readonly seconds: number;
1558
- } | undefined;
1559
- readonly notices?: readonly {
1560
- readonly type: "filtered" | "moderated" | "other";
1561
- readonly message: string;
1562
- readonly providerMetadata?: {
1563
- readonly [x: string]: {
1564
- readonly [x: string]: unknown;
1565
- };
1389
+ } | {
1390
+ readonly type: "tokens";
1391
+ readonly input?: number | undefined;
1392
+ readonly output?: number | undefined;
1393
+ readonly total?: number | undefined;
1394
+ readonly details?: {
1395
+ readonly [x: string]: unknown;
1566
1396
  } | undefined;
1567
- }[] | undefined;
1397
+ } | undefined;
1568
1398
  readonly providerMetadata?: {
1569
1399
  readonly [x: string]: {
1570
1400
  readonly [x: string]: unknown;