@opencode/ai 2.0.15 → 2.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +441 -99
- package/dist/ai-client.d.ts +8 -0
- package/dist/ai-client.js +12 -0
- package/dist/experimental/evaluation-client.d.ts +3 -3
- package/dist/experimental/evaluation-client.js +1 -1
- package/dist/experimental/evaluation.js +1 -1
- package/dist/generation.d.ts +39 -29
- package/dist/generation.js +62 -36
- package/dist/image-client.d.ts +59 -17
- package/dist/image-client.js +16 -24
- package/dist/image.d.ts +394 -55
- package/dist/image.js +48 -57
- package/dist/index.d.ts +15 -2
- package/dist/index.js +10 -0
- package/dist/llm.d.ts +7 -5
- package/dist/llm.js +10 -4
- package/dist/media-client.d.ts +30 -0
- package/dist/media-client.js +51 -0
- package/dist/media-model.d.ts +43 -0
- package/dist/media-model.js +47 -0
- package/dist/media.d.ts +10 -9
- package/dist/media.js +11 -12
- package/dist/promise.d.ts +473 -15
- package/dist/promise.js +71 -13
- package/dist/protocols/alibaba-chat.d.ts +12 -0
- package/dist/protocols/alibaba-chat.js +4 -1
- package/dist/protocols/alibaba-messages.d.ts +1 -1
- package/dist/protocols/alibaba-messages.js +6 -4
- package/dist/protocols/alibaba-responses.d.ts +2 -2
- package/dist/protocols/anthropic-messages.d.ts +34 -34
- package/dist/protocols/anthropic-messages.js +14 -9
- package/dist/protocols/assemblyai-transcription.d.ts +41 -0
- package/dist/protocols/assemblyai-transcription.js +136 -0
- package/dist/protocols/bedrock-converse.d.ts +7 -0
- package/dist/protocols/bedrock-converse.js +39 -19
- package/dist/protocols/bfl-images.d.ts +38 -0
- package/dist/protocols/bfl-images.js +153 -0
- package/dist/protocols/cartesia-speech.d.ts +143 -0
- package/dist/protocols/cartesia-speech.js +120 -0
- package/dist/protocols/deepgram-speech.d.ts +135 -0
- package/dist/protocols/deepgram-speech.js +91 -0
- package/dist/protocols/deepgram-transcription.d.ts +26 -0
- package/dist/protocols/deepgram-transcription.js +125 -0
- package/dist/protocols/elevenlabs-speech.d.ts +138 -0
- package/dist/protocols/elevenlabs-speech.js +111 -0
- package/dist/protocols/fal-images.d.ts +25 -0
- package/dist/protocols/fal-images.js +104 -0
- package/dist/protocols/fal-video.d.ts +29 -0
- package/dist/protocols/fal-video.js +73 -0
- package/dist/protocols/gemini.d.ts +22 -22
- package/dist/protocols/gemini.js +19 -36
- package/dist/protocols/google-images.d.ts +3 -3
- package/dist/protocols/google-images.js +12 -34
- package/dist/protocols/google-speech.d.ts +146 -0
- package/dist/protocols/google-speech.js +88 -0
- package/dist/protocols/google-transcription.d.ts +174 -0
- package/dist/protocols/google-transcription.js +126 -0
- package/dist/protocols/google-video.d.ts +26 -0
- package/dist/protocols/google-video.js +142 -0
- package/dist/protocols/meta-images.d.ts +3 -4
- package/dist/protocols/meta-images.js +13 -29
- package/dist/protocols/meta-messages.d.ts +5 -5
- package/dist/protocols/meta-responses.d.ts +4 -4
- package/dist/protocols/meta-responses.js +6 -4
- package/dist/protocols/open-responses.d.ts +10 -9
- package/dist/protocols/open-responses.js +4 -9
- package/dist/protocols/openai-chat.d.ts +84 -0
- package/dist/protocols/openai-chat.js +28 -17
- package/dist/protocols/openai-compatible-chat.d.ts +12 -0
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-images.d.ts +130 -7
- package/dist/protocols/openai-images.js +143 -91
- package/dist/protocols/openai-responses.d.ts +20 -20
- package/dist/protocols/openai-responses.js +31 -31
- package/dist/protocols/openai-speech.d.ts +136 -0
- package/dist/protocols/openai-speech.js +97 -0
- package/dist/protocols/openai-transcription.d.ts +211 -0
- package/dist/protocols/openai-transcription.js +202 -0
- package/dist/protocols/replicate-images.d.ts +28 -0
- package/dist/protocols/replicate-images.js +127 -0
- package/dist/protocols/runway-video.d.ts +38 -0
- package/dist/protocols/runway-video.js +140 -0
- package/dist/protocols/shared.d.ts +21 -17
- package/dist/protocols/shared.js +27 -36
- package/dist/protocols/stability-images.d.ts +39 -0
- package/dist/protocols/stability-images.js +136 -0
- package/dist/protocols/utils/fal-queue.d.ts +26 -0
- package/dist/protocols/utils/fal-queue.js +67 -0
- package/dist/protocols/utils/gemini-generate-content.d.ts +65 -0
- package/dist/protocols/utils/gemini-generate-content.js +65 -0
- package/dist/protocols/utils/gemini-json-schema.d.ts +3 -0
- package/dist/protocols/utils/gemini-json-schema.js +76 -0
- package/dist/protocols/utils/media-input.d.ts +23 -1
- package/dist/protocols/utils/media-input.js +40 -0
- package/dist/protocols/utils/responses-checkpoint.js +3 -7
- package/dist/protocols/utils/responses-compaction.d.ts +3 -1
- package/dist/protocols/utils/responses-compaction.js +16 -3
- package/dist/protocols/utils/speech-stream.d.ts +49 -0
- package/dist/protocols/utils/speech-stream.js +64 -0
- package/dist/protocols/utils/tool-schema.d.ts +2 -2
- package/dist/protocols/utils/tool-schema.js +62 -19
- package/dist/protocols/xai-images.d.ts +4 -4
- package/dist/protocols/xai-images.js +14 -40
- package/dist/protocols/xai-responses.d.ts +2 -2
- package/dist/protocols/xai-responses.js +1 -1
- package/dist/protocols/xai-video.d.ts +34 -0
- package/dist/protocols/xai-video.js +141 -0
- package/dist/protocols/zai-chat.d.ts +13 -1
- package/dist/protocols/zai-images.d.ts +2 -2
- package/dist/protocols/zai-images.js +11 -14
- package/dist/protocols/zai-messages.d.ts +1 -1
- package/dist/provider-error.js +10 -1
- package/dist/providers/alibaba.d.ts +15 -3
- package/dist/providers/amazon-bedrock-mantle.d.ts +14 -2
- package/dist/providers/amazon-bedrock.d.ts +2 -0
- package/dist/providers/amazon-bedrock.js +1 -0
- package/dist/providers/anthropic-compatible.d.ts +5 -5
- package/dist/providers/anthropic.d.ts +5 -5
- package/dist/providers/assemblyai.d.ts +25 -0
- package/dist/providers/assemblyai.js +24 -0
- package/dist/providers/azure.d.ts +20 -8
- package/dist/providers/azure.js +2 -2
- package/dist/providers/baseten.d.ts +24 -0
- package/dist/providers/black-forest-labs.d.ts +25 -0
- package/dist/providers/black-forest-labs.js +23 -0
- package/dist/providers/cartesia.d.ts +24 -0
- package/dist/providers/cartesia.js +17 -0
- package/dist/providers/cerebras.d.ts +24 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +42 -18
- package/dist/providers/cloudflare-workers-ai.d.ts +24 -0
- package/dist/providers/deepgram.d.ts +29 -0
- package/dist/providers/deepgram.js +25 -0
- package/dist/providers/deepinfra.d.ts +24 -0
- package/dist/providers/deepseek.d.ts +24 -0
- package/dist/providers/elevenlabs.d.ts +24 -0
- package/dist/providers/elevenlabs.js +23 -0
- package/dist/providers/fal.d.ts +29 -0
- package/dist/providers/fal.js +26 -0
- package/dist/providers/fireworks.d.ts +24 -0
- package/dist/providers/google-vertex-chat.d.ts +12 -0
- package/dist/providers/google-vertex-messages.d.ts +5 -5
- package/dist/providers/google-vertex-responses.d.ts +2 -2
- package/dist/providers/google-vertex.d.ts +6 -6
- package/dist/providers/google.d.ts +21 -6
- package/dist/providers/google.js +13 -9
- package/dist/providers/groq.d.ts +24 -0
- package/dist/providers/index.d.ts +9 -0
- package/dist/providers/index.js +9 -0
- package/dist/providers/meta.d.ts +22 -10
- package/dist/providers/meta.js +4 -8
- package/dist/providers/minimax.d.ts +19 -7
- package/dist/providers/moonshot.d.ts +19 -7
- package/dist/providers/moonshot.js +3 -3
- package/dist/providers/openai-compatible-responses.d.ts +2 -2
- package/dist/providers/openai-compatible.d.ts +12 -0
- package/dist/providers/openai-options.d.ts +3 -9
- package/dist/providers/openai-options.js +4 -7
- package/dist/providers/openai.d.ts +33 -12
- package/dist/providers/openai.js +17 -9
- package/dist/providers/opencode-zen.js +1 -1
- package/dist/providers/openrouter.d.ts +54 -7
- package/dist/providers/openrouter.js +10 -5
- package/dist/providers/replicate.d.ts +25 -0
- package/dist/providers/replicate.js +17 -0
- package/dist/providers/runway.d.ts +24 -0
- package/dist/providers/runway.js +17 -0
- package/dist/providers/stability.d.ts +28 -0
- package/dist/providers/stability.js +18 -0
- package/dist/providers/togetherai.d.ts +24 -0
- package/dist/providers/typesafe-ai.js +1 -1
- package/dist/providers/vercel-ai-gateway.js +1 -1
- package/dist/providers/xai.d.ts +17 -0
- package/dist/providers/xai.js +7 -9
- package/dist/providers/zai-coding-plan.d.ts +16 -4
- package/dist/providers/zai.d.ts +13 -1
- package/dist/providers/zai.js +4 -8
- package/dist/route/auth.d.ts +5 -2
- package/dist/route/auth.js +20 -13
- package/dist/route/client.d.ts +9 -7
- package/dist/route/client.js +6 -8
- package/dist/route/endpoint.d.ts +1 -0
- package/dist/route/endpoint.js +2 -2
- package/dist/route/executor-service.d.ts +4 -2
- package/dist/route/executor-service.js +2 -1
- package/dist/route/executor.d.ts +3 -1
- package/dist/route/executor.js +7 -0
- package/dist/route/framing.d.ts +15 -2
- package/dist/route/framing.js +53 -4
- package/dist/route/index.d.ts +1 -1
- package/dist/route/media-protocol.d.ts +145 -18
- package/dist/route/media-protocol.js +96 -28
- package/dist/route/media.d.ts +54 -9
- package/dist/route/media.js +194 -38
- package/dist/route/protocol.d.ts +3 -1
- package/dist/schema/events.d.ts +0 -6
- package/dist/schema/messages.d.ts +0 -3
- package/dist/schema/options.d.ts +10 -6
- package/dist/schema/options.js +10 -5
- package/dist/speech-client.d.ts +66 -0
- package/dist/speech-client.js +21 -0
- package/dist/speech.d.ts +1307 -0
- package/dist/speech.js +124 -0
- package/dist/testing.d.ts +2 -2
- package/dist/transcription-client.d.ts +82 -0
- package/dist/transcription-client.js +13 -0
- package/dist/transcription.d.ts +1492 -0
- package/dist/transcription.js +127 -0
- package/dist/utils/bytes.d.ts +1 -0
- package/dist/utils/bytes.js +10 -0
- package/dist/utils/json.d.ts +4 -0
- package/dist/utils/json.js +4 -0
- package/dist/utils/media-type.d.ts +3 -1
- package/dist/utils/media-type.js +25 -2
- package/dist/video-client.d.ts +59 -0
- package/dist/video-client.js +20 -0
- package/dist/video.d.ts +1351 -0
- package/dist/video.js +118 -0
- package/package.json +3 -3
- package/dist/protocols/utils/gemini-tool-schema.d.ts +0 -2
- package/dist/protocols/utils/gemini-tool-schema.js +0 -103
- package/dist/protocols/utils/meta-image.d.ts +0 -2
- package/dist/protocols/utils/meta-image.js +0 -13
- package/dist/protocols/utils/openai-image.d.ts +0 -5
- package/dist/protocols/utils/openai-image.js +0 -18
package/dist/image.d.ts
CHANGED
|
@@ -1,51 +1,27 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
|
+
import { Generation, type AwaitOptions } from "./generation.js";
|
|
2
3
|
import { Media } from "./media.js";
|
|
3
|
-
import {
|
|
4
|
+
import { MediaModel } from "./media-model.js";
|
|
4
5
|
import { MediaRoute } from "./route/media.js";
|
|
5
|
-
import type
|
|
6
|
-
import { AIError, HttpOptions, ModelID, ProviderID } from "./schema/index.js";
|
|
6
|
+
import { AIError, HttpOptions, type OpenString } from "./schema/index.js";
|
|
7
7
|
import { Service } from "./image-client.js";
|
|
8
|
-
export type ImageOptions =
|
|
9
|
-
export type ImageRoute
|
|
10
|
-
export declare class ImageModel<Options extends ImageOptions = ImageOptions> {
|
|
11
|
-
protected readonly
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor(input: ImageModel.Input<Options>);
|
|
17
|
-
static make<Options extends ImageOptions = ImageOptions>(input: ImageModel.MakeInput<Options>): ImageModel<Options>;
|
|
18
|
-
/** Compose an inline image protocol with its canonical path into a model for one deployment. */
|
|
19
|
-
static fromRoute<Options extends ImageOptions = ImageOptions>(route: ImageModel.RouteInput<Options>, input: MediaRoute.ModelInput): ImageModel<Options>;
|
|
8
|
+
export type ImageOptions = MediaModel.Options;
|
|
9
|
+
export type ImageRoute = MediaRoute.AnyRoute<ImageRequestFor, ImageEvent, ImageResponse>;
|
|
10
|
+
export declare class ImageModel<Options extends ImageOptions = ImageOptions> extends MediaModel<ImageRoute, Options> {
|
|
11
|
+
protected readonly _ImageModel: void;
|
|
12
|
+
/** The number of type arguments selects the kind: `<Options>`, `<Options, Frame, State>`, or `<Options, Token>`. */
|
|
13
|
+
static fromRoute<Options extends ImageOptions>(route: MediaModel.InlineRouteInput<ImageRequestFor<Options>, ImageResponse>, input: MediaRoute.ModelInput): ImageModel<Options>;
|
|
14
|
+
static fromRoute<Options extends ImageOptions, Frame, State>(route: MediaModel.StreamRouteInput<ImageRequestFor<Options>, ImageEvent, Frame, State>, input: MediaRoute.ModelInput): ImageModel<Options>;
|
|
15
|
+
static fromRoute<Options extends ImageOptions, Token>(route: MediaModel.QueuedRouteInput<ImageRequestFor<Options>, ImageResponse, Token>, input: MediaRoute.ModelInput): ImageModel<Options>;
|
|
20
16
|
}
|
|
21
|
-
export declare
|
|
22
|
-
interface Input<Options extends ImageOptions = ImageOptions> {
|
|
23
|
-
readonly id: ModelID;
|
|
24
|
-
readonly provider: ProviderID;
|
|
25
|
-
readonly route: ImageRoute<Options>;
|
|
26
|
-
readonly http?: HttpOptions;
|
|
27
|
-
}
|
|
28
|
-
interface MakeInput<Options extends ImageOptions = ImageOptions> extends Omit<Input<Options>, "id" | "provider"> {
|
|
29
|
-
readonly id: string | ModelID;
|
|
30
|
-
readonly provider: string | ProviderID;
|
|
31
|
-
}
|
|
32
|
-
interface RouteInput<Options extends ImageOptions = ImageOptions> {
|
|
33
|
-
readonly id: string;
|
|
34
|
-
readonly provider: string | ProviderID;
|
|
35
|
-
readonly protocol: MediaProtocol.Inline<ImageRequestFor<Options>, ImageResponse>;
|
|
36
|
-
readonly path: Endpoint.EndpointPart<MediaProtocol.Body, ImageRequestFor<Options>>;
|
|
37
|
-
/** Canonical base URL; `ModelInput.baseURL` overrides it per deployment. */
|
|
38
|
-
readonly baseURL?: string;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export declare const ImageModelSchema: Schema.declare<ImageModel<ImageOptions>, ImageModel<ImageOptions>>;
|
|
17
|
+
export declare const ImageModelSchema: Schema.declare<ImageModel<MediaModel.Options>, ImageModel<MediaModel.Options>>;
|
|
42
18
|
export type ImageSize = `${number}x${number}`;
|
|
43
19
|
export declare const ImageSize: Schema.declare<`${number}x${number}`, `${number}x${number}`>;
|
|
44
|
-
export type ImageAspectRatio =
|
|
20
|
+
export type ImageAspectRatio = Media.AspectRatio;
|
|
45
21
|
export declare const ImageAspectRatio: Schema.declare<`${number}:${number}`, `${number}:${number}`>;
|
|
46
|
-
export type ImageFormat = "png" | "jpeg" | "webp"
|
|
22
|
+
export type ImageFormat = OpenString<"png" | "jpeg" | "webp">;
|
|
47
23
|
declare const ImageRequest_base: Schema.Class<ImageRequest, Schema.Struct<{
|
|
48
|
-
readonly model: Schema.declare<ImageModel<
|
|
24
|
+
readonly model: Schema.declare<ImageModel<MediaModel.Options>, ImageModel<MediaModel.Options>>;
|
|
49
25
|
readonly prompt: Schema.String;
|
|
50
26
|
/** Edit sources or style/subject references, in order. */
|
|
51
27
|
readonly images: Schema.optional<Schema.$Array<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
@@ -62,7 +38,6 @@ declare const ImageRequest_base: Schema.Class<ImageRequest, Schema.Struct<{
|
|
|
62
38
|
readonly url: Schema.String;
|
|
63
39
|
readonly mediaType: Schema.optional<Schema.String>;
|
|
64
40
|
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
65
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
66
41
|
}>, Schema.Struct<{
|
|
67
42
|
readonly type: Schema.Literal<"ref">;
|
|
68
43
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -95,7 +70,6 @@ declare const ImageRequest_base: Schema.Class<ImageRequest, Schema.Struct<{
|
|
|
95
70
|
readonly url: Schema.String;
|
|
96
71
|
readonly mediaType: Schema.optional<Schema.String>;
|
|
97
72
|
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
98
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
99
73
|
}>, Schema.Struct<{
|
|
100
74
|
readonly type: Schema.Literal<"ref">;
|
|
101
75
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -150,7 +124,6 @@ declare const ImageResponse_base: Schema.Class<ImageResponse, Schema.Struct<{
|
|
|
150
124
|
readonly url: Schema.String;
|
|
151
125
|
readonly mediaType: Schema.optional<Schema.String>;
|
|
152
126
|
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
153
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
154
127
|
}>, Schema.Struct<{
|
|
155
128
|
readonly type: Schema.Literal<"ref">;
|
|
156
129
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -197,6 +170,42 @@ declare const ImageResponse_base: Schema.Class<ImageResponse, Schema.Struct<{
|
|
|
197
170
|
export declare class ImageResponse extends ImageResponse_base {
|
|
198
171
|
get image(): Media.Asset;
|
|
199
172
|
}
|
|
173
|
+
/** The `index`-th lower-fidelity preview of an image still generating; the `image` event supersedes it. */
|
|
174
|
+
export declare const ImagePartialEvent: Schema.Struct<{
|
|
175
|
+
readonly type: Schema.tag<"image-partial">;
|
|
176
|
+
readonly index: Schema.Number;
|
|
177
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
178
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
179
|
+
readonly type: Schema.Literal<"bytes">;
|
|
180
|
+
readonly data: Schema.Uint8Array;
|
|
181
|
+
readonly mediaType: Schema.String;
|
|
182
|
+
}>, Schema.Struct<{
|
|
183
|
+
readonly type: Schema.Literal<"base64">;
|
|
184
|
+
readonly data: Schema.String;
|
|
185
|
+
readonly mediaType: Schema.String;
|
|
186
|
+
}>, Schema.Struct<{
|
|
187
|
+
readonly type: Schema.Literal<"url">;
|
|
188
|
+
readonly url: Schema.String;
|
|
189
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
190
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
191
|
+
}>, Schema.Struct<{
|
|
192
|
+
readonly type: Schema.Literal<"ref">;
|
|
193
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
194
|
+
readonly id: Schema.String;
|
|
195
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
196
|
+
}>]>;
|
|
197
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
198
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
199
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
200
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
201
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
202
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
203
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
204
|
+
readonly format: Schema.optional<Schema.String>;
|
|
205
|
+
}>>;
|
|
206
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
207
|
+
}>, never, never>;
|
|
208
|
+
}>;
|
|
200
209
|
export declare const ImageOutputEvent: Schema.Struct<{
|
|
201
210
|
readonly type: Schema.tag<"image">;
|
|
202
211
|
readonly index: Schema.Number;
|
|
@@ -214,7 +223,6 @@ export declare const ImageOutputEvent: Schema.Struct<{
|
|
|
214
223
|
readonly url: Schema.String;
|
|
215
224
|
readonly mediaType: Schema.optional<Schema.String>;
|
|
216
225
|
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
217
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
218
226
|
}>, Schema.Struct<{
|
|
219
227
|
readonly type: Schema.Literal<"ref">;
|
|
220
228
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -262,6 +270,48 @@ export declare const ImageFinishEvent: Schema.Struct<{
|
|
|
262
270
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
263
271
|
}>;
|
|
264
272
|
declare const imageEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
273
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
274
|
+
readonly id: Schema.String;
|
|
275
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
276
|
+
}>, Schema.Struct<{
|
|
277
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
278
|
+
readonly id: Schema.String;
|
|
279
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
280
|
+
}>, Schema.Struct<{
|
|
281
|
+
readonly type: Schema.tag<"image-partial">;
|
|
282
|
+
readonly index: Schema.Number;
|
|
283
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
284
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
285
|
+
readonly type: Schema.Literal<"bytes">;
|
|
286
|
+
readonly data: Schema.Uint8Array;
|
|
287
|
+
readonly mediaType: Schema.String;
|
|
288
|
+
}>, Schema.Struct<{
|
|
289
|
+
readonly type: Schema.Literal<"base64">;
|
|
290
|
+
readonly data: Schema.String;
|
|
291
|
+
readonly mediaType: Schema.String;
|
|
292
|
+
}>, Schema.Struct<{
|
|
293
|
+
readonly type: Schema.Literal<"url">;
|
|
294
|
+
readonly url: Schema.String;
|
|
295
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
296
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
297
|
+
}>, Schema.Struct<{
|
|
298
|
+
readonly type: Schema.Literal<"ref">;
|
|
299
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
300
|
+
readonly id: Schema.String;
|
|
301
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
302
|
+
}>]>;
|
|
303
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
304
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
305
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
306
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
307
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
308
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
309
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
310
|
+
readonly format: Schema.optional<Schema.String>;
|
|
311
|
+
}>>;
|
|
312
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
313
|
+
}>, never, never>;
|
|
314
|
+
}>, Schema.Struct<{
|
|
265
315
|
readonly type: Schema.tag<"image">;
|
|
266
316
|
readonly index: Schema.Number;
|
|
267
317
|
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
@@ -278,7 +328,6 @@ declare const imageEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.St
|
|
|
278
328
|
readonly url: Schema.String;
|
|
279
329
|
readonly mediaType: Schema.optional<Schema.String>;
|
|
280
330
|
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
281
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
282
331
|
}>, Schema.Struct<{
|
|
283
332
|
readonly type: Schema.Literal<"ref">;
|
|
284
333
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -325,6 +374,48 @@ declare const imageEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.St
|
|
|
325
374
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
326
375
|
}>]>;
|
|
327
376
|
export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
377
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
378
|
+
readonly id: Schema.String;
|
|
379
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
380
|
+
}>, Schema.Struct<{
|
|
381
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
382
|
+
readonly id: Schema.String;
|
|
383
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
384
|
+
}>, Schema.Struct<{
|
|
385
|
+
readonly type: Schema.tag<"image-partial">;
|
|
386
|
+
readonly index: Schema.Number;
|
|
387
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
388
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
389
|
+
readonly type: Schema.Literal<"bytes">;
|
|
390
|
+
readonly data: Schema.Uint8Array;
|
|
391
|
+
readonly mediaType: Schema.String;
|
|
392
|
+
}>, Schema.Struct<{
|
|
393
|
+
readonly type: Schema.Literal<"base64">;
|
|
394
|
+
readonly data: Schema.String;
|
|
395
|
+
readonly mediaType: Schema.String;
|
|
396
|
+
}>, Schema.Struct<{
|
|
397
|
+
readonly type: Schema.Literal<"url">;
|
|
398
|
+
readonly url: Schema.String;
|
|
399
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
400
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
401
|
+
}>, Schema.Struct<{
|
|
402
|
+
readonly type: Schema.Literal<"ref">;
|
|
403
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
404
|
+
readonly id: Schema.String;
|
|
405
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
406
|
+
}>]>;
|
|
407
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
408
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
409
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
410
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
411
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
412
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
413
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
414
|
+
readonly format: Schema.optional<Schema.String>;
|
|
415
|
+
}>>;
|
|
416
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
417
|
+
}>, never, never>;
|
|
418
|
+
}>, Schema.Struct<{
|
|
328
419
|
readonly type: Schema.tag<"image">;
|
|
329
420
|
readonly index: Schema.Number;
|
|
330
421
|
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
@@ -341,7 +432,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
341
432
|
readonly url: Schema.String;
|
|
342
433
|
readonly mediaType: Schema.optional<Schema.String>;
|
|
343
434
|
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
344
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
345
435
|
}>, Schema.Struct<{
|
|
346
436
|
readonly type: Schema.Literal<"ref">;
|
|
347
437
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -387,8 +477,53 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
387
477
|
}>>>;
|
|
388
478
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
389
479
|
}>]> & {
|
|
390
|
-
readonly discriminants: readonly ["image", "finish"];
|
|
480
|
+
readonly discriminants: readonly ["generation-queued", "generation-progress", "image-partial", "image", "finish"];
|
|
391
481
|
readonly cases: {
|
|
482
|
+
"generation-queued": Schema.Struct<{
|
|
483
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
484
|
+
readonly id: Schema.String;
|
|
485
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
486
|
+
}>;
|
|
487
|
+
"generation-progress": Schema.Struct<{
|
|
488
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
489
|
+
readonly id: Schema.String;
|
|
490
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
491
|
+
}>;
|
|
492
|
+
"image-partial": Schema.Struct<{
|
|
493
|
+
readonly type: Schema.tag<"image-partial">;
|
|
494
|
+
readonly index: Schema.Number;
|
|
495
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
496
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
497
|
+
readonly type: Schema.Literal<"bytes">;
|
|
498
|
+
readonly data: Schema.Uint8Array;
|
|
499
|
+
readonly mediaType: Schema.String;
|
|
500
|
+
}>, Schema.Struct<{
|
|
501
|
+
readonly type: Schema.Literal<"base64">;
|
|
502
|
+
readonly data: Schema.String;
|
|
503
|
+
readonly mediaType: Schema.String;
|
|
504
|
+
}>, Schema.Struct<{
|
|
505
|
+
readonly type: Schema.Literal<"url">;
|
|
506
|
+
readonly url: Schema.String;
|
|
507
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
508
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
509
|
+
}>, Schema.Struct<{
|
|
510
|
+
readonly type: Schema.Literal<"ref">;
|
|
511
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
512
|
+
readonly id: Schema.String;
|
|
513
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
514
|
+
}>]>;
|
|
515
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
516
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
517
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
518
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
519
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
520
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
521
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
522
|
+
readonly format: Schema.optional<Schema.String>;
|
|
523
|
+
}>>;
|
|
524
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
525
|
+
}>, never, never>;
|
|
526
|
+
}>;
|
|
392
527
|
image: Schema.Struct<{
|
|
393
528
|
readonly type: Schema.tag<"image">;
|
|
394
529
|
readonly index: Schema.Number;
|
|
@@ -406,7 +541,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
406
541
|
readonly url: Schema.String;
|
|
407
542
|
readonly mediaType: Schema.optional<Schema.String>;
|
|
408
543
|
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
409
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
410
544
|
}>, Schema.Struct<{
|
|
411
545
|
readonly type: Schema.Literal<"ref">;
|
|
412
546
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -455,6 +589,18 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
455
589
|
}>;
|
|
456
590
|
};
|
|
457
591
|
readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
|
|
592
|
+
readonly id: string;
|
|
593
|
+
readonly type: "generation-queued";
|
|
594
|
+
readonly position?: number | undefined;
|
|
595
|
+
} | {
|
|
596
|
+
readonly id: string;
|
|
597
|
+
readonly type: "generation-progress";
|
|
598
|
+
readonly progress?: number | undefined;
|
|
599
|
+
} | {
|
|
600
|
+
readonly type: "image-partial";
|
|
601
|
+
readonly index: number;
|
|
602
|
+
readonly image: Media.Asset;
|
|
603
|
+
} | {
|
|
458
604
|
readonly type: "image";
|
|
459
605
|
readonly index: number;
|
|
460
606
|
readonly image: Media.Asset;
|
|
@@ -496,6 +642,24 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
496
642
|
} | undefined;
|
|
497
643
|
}[] | undefined;
|
|
498
644
|
}) => value is Extract<{
|
|
645
|
+
readonly id: string;
|
|
646
|
+
readonly type: "generation-queued";
|
|
647
|
+
readonly position?: number | undefined;
|
|
648
|
+
}, {
|
|
649
|
+
readonly type: Keys;
|
|
650
|
+
}> | Extract<{
|
|
651
|
+
readonly id: string;
|
|
652
|
+
readonly type: "generation-progress";
|
|
653
|
+
readonly progress?: number | undefined;
|
|
654
|
+
}, {
|
|
655
|
+
readonly type: Keys;
|
|
656
|
+
}> | Extract<{
|
|
657
|
+
readonly type: "image-partial";
|
|
658
|
+
readonly index: number;
|
|
659
|
+
readonly image: Media.Asset;
|
|
660
|
+
}, {
|
|
661
|
+
readonly type: Keys;
|
|
662
|
+
}> | Extract<{
|
|
499
663
|
readonly type: "image";
|
|
500
664
|
readonly index: number;
|
|
501
665
|
readonly image: Media.Asset;
|
|
@@ -542,6 +706,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
542
706
|
readonly type: Keys;
|
|
543
707
|
}>;
|
|
544
708
|
readonly guards: {
|
|
709
|
+
"generation-queued": (u: unknown) => u is {
|
|
710
|
+
readonly id: string;
|
|
711
|
+
readonly type: "generation-queued";
|
|
712
|
+
readonly position?: number | undefined;
|
|
713
|
+
};
|
|
714
|
+
"generation-progress": (u: unknown) => u is {
|
|
715
|
+
readonly id: string;
|
|
716
|
+
readonly type: "generation-progress";
|
|
717
|
+
readonly progress?: number | undefined;
|
|
718
|
+
};
|
|
719
|
+
"image-partial": (u: unknown) => u is {
|
|
720
|
+
readonly type: "image-partial";
|
|
721
|
+
readonly index: number;
|
|
722
|
+
readonly image: Media.Asset;
|
|
723
|
+
};
|
|
545
724
|
image: (u: unknown) => u is {
|
|
546
725
|
readonly type: "image";
|
|
547
726
|
readonly index: number;
|
|
@@ -588,6 +767,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
588
767
|
};
|
|
589
768
|
readonly match: {
|
|
590
769
|
<Cases extends {
|
|
770
|
+
"generation-queued": (value: {
|
|
771
|
+
readonly id: string;
|
|
772
|
+
readonly type: "generation-queued";
|
|
773
|
+
readonly position?: number | undefined;
|
|
774
|
+
}) => any;
|
|
775
|
+
"generation-progress": (value: {
|
|
776
|
+
readonly id: string;
|
|
777
|
+
readonly type: "generation-progress";
|
|
778
|
+
readonly progress?: number | undefined;
|
|
779
|
+
}) => any;
|
|
780
|
+
"image-partial": (value: {
|
|
781
|
+
readonly type: "image-partial";
|
|
782
|
+
readonly index: number;
|
|
783
|
+
readonly image: Media.Asset;
|
|
784
|
+
}) => any;
|
|
591
785
|
image: (value: {
|
|
592
786
|
readonly type: "image";
|
|
593
787
|
readonly index: number;
|
|
@@ -632,6 +826,18 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
632
826
|
}[] | undefined;
|
|
633
827
|
}) => any;
|
|
634
828
|
}>(value: {
|
|
829
|
+
readonly id: string;
|
|
830
|
+
readonly type: "generation-queued";
|
|
831
|
+
readonly position?: number | undefined;
|
|
832
|
+
} | {
|
|
833
|
+
readonly id: string;
|
|
834
|
+
readonly type: "generation-progress";
|
|
835
|
+
readonly progress?: number | undefined;
|
|
836
|
+
} | {
|
|
837
|
+
readonly type: "image-partial";
|
|
838
|
+
readonly index: number;
|
|
839
|
+
readonly image: Media.Asset;
|
|
840
|
+
} | {
|
|
635
841
|
readonly type: "image";
|
|
636
842
|
readonly index: number;
|
|
637
843
|
readonly image: Media.Asset;
|
|
@@ -674,6 +880,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
674
880
|
}[] | undefined;
|
|
675
881
|
}, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
|
|
676
882
|
<Cases extends {
|
|
883
|
+
"generation-queued": (value: {
|
|
884
|
+
readonly id: string;
|
|
885
|
+
readonly type: "generation-queued";
|
|
886
|
+
readonly position?: number | undefined;
|
|
887
|
+
}) => any;
|
|
888
|
+
"generation-progress": (value: {
|
|
889
|
+
readonly id: string;
|
|
890
|
+
readonly type: "generation-progress";
|
|
891
|
+
readonly progress?: number | undefined;
|
|
892
|
+
}) => any;
|
|
893
|
+
"image-partial": (value: {
|
|
894
|
+
readonly type: "image-partial";
|
|
895
|
+
readonly index: number;
|
|
896
|
+
readonly image: Media.Asset;
|
|
897
|
+
}) => any;
|
|
677
898
|
image: (value: {
|
|
678
899
|
readonly type: "image";
|
|
679
900
|
readonly index: number;
|
|
@@ -718,6 +939,18 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
718
939
|
}[] | undefined;
|
|
719
940
|
}) => any;
|
|
720
941
|
}>(cases: Cases): (value: {
|
|
942
|
+
readonly id: string;
|
|
943
|
+
readonly type: "generation-queued";
|
|
944
|
+
readonly position?: number | undefined;
|
|
945
|
+
} | {
|
|
946
|
+
readonly id: string;
|
|
947
|
+
readonly type: "generation-progress";
|
|
948
|
+
readonly progress?: number | undefined;
|
|
949
|
+
} | {
|
|
950
|
+
readonly type: "image-partial";
|
|
951
|
+
readonly index: number;
|
|
952
|
+
readonly image: Media.Asset;
|
|
953
|
+
} | {
|
|
721
954
|
readonly type: "image";
|
|
722
955
|
readonly index: number;
|
|
723
956
|
readonly image: Media.Asset;
|
|
@@ -762,6 +995,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
762
995
|
};
|
|
763
996
|
readonly matchOrElse: {
|
|
764
997
|
<Cases extends {
|
|
998
|
+
"generation-queued"?: ((value: {
|
|
999
|
+
readonly id: string;
|
|
1000
|
+
readonly type: "generation-queued";
|
|
1001
|
+
readonly position?: number | undefined;
|
|
1002
|
+
}) => any) | undefined;
|
|
1003
|
+
"generation-progress"?: ((value: {
|
|
1004
|
+
readonly id: string;
|
|
1005
|
+
readonly type: "generation-progress";
|
|
1006
|
+
readonly progress?: number | undefined;
|
|
1007
|
+
}) => any) | undefined;
|
|
1008
|
+
"image-partial"?: ((value: {
|
|
1009
|
+
readonly type: "image-partial";
|
|
1010
|
+
readonly index: number;
|
|
1011
|
+
readonly image: Media.Asset;
|
|
1012
|
+
}) => any) | undefined;
|
|
765
1013
|
image?: ((value: {
|
|
766
1014
|
readonly type: "image";
|
|
767
1015
|
readonly index: number;
|
|
@@ -805,7 +1053,25 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
805
1053
|
} | undefined;
|
|
806
1054
|
}[] | undefined;
|
|
807
1055
|
}) => any) | undefined;
|
|
808
|
-
} & { [K in Exclude<keyof Cases, "image" | "finish">]: never; }, OrElse extends (value: Exclude<{
|
|
1056
|
+
} & { [K in Exclude<keyof Cases, "image" | "finish" | "generation-queued" | "generation-progress" | "image-partial">]: never; }, OrElse extends (value: Exclude<{
|
|
1057
|
+
readonly id: string;
|
|
1058
|
+
readonly type: "generation-queued";
|
|
1059
|
+
readonly position?: number | undefined;
|
|
1060
|
+
}, {
|
|
1061
|
+
readonly type: keyof Cases;
|
|
1062
|
+
}> | Exclude<{
|
|
1063
|
+
readonly id: string;
|
|
1064
|
+
readonly type: "generation-progress";
|
|
1065
|
+
readonly progress?: number | undefined;
|
|
1066
|
+
}, {
|
|
1067
|
+
readonly type: keyof Cases;
|
|
1068
|
+
}> | Exclude<{
|
|
1069
|
+
readonly type: "image-partial";
|
|
1070
|
+
readonly index: number;
|
|
1071
|
+
readonly image: Media.Asset;
|
|
1072
|
+
}, {
|
|
1073
|
+
readonly type: keyof Cases;
|
|
1074
|
+
}> | Exclude<{
|
|
809
1075
|
readonly type: "image";
|
|
810
1076
|
readonly index: number;
|
|
811
1077
|
readonly image: Media.Asset;
|
|
@@ -851,6 +1117,18 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
851
1117
|
}, {
|
|
852
1118
|
readonly type: keyof Cases;
|
|
853
1119
|
}>) => any>(value: {
|
|
1120
|
+
readonly id: string;
|
|
1121
|
+
readonly type: "generation-queued";
|
|
1122
|
+
readonly position?: number | undefined;
|
|
1123
|
+
} | {
|
|
1124
|
+
readonly id: string;
|
|
1125
|
+
readonly type: "generation-progress";
|
|
1126
|
+
readonly progress?: number | undefined;
|
|
1127
|
+
} | {
|
|
1128
|
+
readonly type: "image-partial";
|
|
1129
|
+
readonly index: number;
|
|
1130
|
+
readonly image: Media.Asset;
|
|
1131
|
+
} | {
|
|
854
1132
|
readonly type: "image";
|
|
855
1133
|
readonly index: number;
|
|
856
1134
|
readonly image: Media.Asset;
|
|
@@ -893,6 +1171,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
893
1171
|
}[] | undefined;
|
|
894
1172
|
}, 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>>;
|
|
895
1173
|
<Cases extends {
|
|
1174
|
+
"generation-queued"?: ((value: {
|
|
1175
|
+
readonly id: string;
|
|
1176
|
+
readonly type: "generation-queued";
|
|
1177
|
+
readonly position?: number | undefined;
|
|
1178
|
+
}) => any) | undefined;
|
|
1179
|
+
"generation-progress"?: ((value: {
|
|
1180
|
+
readonly id: string;
|
|
1181
|
+
readonly type: "generation-progress";
|
|
1182
|
+
readonly progress?: number | undefined;
|
|
1183
|
+
}) => any) | undefined;
|
|
1184
|
+
"image-partial"?: ((value: {
|
|
1185
|
+
readonly type: "image-partial";
|
|
1186
|
+
readonly index: number;
|
|
1187
|
+
readonly image: Media.Asset;
|
|
1188
|
+
}) => any) | undefined;
|
|
896
1189
|
image?: ((value: {
|
|
897
1190
|
readonly type: "image";
|
|
898
1191
|
readonly index: number;
|
|
@@ -936,7 +1229,25 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
936
1229
|
} | undefined;
|
|
937
1230
|
}[] | undefined;
|
|
938
1231
|
}) => any) | undefined;
|
|
939
|
-
} & { [K in Exclude<keyof Cases, "image" | "finish">]: never; }, OrElse extends (value: Exclude<{
|
|
1232
|
+
} & { [K in Exclude<keyof Cases, "image" | "finish" | "generation-queued" | "generation-progress" | "image-partial">]: never; }, OrElse extends (value: Exclude<{
|
|
1233
|
+
readonly id: string;
|
|
1234
|
+
readonly type: "generation-queued";
|
|
1235
|
+
readonly position?: number | undefined;
|
|
1236
|
+
}, {
|
|
1237
|
+
readonly type: keyof Cases;
|
|
1238
|
+
}> | Exclude<{
|
|
1239
|
+
readonly id: string;
|
|
1240
|
+
readonly type: "generation-progress";
|
|
1241
|
+
readonly progress?: number | undefined;
|
|
1242
|
+
}, {
|
|
1243
|
+
readonly type: keyof Cases;
|
|
1244
|
+
}> | Exclude<{
|
|
1245
|
+
readonly type: "image-partial";
|
|
1246
|
+
readonly index: number;
|
|
1247
|
+
readonly image: Media.Asset;
|
|
1248
|
+
}, {
|
|
1249
|
+
readonly type: keyof Cases;
|
|
1250
|
+
}> | Exclude<{
|
|
940
1251
|
readonly type: "image";
|
|
941
1252
|
readonly index: number;
|
|
942
1253
|
readonly image: Media.Asset;
|
|
@@ -982,6 +1293,18 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
982
1293
|
}, {
|
|
983
1294
|
readonly type: keyof Cases;
|
|
984
1295
|
}>) => any>(cases: Cases, orElse: OrElse): (value: {
|
|
1296
|
+
readonly id: string;
|
|
1297
|
+
readonly type: "generation-queued";
|
|
1298
|
+
readonly position?: number | undefined;
|
|
1299
|
+
} | {
|
|
1300
|
+
readonly id: string;
|
|
1301
|
+
readonly type: "generation-progress";
|
|
1302
|
+
readonly progress?: number | undefined;
|
|
1303
|
+
} | {
|
|
1304
|
+
readonly type: "image-partial";
|
|
1305
|
+
readonly index: number;
|
|
1306
|
+
readonly image: Media.Asset;
|
|
1307
|
+
} | {
|
|
985
1308
|
readonly type: "image";
|
|
986
1309
|
readonly index: number;
|
|
987
1310
|
readonly image: Media.Asset;
|
|
@@ -1026,6 +1349,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1026
1349
|
};
|
|
1027
1350
|
} & {
|
|
1028
1351
|
is: {
|
|
1352
|
+
generationQueued: (u: unknown) => u is {
|
|
1353
|
+
readonly id: string;
|
|
1354
|
+
readonly type: "generation-queued";
|
|
1355
|
+
readonly position?: number | undefined;
|
|
1356
|
+
};
|
|
1357
|
+
generationProgress: (u: unknown) => u is {
|
|
1358
|
+
readonly id: string;
|
|
1359
|
+
readonly type: "generation-progress";
|
|
1360
|
+
readonly progress?: number | undefined;
|
|
1361
|
+
};
|
|
1362
|
+
imagePartial: (u: unknown) => u is {
|
|
1363
|
+
readonly type: "image-partial";
|
|
1364
|
+
readonly index: number;
|
|
1365
|
+
readonly image: Media.Asset;
|
|
1366
|
+
};
|
|
1029
1367
|
image: (u: unknown) => u is {
|
|
1030
1368
|
readonly type: "image";
|
|
1031
1369
|
readonly index: number;
|
|
@@ -1072,17 +1410,18 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1072
1410
|
};
|
|
1073
1411
|
};
|
|
1074
1412
|
export type ImageEvent = Schema.Schema.Type<typeof imageEventTagged>;
|
|
1075
|
-
/** Inline routes produce every image at once; expand the response into the streaming event shape. */
|
|
1076
|
-
export declare const responseEvents: (response: ImageResponse) => ReadonlyArray<ImageEvent>;
|
|
1077
1413
|
export declare function request<const Model extends ImageModel>(input: ImageRequestInput<Model>): ImageRequestFor<ImageModelOptions<Model>>;
|
|
1078
1414
|
export declare function request(input: ImageRequest): ImageRequest;
|
|
1079
|
-
export declare function generate<const Model extends ImageModel>(input: ImageRequestInput<Model
|
|
1080
|
-
export declare function
|
|
1081
|
-
|
|
1082
|
-
export declare function
|
|
1415
|
+
export declare function generate<const Model extends ImageModel>(input: ImageRequest | ImageRequestInput<Model>, options?: AwaitOptions): Effect.Effect<ImageResponse, AIError, Service>;
|
|
1416
|
+
export declare function stream<const Model extends ImageModel>(input: ImageRequest | ImageRequestInput<Model>, options?: AwaitOptions): Stream.Stream<ImageEvent, AIError, Service>;
|
|
1417
|
+
/** Inline and streaming routes fail with `UnsupportedOperation`. */
|
|
1418
|
+
export declare function start<const Model extends ImageModel>(input: ImageRequest | ImageRequestInput<Model>): Effect.Effect<Generation<ImageResponse>, AIError, Service>;
|
|
1419
|
+
export declare const resume: (model: ImageModel, token: unknown) => Effect.Effect<Generation<ImageResponse>, AIError, Service>;
|
|
1083
1420
|
export declare const Image: {
|
|
1084
1421
|
readonly request: typeof request;
|
|
1085
1422
|
readonly generate: typeof generate;
|
|
1086
1423
|
readonly stream: typeof stream;
|
|
1424
|
+
readonly start: typeof start;
|
|
1425
|
+
readonly resume: (model: ImageModel, token: unknown) => Effect.Effect<Generation<ImageResponse>, AIError, Service>;
|
|
1087
1426
|
};
|
|
1088
1427
|
export {};
|