@opencode/ai 2.2.5 → 2.2.6
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 +133 -69
- package/dist/cache-policy.d.ts +1 -1
- package/dist/cache-policy.js +16 -4
- package/dist/decision-client.d.ts +3 -3
- package/dist/decision.d.ts +20 -125
- package/dist/decision.js +25 -15
- package/dist/effect.d.ts +4 -15
- package/dist/effect.js +2 -6
- package/dist/effort-updates.d.ts +3 -3
- package/dist/effort-updates.js +2 -2
- package/dist/experimental/cloudflare-run-extraction.d.ts +7 -3
- package/dist/experimental/cloudflare-run-extraction.js +4 -1
- package/dist/experimental/extraction.d.ts +10 -40
- package/dist/experimental/extraction.js +14 -13
- package/dist/experimental.d.ts +8 -8
- package/dist/experimental.js +4 -4
- package/dist/generation.d.ts +0 -2
- package/dist/generation.js +2 -2
- package/dist/image-client.d.ts +13 -7
- package/dist/image-client.js +1 -1
- package/dist/image.d.ts +357 -464
- package/dist/image.js +17 -15
- package/dist/index.d.ts +28 -465
- package/dist/index.js +18 -17
- package/dist/llm.d.ts +65 -266
- package/dist/llm.js +101 -92
- package/dist/loop.d.ts +38 -0
- package/dist/loop.js +136 -0
- package/dist/media-model.d.ts +1 -1
- package/dist/media-model.js +8 -6
- package/dist/media.d.ts +9 -0
- package/dist/media.js +37 -2
- package/dist/protocols/alibaba-chat.d.ts +5 -1
- package/dist/protocols/alibaba-chat.js +3 -3
- package/dist/protocols/alibaba-images.d.ts +2 -2
- package/dist/protocols/alibaba-messages.js +3 -3
- package/dist/protocols/alibaba-responses.js +8 -20
- package/dist/protocols/anthropic-messages.d.ts +1 -1
- package/dist/protocols/anthropic-messages.js +54 -173
- package/dist/protocols/assemblyai-transcription.d.ts +2 -2
- package/dist/protocols/bedrock-converse.js +10 -16
- package/dist/protocols/cartesia-speech.d.ts +2 -2
- package/dist/protocols/cloudflare-workers-ai-images.d.ts +2 -2
- package/dist/protocols/cohere-chat.js +9 -12
- package/dist/protocols/deepgram-speech.d.ts +2 -2
- package/dist/protocols/deepgram-transcription.d.ts +2 -2
- package/dist/protocols/elevenlabs-speech.d.ts +2 -2
- package/dist/protocols/elevenlabs-transcription.d.ts +2 -2
- package/dist/protocols/gemini.d.ts +3 -0
- package/dist/protocols/gemini.js +54 -72
- package/dist/protocols/google-images.d.ts +2 -2
- package/dist/protocols/google-interactions.d.ts +3 -4
- package/dist/protocols/google-interactions.js +44 -30
- package/dist/protocols/google-speech.d.ts +2 -2
- package/dist/protocols/google-transcription.d.ts +2 -2
- package/dist/protocols/google-video.d.ts +2 -2
- package/dist/protocols/meta-images.d.ts +2 -2
- package/dist/protocols/meta-responses.js +26 -23
- package/dist/protocols/minimax-images.d.ts +2 -2
- package/dist/protocols/mistral-chat.js +7 -10
- package/dist/protocols/open-responses-channel.js +6 -19
- package/dist/protocols/open-responses-continuation.d.ts +1 -5
- package/dist/protocols/open-responses-continuation.js +1 -3
- package/dist/protocols/open-responses.d.ts +1 -21
- package/dist/protocols/open-responses.js +10 -15
- package/dist/protocols/openai-chat.d.ts +3 -23
- package/dist/protocols/openai-chat.js +26 -47
- package/dist/protocols/openai-compatible-chat.d.ts +1 -1
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-compatible-responses.js +1 -1
- package/dist/protocols/openai-decisions.js +1 -1
- package/dist/protocols/openai-images.d.ts +2 -2
- package/dist/protocols/openai-responses.js +10 -29
- package/dist/protocols/openai-speech.d.ts +2 -2
- package/dist/protocols/openai-transcription.d.ts +2 -2
- package/dist/protocols/runway-video.d.ts +2 -2
- package/dist/protocols/shared.d.ts +1 -4
- package/dist/protocols/shared.js +13 -11
- package/dist/protocols/system-one.d.ts +4 -4
- package/dist/protocols/utils/bedrock-cache.js +2 -5
- package/dist/protocols/utils/bedrock-media.d.ts +0 -3
- package/dist/protocols/utils/cache.d.ts +3 -0
- package/dist/protocols/utils/cache.js +15 -2
- package/dist/protocols/utils/image-sizing.d.ts +1 -1
- package/dist/protocols/utils/responses-checkpoint.js +1 -1
- package/dist/protocols/utils/responses-compaction.d.ts +1 -1
- package/dist/protocols/utils/responses-compaction.js +6 -5
- package/dist/protocols/utils/responses-hosted-tools.d.ts +97 -1
- package/dist/protocols/utils/responses-hosted-tools.js +31 -0
- package/dist/protocols/utils/tool-stream.d.ts +5 -271
- package/dist/protocols/utils/tool-stream.js +3 -13
- package/dist/protocols/venice-chat.d.ts +3 -1
- package/dist/protocols/venice-chat.js +4 -4
- package/dist/protocols/xai-images.d.ts +2 -2
- package/dist/protocols/xai-responses.js +5 -25
- package/dist/protocols/xai-video.d.ts +2 -2
- package/dist/protocols/zai-chat.d.ts +5 -1
- package/dist/protocols/zai-chat.js +1 -1
- package/dist/protocols/zai-images.d.ts +2 -2
- package/dist/protocols/zai-messages.js +3 -3
- package/dist/provider-error.d.ts +0 -1
- package/dist/provider-error.js +7 -80
- package/dist/providers/alibaba.d.ts +67 -4
- package/dist/providers/alibaba.js +6 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +6 -3
- package/dist/providers/amazon-bedrock-mantle.js +6 -3
- package/dist/providers/amazon-bedrock.d.ts +6 -7
- package/dist/providers/amazon-bedrock.js +1 -1
- package/dist/providers/anthropic-compatible.d.ts +7 -8
- package/dist/providers/anthropic-compatible.js +2 -5
- package/dist/providers/anthropic.d.ts +8 -9
- package/dist/providers/anthropic.js +2 -7
- package/dist/providers/assemblyai.d.ts +2 -2
- package/dist/providers/assemblyai.js +2 -7
- package/dist/providers/azure/messages.d.ts +2 -0
- package/dist/providers/azure/messages.js +1 -0
- package/dist/providers/azure.d.ts +322 -7
- package/dist/providers/azure.js +25 -9
- package/dist/providers/baseten.d.ts +5 -5
- package/dist/providers/baseten.js +7 -21
- package/dist/providers/cartesia.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +5 -5
- package/dist/providers/cerebras.js +4 -15
- package/dist/providers/cloudflare-ai-gateway.d.ts +21 -13
- package/dist/providers/cloudflare-ai-gateway.js +28 -40
- package/dist/providers/cloudflare-shared.d.ts +9 -0
- package/dist/providers/cloudflare-shared.js +25 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +4 -4
- package/dist/providers/cloudflare-workers-ai.js +4 -20
- package/dist/providers/cohere/chat.js +2 -7
- package/dist/providers/cohere.d.ts +6 -5
- package/dist/providers/cohere.js +7 -13
- package/dist/providers/deepgram.d.ts +2 -2
- package/dist/providers/deepgram.js +2 -7
- package/dist/providers/deepinfra.d.ts +5 -5
- package/dist/providers/deepinfra.js +5 -13
- package/dist/providers/deepseek.d.ts +5 -5
- package/dist/providers/deepseek.js +3 -14
- package/dist/providers/digitalocean.d.ts +8 -5
- package/dist/providers/digitalocean.js +13 -14
- package/dist/providers/elevenlabs.d.ts +2 -2
- package/dist/providers/elevenlabs.js +2 -7
- package/dist/providers/fireworks.d.ts +5 -5
- package/dist/providers/fireworks.js +4 -15
- package/dist/providers/google/interactions.d.ts +1 -1
- package/dist/providers/google/interactions.js +2 -7
- package/dist/providers/google-vertex-chat.d.ts +3 -3
- package/dist/providers/google-vertex-chat.js +3 -29
- package/dist/providers/google-vertex-interactions.d.ts +3 -3
- package/dist/providers/google-vertex-messages.d.ts +3 -3
- package/dist/providers/google-vertex-messages.js +3 -29
- package/dist/providers/google-vertex-mistral.d.ts +3 -3
- package/dist/providers/google-vertex-mistral.js +3 -29
- package/dist/providers/google-vertex-responses.d.ts +3 -3
- package/dist/providers/google-vertex-responses.js +4 -30
- package/dist/providers/google-vertex-shared.d.ts +31 -0
- package/dist/providers/google-vertex-shared.js +25 -0
- package/dist/providers/google-vertex.d.ts +3 -3
- package/dist/providers/google.d.ts +15 -13
- package/dist/providers/google.js +9 -19
- package/dist/providers/groq.d.ts +5 -5
- package/dist/providers/groq.js +4 -15
- package/dist/providers/meta.d.ts +5 -5
- package/dist/providers/meta.js +10 -23
- package/dist/providers/minimax/chat.js +2 -7
- package/dist/providers/minimax/responses.js +2 -7
- package/dist/providers/minimax.d.ts +5 -5
- package/dist/providers/minimax.js +7 -22
- package/dist/providers/mistral.d.ts +10 -11
- package/dist/providers/mistral.js +3 -14
- package/dist/providers/moonshot/messages.js +2 -7
- package/dist/providers/moonshot/responses.js +2 -7
- package/dist/providers/moonshot.d.ts +5 -5
- package/dist/providers/moonshot.js +4 -16
- package/dist/providers/openai-compatible-responses.d.ts +6 -7
- package/dist/providers/openai-compatible-responses.js +2 -8
- package/dist/providers/openai-compatible.d.ts +6 -7
- package/dist/providers/openai-compatible.js +4 -10
- package/dist/providers/openai.d.ts +4 -4
- package/dist/providers/openai.js +3 -3
- package/dist/providers/opencode.d.ts +4 -4
- package/dist/providers/opencode.js +6 -2
- package/dist/providers/openrouter.d.ts +8 -5
- package/dist/providers/openrouter.js +16 -24
- package/dist/providers/runway.d.ts +1 -1
- package/dist/providers/settings.d.ts +40 -0
- package/dist/providers/settings.js +19 -0
- package/dist/providers/togetherai.d.ts +5 -5
- package/dist/providers/togetherai.js +5 -15
- package/dist/providers/typesafe-ai.d.ts +4 -4
- package/dist/providers/typesafe-ai.js +6 -2
- package/dist/providers/venice.d.ts +4 -4
- package/dist/providers/venice.js +6 -2
- package/dist/providers/vercel-ai-gateway.d.ts +5 -5
- package/dist/providers/vercel-ai-gateway.js +15 -28
- package/dist/providers/xai.d.ts +4 -4
- package/dist/providers/xai.js +4 -12
- package/dist/providers/zai-coding-plan/messages.js +2 -7
- package/dist/providers/zai-coding-plan/responses.js +2 -7
- package/dist/providers/zai-coding-plan.d.ts +5 -5
- package/dist/providers/zai-coding-plan.js +8 -15
- package/dist/providers/zai.d.ts +5 -5
- package/dist/providers/zai.js +10 -22
- package/dist/public.d.ts +12 -0
- package/dist/public.js +5 -0
- package/dist/route/auth-options.d.ts +9 -5
- package/dist/route/auth-options.js +10 -7
- package/dist/route/client.d.ts +50 -37
- package/dist/route/client.js +42 -53
- package/dist/route/decision.d.ts +8 -8
- package/dist/route/decision.js +3 -3
- package/dist/route/executor.d.ts +5 -0
- package/dist/route/executor.js +10 -0
- package/dist/route/index.d.ts +5 -7
- package/dist/route/index.js +1 -1
- package/dist/route/media.d.ts +7 -11
- package/dist/route/media.js +22 -26
- package/dist/route/transport/http.js +6 -5
- package/dist/route/transport/websocket.js +7 -1
- package/dist/schema/errors.d.ts +16 -17
- package/dist/schema/errors.js +63 -12
- package/dist/schema/events.d.ts +2563 -2954
- package/dist/schema/events.js +54 -109
- package/dist/schema/messages.d.ts +194 -137
- package/dist/schema/messages.js +66 -83
- package/dist/schema/options.d.ts +112 -65
- package/dist/schema/options.js +52 -101
- package/dist/speech-client.d.ts +7 -7
- package/dist/speech.d.ts +306 -316
- package/dist/speech.js +16 -14
- package/dist/testing.d.ts +31 -175
- package/dist/testing.js +60 -5
- package/dist/tool-history.d.ts +1 -1
- package/dist/tool-history.js +3 -10
- package/dist/tool-runtime.d.ts +9 -2
- package/dist/tool-runtime.js +17 -31
- package/dist/tool.d.ts +39 -43
- package/dist/tool.js +16 -26
- package/dist/transcription-client.d.ts +7 -7
- package/dist/transcription.d.ts +314 -265
- package/dist/transcription.js +16 -14
- package/dist/utils/provider-codes.d.ts +3 -0
- package/dist/utils/provider-codes.js +41 -0
- package/dist/video-client.d.ts +7 -7
- package/dist/video-client.js +1 -1
- package/dist/video.d.ts +269 -287
- package/dist/video.js +16 -14
- package/package.json +9 -9
- package/dist/experimental/testing.d.ts +0 -3
- package/dist/experimental/testing.js +0 -3
- package/dist/testing/decision.d.ts +0 -16
- package/dist/testing/decision.js +0 -20
- package/dist/testing/image.d.ts +0 -14
- package/dist/testing/image.js +0 -12
- package/dist/testing/media.d.ts +0 -18
- package/dist/testing/media.js +0 -36
- package/dist/testing/script.d.ts +0 -28
- package/dist/testing/script.js +0 -60
- package/dist/testing/speech.d.ts +0 -14
- package/dist/testing/speech.js +0 -12
- package/dist/testing/transcription.d.ts +0 -14
- package/dist/testing/transcription.js +0 -12
- package/dist/testing/video.d.ts +0 -14
- package/dist/testing/video.js +0 -12
package/dist/video.d.ts
CHANGED
|
@@ -3,16 +3,16 @@ import { Generation, type AwaitOptions } from "./generation.js";
|
|
|
3
3
|
import { Media } from "./media.js";
|
|
4
4
|
import { MediaModel } from "./media-model.js";
|
|
5
5
|
import { MediaRoute } from "./route/media.js";
|
|
6
|
-
import { AIError,
|
|
6
|
+
import { AIError, type OpenString, type BaseRequest } from "./schema/index.js";
|
|
7
7
|
import { Service } from "./video-client.js";
|
|
8
8
|
export type VideoOptions = MediaModel.Options;
|
|
9
|
-
export type VideoRoute = MediaRoute.AnyRoute<
|
|
9
|
+
export type VideoRoute = MediaRoute.AnyRoute<VideoRequest, VideoEvent, VideoResponse>;
|
|
10
10
|
export declare class VideoModel<Options extends VideoOptions = VideoOptions> extends MediaModel<VideoRoute, Options> {
|
|
11
11
|
protected readonly _VideoModel: void;
|
|
12
12
|
/** The number of type arguments selects the kind: `<Options>`, `<Options, Frame, State>`, or `<Options, Token>`. */
|
|
13
|
-
static fromRoute<Options extends VideoOptions>(route: MediaModel.InlineRouteInput<
|
|
14
|
-
static fromRoute<Options extends VideoOptions, Frame, State>(route: MediaModel.StreamRouteInput<
|
|
15
|
-
static fromRoute<Options extends VideoOptions, Token>(route: MediaModel.QueuedRouteInput<
|
|
13
|
+
static fromRoute<Options extends VideoOptions>(route: MediaModel.InlineRouteInput<VideoRequest<VideoModel<Options>>, VideoResponse>, input: MediaRoute.ModelInput): VideoModel<Options>;
|
|
14
|
+
static fromRoute<Options extends VideoOptions, Frame, State>(route: MediaModel.StreamRouteInput<VideoRequest<VideoModel<Options>>, VideoEvent, Frame, State>, input: MediaRoute.ModelInput): VideoModel<Options>;
|
|
15
|
+
static fromRoute<Options extends VideoOptions, Token>(route: MediaModel.QueuedRouteInput<VideoRequest<VideoModel<Options>>, VideoResponse, Token>, input: MediaRoute.ModelInput): VideoModel<Options>;
|
|
16
16
|
}
|
|
17
17
|
export declare const VideoModelSchema: Schema.declare<VideoModel<{
|
|
18
18
|
readonly [x: string]: unknown;
|
|
@@ -88,7 +88,7 @@ export declare const VideoFrames: Schema.Struct<{
|
|
|
88
88
|
}>, never, never>>;
|
|
89
89
|
}>;
|
|
90
90
|
export type VideoFrames = Schema.Schema.Type<typeof VideoFrames>;
|
|
91
|
-
declare const
|
|
91
|
+
declare const VideoRequestSchema: Schema.Struct<{
|
|
92
92
|
readonly model: Schema.declare<VideoModel<{
|
|
93
93
|
readonly [x: string]: unknown;
|
|
94
94
|
}>, VideoModel<{
|
|
@@ -232,21 +232,15 @@ declare const VideoRequest_base: Schema.Class<VideoRequest, Schema.Struct<{
|
|
|
232
232
|
readonly seed: Schema.optional<Schema.Number>;
|
|
233
233
|
readonly negativePrompt: Schema.optional<Schema.String>;
|
|
234
234
|
readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
export
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
export type VideoRequestFor<Options extends VideoOptions = VideoOptions> = Omit<VideoRequest, "model" | "providerOptions"> & {
|
|
241
|
-
readonly model: VideoModel<Options>;
|
|
242
|
-
readonly providerOptions?: Options;
|
|
235
|
+
}>;
|
|
236
|
+
/** A normalized video request, the plain object `Video.request(...)` returns. */
|
|
237
|
+
export type VideoRequest<Model extends VideoModel = VideoModel> = Omit<typeof VideoRequestSchema.Type, "model" | "providerOptions" | "resolution"> & BaseRequest<Model, VideoModelOptions<Model>> & {
|
|
238
|
+
readonly resolution?: VideoResolution;
|
|
243
239
|
};
|
|
244
240
|
export type VideoModelOptions<Model> = Model extends VideoModel<infer Options> ? Options : never;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
readonly resolution?: VideoResolution;
|
|
241
|
+
/** Input accepted by `Video.request` and the calls; a `VideoRequest` is also a valid input. */
|
|
242
|
+
export type VideoRequestInput<Model extends VideoModel = VideoModel> = Omit<VideoRequest<Model>, "providerOptions"> & {
|
|
248
243
|
readonly providerOptions?: NoInfer<VideoModelOptions<Model>>;
|
|
249
|
-
readonly http?: HttpOptions.Input;
|
|
250
244
|
};
|
|
251
245
|
declare const VideoResponse_base: Schema.Class<VideoResponse, Schema.Struct<{
|
|
252
246
|
readonly videos: Schema.$Array<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
@@ -700,71 +694,76 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
700
694
|
};
|
|
701
695
|
};
|
|
702
696
|
readonly match: {
|
|
703
|
-
<
|
|
704
|
-
readonly
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
readonly type: Schema.tag<"video">;
|
|
713
|
-
readonly index: Schema.Number;
|
|
714
|
-
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
715
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
716
|
-
readonly type: Schema.Literal<"bytes">;
|
|
717
|
-
readonly data: Schema.Uint8Array;
|
|
718
|
-
readonly mediaType: Schema.String;
|
|
697
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "video"]: (value: {
|
|
698
|
+
readonly finish: Schema.Struct<{
|
|
699
|
+
readonly type: Schema.tag<"finish">;
|
|
700
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
701
|
+
readonly type: Schema.Literal<"tokens">;
|
|
702
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
703
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
704
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
705
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
719
706
|
}>, Schema.Struct<{
|
|
720
|
-
readonly type: Schema.Literal<"
|
|
721
|
-
readonly
|
|
722
|
-
readonly mediaType: Schema.String;
|
|
707
|
+
readonly type: Schema.Literal<"seconds">;
|
|
708
|
+
readonly seconds: Schema.Number;
|
|
723
709
|
}>, Schema.Struct<{
|
|
724
|
-
readonly type: Schema.Literal<"
|
|
725
|
-
readonly
|
|
726
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
727
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
710
|
+
readonly type: Schema.Literal<"characters">;
|
|
711
|
+
readonly characters: Schema.Number;
|
|
728
712
|
}>, Schema.Struct<{
|
|
729
|
-
readonly type: Schema.Literal<"
|
|
730
|
-
readonly
|
|
731
|
-
|
|
732
|
-
readonly
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
736
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
737
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
738
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
739
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
740
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
741
|
-
readonly format: Schema.optional<Schema.String>;
|
|
742
|
-
}>>;
|
|
713
|
+
readonly type: Schema.Literal<"credits">;
|
|
714
|
+
readonly credits: Schema.Number;
|
|
715
|
+
}>, Schema.Struct<{
|
|
716
|
+
readonly type: Schema.Literal<"compute">;
|
|
717
|
+
readonly seconds: Schema.Number;
|
|
718
|
+
}>]>>;
|
|
743
719
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
readonly
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
readonly
|
|
752
|
-
readonly
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
readonly
|
|
758
|
-
readonly
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
720
|
+
}>;
|
|
721
|
+
readonly "generation-progress": Schema.Struct<{
|
|
722
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
723
|
+
readonly id: Schema.String;
|
|
724
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
725
|
+
}>;
|
|
726
|
+
readonly "generation-queued": Schema.Struct<{
|
|
727
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
728
|
+
readonly id: Schema.String;
|
|
729
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
730
|
+
}>;
|
|
731
|
+
readonly video: Schema.Struct<{
|
|
732
|
+
readonly type: Schema.tag<"video">;
|
|
733
|
+
readonly index: Schema.Number;
|
|
734
|
+
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
735
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
736
|
+
readonly type: Schema.Literal<"bytes">;
|
|
737
|
+
readonly data: Schema.Uint8Array;
|
|
738
|
+
readonly mediaType: Schema.String;
|
|
739
|
+
}>, Schema.Struct<{
|
|
740
|
+
readonly type: Schema.Literal<"base64">;
|
|
741
|
+
readonly data: Schema.String;
|
|
742
|
+
readonly mediaType: Schema.String;
|
|
743
|
+
}>, Schema.Struct<{
|
|
744
|
+
readonly type: Schema.Literal<"url">;
|
|
745
|
+
readonly url: Schema.String;
|
|
746
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
747
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
748
|
+
}>, Schema.Struct<{
|
|
749
|
+
readonly type: Schema.Literal<"ref">;
|
|
750
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
751
|
+
readonly id: Schema.String;
|
|
752
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
753
|
+
}>]>;
|
|
754
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
755
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
756
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
757
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
758
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
759
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
760
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
761
|
+
readonly format: Schema.optional<Schema.String>;
|
|
762
|
+
}>>;
|
|
763
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
764
|
+
}>, never, never>;
|
|
765
|
+
}>;
|
|
766
|
+
}[K]["Type"]) => any; }>(value: {
|
|
768
767
|
readonly type: "video";
|
|
769
768
|
readonly index: number;
|
|
770
769
|
readonly video: Media.Asset;
|
|
@@ -804,72 +803,77 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
804
803
|
readonly [x: string]: unknown;
|
|
805
804
|
};
|
|
806
805
|
} | undefined;
|
|
807
|
-
}, cases:
|
|
808
|
-
<
|
|
809
|
-
readonly
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
readonly type: Schema.tag<"video">;
|
|
818
|
-
readonly index: Schema.Number;
|
|
819
|
-
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
820
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
821
|
-
readonly type: Schema.Literal<"bytes">;
|
|
822
|
-
readonly data: Schema.Uint8Array;
|
|
823
|
-
readonly mediaType: Schema.String;
|
|
806
|
+
}, cases: Handlers): import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "video"]>>;
|
|
807
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "video"]: (value: {
|
|
808
|
+
readonly finish: Schema.Struct<{
|
|
809
|
+
readonly type: Schema.tag<"finish">;
|
|
810
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
811
|
+
readonly type: Schema.Literal<"tokens">;
|
|
812
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
813
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
814
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
815
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
824
816
|
}>, Schema.Struct<{
|
|
825
|
-
readonly type: Schema.Literal<"
|
|
826
|
-
readonly
|
|
827
|
-
readonly mediaType: Schema.String;
|
|
817
|
+
readonly type: Schema.Literal<"seconds">;
|
|
818
|
+
readonly seconds: Schema.Number;
|
|
828
819
|
}>, Schema.Struct<{
|
|
829
|
-
readonly type: Schema.Literal<"
|
|
830
|
-
readonly
|
|
831
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
832
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
820
|
+
readonly type: Schema.Literal<"characters">;
|
|
821
|
+
readonly characters: Schema.Number;
|
|
833
822
|
}>, Schema.Struct<{
|
|
834
|
-
readonly type: Schema.Literal<"
|
|
835
|
-
readonly
|
|
836
|
-
|
|
837
|
-
readonly
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
841
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
842
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
843
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
844
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
845
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
846
|
-
readonly format: Schema.optional<Schema.String>;
|
|
847
|
-
}>>;
|
|
823
|
+
readonly type: Schema.Literal<"credits">;
|
|
824
|
+
readonly credits: Schema.Number;
|
|
825
|
+
}>, Schema.Struct<{
|
|
826
|
+
readonly type: Schema.Literal<"compute">;
|
|
827
|
+
readonly seconds: Schema.Number;
|
|
828
|
+
}>]>>;
|
|
848
829
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
readonly
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
readonly
|
|
857
|
-
readonly
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
readonly
|
|
863
|
-
readonly
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
830
|
+
}>;
|
|
831
|
+
readonly "generation-progress": Schema.Struct<{
|
|
832
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
833
|
+
readonly id: Schema.String;
|
|
834
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
835
|
+
}>;
|
|
836
|
+
readonly "generation-queued": Schema.Struct<{
|
|
837
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
838
|
+
readonly id: Schema.String;
|
|
839
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
840
|
+
}>;
|
|
841
|
+
readonly video: Schema.Struct<{
|
|
842
|
+
readonly type: Schema.tag<"video">;
|
|
843
|
+
readonly index: Schema.Number;
|
|
844
|
+
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
845
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
846
|
+
readonly type: Schema.Literal<"bytes">;
|
|
847
|
+
readonly data: Schema.Uint8Array;
|
|
848
|
+
readonly mediaType: Schema.String;
|
|
849
|
+
}>, Schema.Struct<{
|
|
850
|
+
readonly type: Schema.Literal<"base64">;
|
|
851
|
+
readonly data: Schema.String;
|
|
852
|
+
readonly mediaType: Schema.String;
|
|
853
|
+
}>, Schema.Struct<{
|
|
854
|
+
readonly type: Schema.Literal<"url">;
|
|
855
|
+
readonly url: Schema.String;
|
|
856
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
857
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
858
|
+
}>, Schema.Struct<{
|
|
859
|
+
readonly type: Schema.Literal<"ref">;
|
|
860
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
861
|
+
readonly id: Schema.String;
|
|
862
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
863
|
+
}>]>;
|
|
864
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
865
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
866
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
867
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
868
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
869
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
870
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
871
|
+
readonly format: Schema.optional<Schema.String>;
|
|
872
|
+
}>>;
|
|
873
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
874
|
+
}>, never, never>;
|
|
875
|
+
}>;
|
|
876
|
+
}[K]["Type"]) => any; }>(cases: Handlers): (value: {
|
|
873
877
|
readonly type: "video";
|
|
874
878
|
readonly index: number;
|
|
875
879
|
readonly video: Media.Asset;
|
|
@@ -909,74 +913,10 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
909
913
|
readonly [x: string]: unknown;
|
|
910
914
|
};
|
|
911
915
|
} | undefined;
|
|
912
|
-
}) =>
|
|
916
|
+
}) => import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "video"]>>;
|
|
913
917
|
};
|
|
914
918
|
readonly matchOrElse: {
|
|
915
|
-
<
|
|
916
|
-
readonly type: Schema.tag<"generation-queued">;
|
|
917
|
-
readonly id: Schema.String;
|
|
918
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
919
|
-
}> | Schema.Struct<{
|
|
920
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
921
|
-
readonly id: Schema.String;
|
|
922
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
923
|
-
}> | Schema.Struct<{
|
|
924
|
-
readonly type: Schema.tag<"video">;
|
|
925
|
-
readonly index: Schema.Number;
|
|
926
|
-
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
927
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
928
|
-
readonly type: Schema.Literal<"bytes">;
|
|
929
|
-
readonly data: Schema.Uint8Array;
|
|
930
|
-
readonly mediaType: Schema.String;
|
|
931
|
-
}>, Schema.Struct<{
|
|
932
|
-
readonly type: Schema.Literal<"base64">;
|
|
933
|
-
readonly data: Schema.String;
|
|
934
|
-
readonly mediaType: Schema.String;
|
|
935
|
-
}>, Schema.Struct<{
|
|
936
|
-
readonly type: Schema.Literal<"url">;
|
|
937
|
-
readonly url: Schema.String;
|
|
938
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
939
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
940
|
-
}>, Schema.Struct<{
|
|
941
|
-
readonly type: Schema.Literal<"ref">;
|
|
942
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
943
|
-
readonly id: Schema.String;
|
|
944
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
945
|
-
}>]>;
|
|
946
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
947
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
948
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
949
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
950
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
951
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
952
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
953
|
-
readonly format: Schema.optional<Schema.String>;
|
|
954
|
-
}>>;
|
|
955
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
956
|
-
}>, never, never>;
|
|
957
|
-
}> | Schema.Struct<{
|
|
958
|
-
readonly type: Schema.tag<"finish">;
|
|
959
|
-
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
960
|
-
readonly type: Schema.Literal<"tokens">;
|
|
961
|
-
readonly input: Schema.optional<Schema.Number>;
|
|
962
|
-
readonly output: Schema.optional<Schema.Number>;
|
|
963
|
-
readonly total: Schema.optional<Schema.Number>;
|
|
964
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
965
|
-
}>, Schema.Struct<{
|
|
966
|
-
readonly type: Schema.Literal<"seconds">;
|
|
967
|
-
readonly seconds: Schema.Number;
|
|
968
|
-
}>, Schema.Struct<{
|
|
969
|
-
readonly type: Schema.Literal<"characters">;
|
|
970
|
-
readonly characters: Schema.Number;
|
|
971
|
-
}>, Schema.Struct<{
|
|
972
|
-
readonly type: Schema.Literal<"credits">;
|
|
973
|
-
readonly credits: Schema.Number;
|
|
974
|
-
}>, Schema.Struct<{
|
|
975
|
-
readonly type: Schema.Literal<"compute">;
|
|
976
|
-
readonly seconds: Schema.Number;
|
|
977
|
-
}>]>>;
|
|
978
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
979
|
-
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "video">]: never; }, OrElse extends (value: Exclude<{
|
|
919
|
+
<Handlers, OrElse>(value: {
|
|
980
920
|
readonly type: "video";
|
|
981
921
|
readonly index: number;
|
|
982
922
|
readonly video: Media.Asset;
|
|
@@ -1016,19 +956,70 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1016
956
|
readonly [x: string]: unknown;
|
|
1017
957
|
};
|
|
1018
958
|
} | undefined;
|
|
1019
|
-
},
|
|
959
|
+
}, cases: Handlers & {
|
|
960
|
+
readonly finish?: ((value: {
|
|
961
|
+
readonly type: "finish";
|
|
962
|
+
readonly usage?: {
|
|
963
|
+
readonly type: "seconds";
|
|
964
|
+
readonly seconds: number;
|
|
965
|
+
} | {
|
|
966
|
+
readonly type: "characters";
|
|
967
|
+
readonly characters: number;
|
|
968
|
+
} | {
|
|
969
|
+
readonly type: "credits";
|
|
970
|
+
readonly credits: number;
|
|
971
|
+
} | {
|
|
972
|
+
readonly type: "compute";
|
|
973
|
+
readonly seconds: number;
|
|
974
|
+
} | {
|
|
975
|
+
readonly type: "tokens";
|
|
976
|
+
readonly input?: number | undefined;
|
|
977
|
+
readonly output?: number | undefined;
|
|
978
|
+
readonly total?: number | undefined;
|
|
979
|
+
readonly details?: {
|
|
980
|
+
readonly [x: string]: unknown;
|
|
981
|
+
} | undefined;
|
|
982
|
+
} | undefined;
|
|
983
|
+
readonly providerMetadata?: {
|
|
984
|
+
readonly [x: string]: {
|
|
985
|
+
readonly [x: string]: unknown;
|
|
986
|
+
};
|
|
987
|
+
} | undefined;
|
|
988
|
+
}) => any) | undefined;
|
|
989
|
+
readonly "generation-progress"?: ((value: {
|
|
990
|
+
readonly type: "generation-progress";
|
|
991
|
+
readonly id: string;
|
|
992
|
+
readonly progress?: number | undefined;
|
|
993
|
+
}) => any) | undefined;
|
|
994
|
+
readonly "generation-queued"?: ((value: {
|
|
995
|
+
readonly type: "generation-queued";
|
|
996
|
+
readonly id: string;
|
|
997
|
+
readonly position?: number | undefined;
|
|
998
|
+
}) => any) | undefined;
|
|
999
|
+
readonly video?: ((value: {
|
|
1000
|
+
readonly type: "video";
|
|
1001
|
+
readonly index: number;
|
|
1002
|
+
readonly video: Media.Asset;
|
|
1003
|
+
}) => any) | undefined;
|
|
1004
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "video"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
1020
1005
|
readonly type: "video";
|
|
1021
1006
|
readonly index: number;
|
|
1022
1007
|
readonly video: Media.Asset;
|
|
1023
|
-
}
|
|
1008
|
+
}, {
|
|
1009
|
+
readonly type: keyof Handlers;
|
|
1010
|
+
}> | Exclude<{
|
|
1024
1011
|
readonly type: "generation-queued";
|
|
1025
1012
|
readonly id: string;
|
|
1026
1013
|
readonly position?: number | undefined;
|
|
1027
|
-
}
|
|
1014
|
+
}, {
|
|
1015
|
+
readonly type: keyof Handlers;
|
|
1016
|
+
}> | Exclude<{
|
|
1028
1017
|
readonly type: "generation-progress";
|
|
1029
1018
|
readonly id: string;
|
|
1030
1019
|
readonly progress?: number | undefined;
|
|
1031
|
-
}
|
|
1020
|
+
}, {
|
|
1021
|
+
readonly type: keyof Handlers;
|
|
1022
|
+
}> | Exclude<{
|
|
1032
1023
|
readonly type: "finish";
|
|
1033
1024
|
readonly usage?: {
|
|
1034
1025
|
readonly type: "seconds";
|
|
@@ -1056,84 +1047,73 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1056
1047
|
readonly [x: string]: unknown;
|
|
1057
1048
|
};
|
|
1058
1049
|
} | undefined;
|
|
1059
|
-
},
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
readonly
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
readonly
|
|
1074
|
-
|
|
1075
|
-
readonly
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
readonly
|
|
1079
|
-
readonly
|
|
1080
|
-
|
|
1081
|
-
readonly
|
|
1082
|
-
readonly
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
readonly
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
readonly
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
readonly
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
readonly total: Schema.optional<Schema.Number>;
|
|
1109
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
1110
|
-
}>, Schema.Struct<{
|
|
1111
|
-
readonly type: Schema.Literal<"seconds">;
|
|
1112
|
-
readonly seconds: Schema.Number;
|
|
1113
|
-
}>, Schema.Struct<{
|
|
1114
|
-
readonly type: Schema.Literal<"characters">;
|
|
1115
|
-
readonly characters: Schema.Number;
|
|
1116
|
-
}>, Schema.Struct<{
|
|
1117
|
-
readonly type: Schema.Literal<"credits">;
|
|
1118
|
-
readonly credits: Schema.Number;
|
|
1119
|
-
}>, Schema.Struct<{
|
|
1120
|
-
readonly type: Schema.Literal<"compute">;
|
|
1121
|
-
readonly seconds: Schema.Number;
|
|
1122
|
-
}>]>>;
|
|
1123
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1124
|
-
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "video">]: never; }, OrElse extends (value: Exclude<{
|
|
1050
|
+
}, {
|
|
1051
|
+
readonly type: keyof Handlers;
|
|
1052
|
+
}>) => any)): import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
1053
|
+
<Handlers, OrElse>(cases: Handlers & {
|
|
1054
|
+
readonly finish?: ((value: {
|
|
1055
|
+
readonly type: "finish";
|
|
1056
|
+
readonly usage?: {
|
|
1057
|
+
readonly type: "seconds";
|
|
1058
|
+
readonly seconds: number;
|
|
1059
|
+
} | {
|
|
1060
|
+
readonly type: "characters";
|
|
1061
|
+
readonly characters: number;
|
|
1062
|
+
} | {
|
|
1063
|
+
readonly type: "credits";
|
|
1064
|
+
readonly credits: number;
|
|
1065
|
+
} | {
|
|
1066
|
+
readonly type: "compute";
|
|
1067
|
+
readonly seconds: number;
|
|
1068
|
+
} | {
|
|
1069
|
+
readonly type: "tokens";
|
|
1070
|
+
readonly input?: number | undefined;
|
|
1071
|
+
readonly output?: number | undefined;
|
|
1072
|
+
readonly total?: number | undefined;
|
|
1073
|
+
readonly details?: {
|
|
1074
|
+
readonly [x: string]: unknown;
|
|
1075
|
+
} | undefined;
|
|
1076
|
+
} | undefined;
|
|
1077
|
+
readonly providerMetadata?: {
|
|
1078
|
+
readonly [x: string]: {
|
|
1079
|
+
readonly [x: string]: unknown;
|
|
1080
|
+
};
|
|
1081
|
+
} | undefined;
|
|
1082
|
+
}) => any) | undefined;
|
|
1083
|
+
readonly "generation-progress"?: ((value: {
|
|
1084
|
+
readonly type: "generation-progress";
|
|
1085
|
+
readonly id: string;
|
|
1086
|
+
readonly progress?: number | undefined;
|
|
1087
|
+
}) => any) | undefined;
|
|
1088
|
+
readonly "generation-queued"?: ((value: {
|
|
1089
|
+
readonly type: "generation-queued";
|
|
1090
|
+
readonly id: string;
|
|
1091
|
+
readonly position?: number | undefined;
|
|
1092
|
+
}) => any) | undefined;
|
|
1093
|
+
readonly video?: ((value: {
|
|
1094
|
+
readonly type: "video";
|
|
1095
|
+
readonly index: number;
|
|
1096
|
+
readonly video: Media.Asset;
|
|
1097
|
+
}) => any) | undefined;
|
|
1098
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "video"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
1125
1099
|
readonly type: "video";
|
|
1126
1100
|
readonly index: number;
|
|
1127
1101
|
readonly video: Media.Asset;
|
|
1128
|
-
}
|
|
1102
|
+
}, {
|
|
1103
|
+
readonly type: keyof Handlers;
|
|
1104
|
+
}> | Exclude<{
|
|
1129
1105
|
readonly type: "generation-queued";
|
|
1130
1106
|
readonly id: string;
|
|
1131
1107
|
readonly position?: number | undefined;
|
|
1132
|
-
}
|
|
1108
|
+
}, {
|
|
1109
|
+
readonly type: keyof Handlers;
|
|
1110
|
+
}> | Exclude<{
|
|
1133
1111
|
readonly type: "generation-progress";
|
|
1134
1112
|
readonly id: string;
|
|
1135
1113
|
readonly progress?: number | undefined;
|
|
1136
|
-
}
|
|
1114
|
+
}, {
|
|
1115
|
+
readonly type: keyof Handlers;
|
|
1116
|
+
}> | Exclude<{
|
|
1137
1117
|
readonly type: "finish";
|
|
1138
1118
|
readonly usage?: {
|
|
1139
1119
|
readonly type: "seconds";
|
|
@@ -1161,7 +1141,9 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1161
1141
|
readonly [x: string]: unknown;
|
|
1162
1142
|
};
|
|
1163
1143
|
} | undefined;
|
|
1164
|
-
}, {
|
|
1144
|
+
}, {
|
|
1145
|
+
readonly type: keyof Handlers;
|
|
1146
|
+
}>) => any)): (value: {
|
|
1165
1147
|
readonly type: "video";
|
|
1166
1148
|
readonly index: number;
|
|
1167
1149
|
readonly video: Media.Asset;
|
|
@@ -1201,7 +1183,7 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1201
1183
|
readonly [x: string]: unknown;
|
|
1202
1184
|
};
|
|
1203
1185
|
} | undefined;
|
|
1204
|
-
}) => import("effect/Unify").Unify<{ [K in keyof
|
|
1186
|
+
}) => import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
1205
1187
|
};
|
|
1206
1188
|
} & {
|
|
1207
1189
|
is: {
|
|
@@ -1252,13 +1234,13 @@ export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1252
1234
|
};
|
|
1253
1235
|
};
|
|
1254
1236
|
export type VideoEvent = Schema.Schema.Type<typeof videoEventTagged>;
|
|
1255
|
-
|
|
1256
|
-
export declare
|
|
1257
|
-
export declare function start<const Model extends VideoModel>(input:
|
|
1258
|
-
export declare function generate<const Model extends VideoModel>(input:
|
|
1237
|
+
/** Normalize video request input into a plain `VideoRequest`. */
|
|
1238
|
+
export declare const request: <const Model extends VideoModel>(input: VideoRequestInput<Model>) => VideoRequest<Model>;
|
|
1239
|
+
export declare function start<const Model extends VideoModel>(input: VideoRequestInput<Model>): Effect.Effect<Generation<VideoResponse>, AIError, Service>;
|
|
1240
|
+
export declare function generate<const Model extends VideoModel>(input: VideoRequestInput<Model>, options?: AwaitOptions): Effect.Effect<VideoResponse, AIError, Service>;
|
|
1259
1241
|
/** Rebuild a generation handle from a persisted `Generation.token`, refreshing its status once. */
|
|
1260
1242
|
export declare const resume: (model: VideoModel, token: unknown) => Effect.Effect<Generation<VideoResponse>, AIError, Service>;
|
|
1261
|
-
export declare function stream<const Model extends VideoModel>(input:
|
|
1243
|
+
export declare function stream<const Model extends VideoModel>(input: VideoRequestInput<Model>, options?: AwaitOptions): Stream.Stream<VideoEvent, AIError, Service>;
|
|
1262
1244
|
export declare const Video: {
|
|
1263
1245
|
readonly request: typeof request;
|
|
1264
1246
|
readonly start: typeof start;
|