@opencode/ai 0.0.0-dev-1288 → 0.0.0-dev-1290
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
CHANGED
|
@@ -1087,7 +1087,9 @@ const program = Effect.gen(function* () {
|
|
|
1087
1087
|
|
|
1088
1088
|
The shared fields are `prompt`, `start`, `end`, `references`, `duration`, `aspect`, `resolution` and `sound`;
|
|
1089
1089
|
everything else is provider-specific and goes under `providerOptions`, typed from the selected model. A request only
|
|
1090
|
-
fails before sending when its protocol has no way to express it, such as a reference video on xAI.
|
|
1090
|
+
fails before sending when its protocol has no way to express it, such as a reference video on xAI. `sound` is the
|
|
1091
|
+
exception: on models whose sound can't be switched (MiniMax H3 and Gemini Omni always have it, Hailuo never does) it
|
|
1092
|
+
isn't sent, and the model's own behavior applies. Values the provider
|
|
1091
1093
|
may reject, like an unsupported duration or too many references, go to the provider, and its error comes back typed.
|
|
1092
1094
|
|
|
1093
1095
|
`start` and `end` are images. They take a URL, data URL, base64 string or bytes, or an asset built with
|
|
@@ -1131,11 +1133,11 @@ Provider notes:
|
|
|
1131
1133
|
`/v1`, and a bare host (`https://api.minimax.io`) works as is. On H3, `start`, `end` and `references` become `content[]` items with `first_frame`, `last_frame` and `reference_image` /
|
|
1132
1134
|
`reference_video` / `reference_audio` roles, MiniMax file refs become `mm_file://` URLs, `aspect: "auto"` becomes
|
|
1133
1135
|
`ratio: "adaptive"`, and `resolution` is uppercased (`480P`, `2K`). H3 requires `resolution` and `duration`, plus a
|
|
1134
|
-
`ratio` for text-only prompts; nothing is filled in, so MiniMax rejects a request without them. H3 always has sound
|
|
1135
|
-
so `sound
|
|
1136
|
+
`ratio` for text-only prompts; nothing is filled in, so MiniMax rejects a request without them. H3 always has sound
|
|
1137
|
+
and has no field for it, so `sound` isn't sent. On Hailuo, `start` and `end` map to `first_frame_image` and
|
|
1136
1138
|
`last_frame_image`, image references to `subject_reference`, and the result looks up the file's download URL, which
|
|
1137
|
-
expires after one hour. Hailuo is silent
|
|
1138
|
-
or audio references fail before sending. Cancel works on H3 (only while queued); Hailuo has no cancel. Native fields
|
|
1139
|
+
expires after one hour. Hailuo is always silent, so `sound` isn't sent; it has no aspect field, so an explicit
|
|
1140
|
+
`aspect` and video or audio references fail before sending. Cancel works on H3 (only while queued); Hailuo has no cancel. Native fields
|
|
1139
1141
|
such as `extra.prompt_expansion_mode` (H3), `prompt_optimizer` (Hailuo) and `callback_url` go under `providerOptions`.
|
|
1140
1142
|
- **Google** (`Google.video("gemini-omni-1.2-flash")`) starts a background Gemini Omni interaction. Omni has no
|
|
1141
1143
|
role field for media, so `start`, `end` and `references` go into `input` in that order (images, plus video
|
|
@@ -1143,7 +1145,7 @@ Provider notes:
|
|
|
1143
1145
|
`reference_to_video` for references only; with both, the prompt decides. `duration` becomes
|
|
1144
1146
|
`response_format.duration` (`"3s"`), and `aspect` and `resolution` go to `response_format` as is (resolution
|
|
1145
1147
|
lowercased); `aspect: "auto"` leaves the ratio out. It rejects `end` without `start` (a lone image reads as the
|
|
1146
|
-
first frame) and `sound
|
|
1148
|
+
first frame). Omni always generates audio and has no field for it, so `sound` isn't sent. Videos come back as inline bytes. `cancel` posts to
|
|
1147
1149
|
`/interactions/{id}/cancel`. `providerOptions` takes native Interactions fields, such as `previous_interaction_id`
|
|
1148
1150
|
to edit or extend a generated video, `generation_config.video_config.task`, `service_tier` and `webhook_config`.
|
|
1149
1151
|
|
|
@@ -81,8 +81,6 @@ const task = (request) => {
|
|
|
81
81
|
const fromRequest = Effect.fn("GoogleInteractionsVideo.fromRequest")(function* (request) {
|
|
82
82
|
if (request.end !== undefined && request.start === undefined)
|
|
83
83
|
return yield* route.unsupported("video.end", `${route.name} reads a lone image as the start frame; send start too`);
|
|
84
|
-
if (request.sound === false)
|
|
85
|
-
return yield* route.unsupported("video.sound", `${route.name} always generates audio and has no option to turn it off`);
|
|
86
84
|
const media = yield* Effect.forEach([request.start, request.end, ...(request.references ?? [])].filter((asset) => asset !== undefined), GoogleInteractions.mediaContent);
|
|
87
85
|
const responseFormat = {
|
|
88
86
|
// `auto` follows the input image, which Omni expresses by leaving the ratio out.
|
|
@@ -114,9 +114,7 @@ const reference = (asset) => item(asset, asset.kind === "video" || asset.kind ==
|
|
|
114
114
|
/** MiniMax spells resolutions in uppercase (`480P`, `768P`, `2K`). */
|
|
115
115
|
const resolution = (request) => request.resolution?.toUpperCase();
|
|
116
116
|
const fromRequest = Effect.fn("MiniMaxVideo.fromRequest")(function* (request) {
|
|
117
|
-
// H3 always generates a soundtrack and has no field
|
|
118
|
-
if (request.sound === false)
|
|
119
|
-
return yield* route.unsupported("video.sound", `${route.name} always generates sound and can't be silenced`);
|
|
117
|
+
// H3 always generates a soundtrack and has no field for `sound`, so it isn't sent.
|
|
120
118
|
const content = [
|
|
121
119
|
{ type: "text", text: request.prompt },
|
|
122
120
|
...(request.start === undefined ? [] : [yield* item(request.start, "first_frame")]),
|
|
@@ -138,8 +136,7 @@ const hailuoFromRequest = Effect.fn("MiniMaxHailuoVideo.fromRequest")(function*
|
|
|
138
136
|
if (references.some((asset) => asset.kind === "video" || asset.kind === "audio"))
|
|
139
137
|
return yield* hailuoRoute.unsupported("video.references", `${hailuoRoute.name} takes only image (subject) references`);
|
|
140
138
|
// Hailuo output is always silent and its shape follows the model or the first frame, with no field for either.
|
|
141
|
-
|
|
142
|
-
return yield* hailuoRoute.unsupported("video.sound", `${hailuoRoute.name} generates silent video only`);
|
|
139
|
+
// `sound` has nothing to send, so it isn't; an aspect ratio would change the shape the caller asked for.
|
|
143
140
|
if (request.aspect !== undefined && request.aspect !== "auto")
|
|
144
141
|
return yield* hailuoRoute.unsupported("video.aspect", `${hailuoRoute.name} has no aspect ratio input`);
|
|
145
142
|
const subjects = yield* Effect.forEach(references, (asset) => hailuoUrl(asset).pipe(Effect.map((url) => ({ type: "character", image: [url] }))));
|
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-1290",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
"devDependencies": {
|
|
625
625
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
626
626
|
"@effect/platform-node": "4.1.0",
|
|
627
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
627
|
+
"@opencode/http-recorder": "0.0.0-dev-1290",
|
|
628
628
|
"@tsconfig/bun": "1.0.9",
|
|
629
629
|
"@types/bun": "1.4.3",
|
|
630
630
|
"@typescript/native": "npm:typescript@7.1.0-beta",
|
|
@@ -634,7 +634,7 @@
|
|
|
634
634
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
635
635
|
"@smithy/eventstream-codec": "4.2.14",
|
|
636
636
|
"@smithy/util-utf8": "4.2.2",
|
|
637
|
-
"@opencode/schema": "0.0.0-dev-
|
|
637
|
+
"@opencode/schema": "0.0.0-dev-1290",
|
|
638
638
|
"aws4fetch": "1.0.20",
|
|
639
639
|
"effect": "4.1.0",
|
|
640
640
|
"google-auth-library": "10.5.0"
|