@opencode/ai 0.0.0-dev-20120 → 0.0.0-dev-20123
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/dist/experimental/evaluation.js +1 -1
- package/dist/generation.d.ts +1 -7
- package/dist/generation.js +1 -11
- package/dist/image.d.ts +2 -2
- package/dist/image.js +2 -2
- package/dist/llm.js +1 -1
- package/dist/media-model.d.ts +0 -2
- package/dist/media-model.js +0 -2
- package/dist/protocols/alibaba-messages.d.ts +1 -1
- package/dist/protocols/anthropic-messages.d.ts +34 -34
- package/dist/protocols/assemblyai-transcription.d.ts +2 -1
- package/dist/protocols/assemblyai-transcription.js +10 -14
- package/dist/protocols/bfl-images.js +15 -31
- package/dist/protocols/cartesia-speech.d.ts +2 -2
- package/dist/protocols/cartesia-speech.js +10 -16
- package/dist/protocols/deepgram-speech.d.ts +3 -3
- package/dist/protocols/deepgram-speech.js +7 -11
- package/dist/protocols/deepgram-transcription.d.ts +2 -1
- package/dist/protocols/deepgram-transcription.js +9 -13
- package/dist/protocols/elevenlabs-speech.d.ts +3 -3
- package/dist/protocols/elevenlabs-speech.js +9 -13
- package/dist/protocols/fal-images.d.ts +2 -1
- package/dist/protocols/fal-images.js +16 -29
- package/dist/protocols/fal-video.d.ts +2 -2
- package/dist/protocols/fal-video.js +9 -24
- package/dist/protocols/gemini.d.ts +13 -13
- package/dist/protocols/google-images.d.ts +3 -3
- package/dist/protocols/google-images.js +11 -21
- package/dist/protocols/google-speech.js +7 -13
- package/dist/protocols/google-transcription.d.ts +2 -1
- package/dist/protocols/google-transcription.js +8 -20
- package/dist/protocols/google-video.d.ts +2 -2
- package/dist/protocols/google-video.js +14 -30
- package/dist/protocols/meta-images.d.ts +3 -4
- package/dist/protocols/meta-images.js +12 -21
- package/dist/protocols/meta-messages.d.ts +5 -5
- package/dist/protocols/meta-responses.js +5 -2
- package/dist/protocols/mistral-chat.js +6 -3
- package/dist/protocols/openai-images.d.ts +4 -5
- package/dist/protocols/openai-images.js +24 -55
- package/dist/protocols/openai-responses.js +8 -2
- package/dist/protocols/openai-speech.js +7 -11
- package/dist/protocols/openai-transcription.js +21 -29
- package/dist/protocols/replicate-images.js +11 -17
- package/dist/protocols/runway-video.d.ts +3 -3
- package/dist/protocols/runway-video.js +10 -16
- package/dist/protocols/shared.d.ts +5 -17
- package/dist/protocols/shared.js +3 -39
- package/dist/protocols/stability-images.d.ts +2 -1
- package/dist/protocols/stability-images.js +24 -36
- package/dist/protocols/utils/fal-queue.d.ts +1 -3
- package/dist/protocols/utils/fal-queue.js +4 -6
- package/dist/protocols/utils/media-input.d.ts +15 -1
- package/dist/protocols/utils/media-input.js +22 -0
- package/dist/protocols/utils/speech-stream.d.ts +3 -3
- package/dist/protocols/utils/speech-stream.js +1 -4
- package/dist/protocols/utils/tool-schema.js +19 -6
- package/dist/protocols/xai-images.d.ts +4 -4
- package/dist/protocols/xai-images.js +12 -28
- package/dist/protocols/xai-video.js +12 -18
- package/dist/protocols/zai-images.d.ts +2 -2
- package/dist/protocols/zai-images.js +8 -11
- package/dist/protocols/zai-messages.d.ts +1 -1
- package/dist/providers/alibaba.d.ts +1 -1
- package/dist/providers/anthropic-compatible.d.ts +5 -5
- package/dist/providers/anthropic.d.ts +5 -5
- package/dist/providers/assemblyai.d.ts +1 -1
- package/dist/providers/assemblyai.js +5 -10
- package/dist/providers/azure.js +2 -2
- package/dist/providers/black-forest-labs.d.ts +1 -1
- package/dist/providers/black-forest-labs.js +5 -10
- package/dist/providers/cartesia.d.ts +1 -1
- package/dist/providers/cartesia.js +5 -10
- package/dist/providers/cloudflare-ai-gateway.d.ts +10 -10
- package/dist/providers/deepgram.d.ts +1 -1
- package/dist/providers/deepgram.js +6 -12
- package/dist/providers/elevenlabs.d.ts +1 -1
- package/dist/providers/elevenlabs.js +5 -10
- package/dist/providers/fal.d.ts +1 -1
- package/dist/providers/fal.js +5 -12
- package/dist/providers/google-vertex-messages.d.ts +5 -5
- package/dist/providers/google-vertex.d.ts +3 -3
- package/dist/providers/google.d.ts +3 -3
- package/dist/providers/google.js +7 -12
- package/dist/providers/meta.d.ts +8 -8
- package/dist/providers/meta.js +4 -8
- package/dist/providers/minimax.d.ts +5 -5
- package/dist/providers/moonshot.d.ts +5 -5
- package/dist/providers/openai.d.ts +7 -8
- package/dist/providers/openai.js +10 -11
- package/dist/providers/opencode-zen.js +1 -1
- package/dist/providers/openrouter.d.ts +6 -7
- package/dist/providers/openrouter.js +1 -1
- package/dist/providers/replicate.d.ts +1 -1
- package/dist/providers/replicate.js +5 -10
- package/dist/providers/runway.d.ts +1 -1
- package/dist/providers/runway.js +5 -10
- package/dist/providers/stability.d.ts +1 -1
- package/dist/providers/stability.js +6 -11
- package/dist/providers/typesafe-ai.js +1 -1
- package/dist/providers/vercel-ai-gateway.js +1 -1
- package/dist/providers/xai.js +5 -10
- package/dist/providers/zai-coding-plan.d.ts +1 -1
- package/dist/providers/zai.js +4 -8
- package/dist/route/client.d.ts +0 -1
- package/dist/route/client.js +1 -6
- package/dist/route/endpoint.d.ts +1 -0
- package/dist/route/endpoint.js +2 -2
- package/dist/route/framing.d.ts +10 -1
- package/dist/route/framing.js +45 -5
- package/dist/route/media-protocol.d.ts +42 -35
- package/dist/route/media-protocol.js +67 -62
- package/dist/route/media.d.ts +6 -2
- package/dist/route/media.js +40 -29
- package/dist/schema/options.d.ts +6 -3
- package/dist/schema/options.js +7 -3
- package/dist/speech.d.ts +2 -2
- package/dist/speech.js +2 -2
- package/dist/transcription.js +2 -2
- package/dist/utils/json.d.ts +4 -0
- package/dist/utils/json.js +4 -0
- package/dist/video.d.ts +2 -2
- package/dist/video.js +2 -2
- package/package.json +3 -3
- 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
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const Json: Schema.fromJsonString<Schema.Unknown>;
|
|
3
|
+
export declare const decodeJson: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => unknown;
|
|
4
|
+
export declare const encodeJson: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string;
|
package/dist/video.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Media } from "./media.js";
|
|
|
4
4
|
import { MediaModel } from "./media-model.js";
|
|
5
5
|
import { MediaRoute } from "./route/media.js";
|
|
6
6
|
import type { MediaProtocol } from "./route/media-protocol.js";
|
|
7
|
-
import { AIError, HttpOptions } from "./schema/index.js";
|
|
7
|
+
import { AIError, HttpOptions, type OpenString } from "./schema/index.js";
|
|
8
8
|
import { Service } from "./video-client.js";
|
|
9
9
|
export type VideoOptions = Record<string, unknown>;
|
|
10
10
|
export type VideoRoute<Options extends VideoOptions = VideoOptions> = MediaRoute.QueuedRoute<VideoRequestFor<Options>, VideoResponse>;
|
|
@@ -20,7 +20,7 @@ export declare namespace VideoModel {
|
|
|
20
20
|
export declare const VideoModelSchema: Schema.declare<VideoModel<VideoOptions>, VideoModel<VideoOptions>>;
|
|
21
21
|
export type VideoAspectRatio = Media.AspectRatio;
|
|
22
22
|
export declare const VideoAspectRatio: Schema.declare<`${number}:${number}`, `${number}:${number}`>;
|
|
23
|
-
export type VideoResolution = "480p" | "720p" | "1080p" | "4k"
|
|
23
|
+
export type VideoResolution = OpenString<"480p" | "720p" | "1080p" | "4k">;
|
|
24
24
|
/** Pinned frames. Routes that accept only a first frame fail typed when `last` is present. */
|
|
25
25
|
export declare const VideoFrames: Schema.Struct<{
|
|
26
26
|
readonly first: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
package/dist/video.js
CHANGED
|
@@ -13,7 +13,7 @@ export class VideoModel extends MediaModel {
|
|
|
13
13
|
static fromRoute(route, input) {
|
|
14
14
|
return new VideoModel({
|
|
15
15
|
id: input.id,
|
|
16
|
-
provider: route.provider,
|
|
16
|
+
provider: route.protocol.provider,
|
|
17
17
|
http: input.http,
|
|
18
18
|
route: composeRoute(MediaRoute.queued, route, input),
|
|
19
19
|
});
|
|
@@ -95,7 +95,7 @@ export function request(input) {
|
|
|
95
95
|
return input;
|
|
96
96
|
return new VideoRequest({
|
|
97
97
|
...input,
|
|
98
|
-
http:
|
|
98
|
+
http: HttpOptions.make(input.http),
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
const requestEffect = (input) => tryRequest(() => request(input));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20123",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
36
36
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
37
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
37
|
+
"@opencode/http-recorder": "0.0.0-dev-20123",
|
|
38
38
|
"@tsconfig/bun": "1.0.9",
|
|
39
39
|
"@types/bun": "1.4.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
45
45
|
"@smithy/eventstream-codec": "4.2.14",
|
|
46
46
|
"@smithy/util-utf8": "4.2.2",
|
|
47
|
-
"@opencode/schema": "0.0.0-dev-
|
|
47
|
+
"@opencode/schema": "0.0.0-dev-20123",
|
|
48
48
|
"aws4fetch": "1.0.20",
|
|
49
49
|
"effect": "4.0.0-rc.112",
|
|
50
50
|
"google-auth-library": "10.5.0"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Responses image items can omit output_format, including when PNG/JPEG was requested.
|
|
2
|
-
export const mediaType = (data, format) => {
|
|
3
|
-
if (format !== undefined)
|
|
4
|
-
return `image/${format}`;
|
|
5
|
-
if (data[0] === 137 && data[1] === 80 && data[2] === 78 && data[3] === 71)
|
|
6
|
-
return "image/png";
|
|
7
|
-
if (data[0] === 255 && data[1] === 216 && data[2] === 255)
|
|
8
|
-
return "image/jpeg";
|
|
9
|
-
if (new TextDecoder().decode(data.slice(0, 4)) === "RIFF" && new TextDecoder().decode(data.slice(8, 12)) === "WEBP")
|
|
10
|
-
return "image/webp";
|
|
11
|
-
return "application/octet-stream";
|
|
12
|
-
};
|
|
13
|
-
export * as MetaImage from "./meta-image.js";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
const dimensions = (value) => {
|
|
3
|
-
const match = /^(\d+)x(\d+)$/.exec(value);
|
|
4
|
-
if (!match)
|
|
5
|
-
return undefined;
|
|
6
|
-
return { width: Number(match[1]), height: Number(match[2]) };
|
|
7
|
-
};
|
|
8
|
-
export const Size = Schema.String.check(Schema.makeFilter((value) => {
|
|
9
|
-
if (value === "auto")
|
|
10
|
-
return undefined;
|
|
11
|
-
const parsed = dimensions(value);
|
|
12
|
-
if (!parsed)
|
|
13
|
-
return "image size must be `auto` or `{width}x{height}`";
|
|
14
|
-
return parsed.width > 0 && parsed.height > 0 ? undefined : "image dimensions must be positive integers";
|
|
15
|
-
}));
|
|
16
|
-
export const OpenAIImage = {
|
|
17
|
-
Size,
|
|
18
|
-
};
|