@opencode/ai 0.0.0-dev-1315 → 0.0.0-dev-1317

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.
@@ -121,12 +121,18 @@ const fromRequest = Effect.fn("MiniMaxVideo.fromRequest")(function* (request) {
121
121
  ...(request.end === undefined ? [] : [yield* item(request.end, "last_frame")]),
122
122
  ...(yield* Effect.forEach(request.references ?? [], reference)),
123
123
  ];
124
+ // H3 rejects a t2va (text-only) request without a concrete `ratio`, so `auto` and unset default to `16:9`.
125
+ const ratio = content.length === 1 && (request.aspect === undefined || request.aspect === "auto")
126
+ ? "16:9"
127
+ : request.aspect === "auto"
128
+ ? "adaptive"
129
+ : request.aspect;
124
130
  return MediaProtocol.json(mergeJsonRecords({
125
131
  model: request.model.id,
126
132
  content,
127
133
  resolution: resolution(request),
128
134
  duration: request.duration === undefined ? undefined : seconds(request.duration),
129
- ratio: request.aspect === "auto" ? "adaptive" : request.aspect,
135
+ ratio,
130
136
  }, request.providerOptions, request.http?.body) ?? {});
131
137
  });
132
138
  /** v1 documents URLs and data URLs only, so MiniMax file references aren't sent. */
@@ -107,6 +107,8 @@ const CONTENT_POLICY_CODES = new Set([
107
107
  "responsibleaipolicyviolation",
108
108
  "content_policy_violation",
109
109
  "image_content_policy_violation",
110
+ // OpenAI's cybersecurity safeguard, as an HTTP 400 or a mid-stream error frame.
111
+ "cyber_policy",
110
112
  "refusal",
111
113
  "datainspectionfailed",
112
114
  "moderation_blocked",
@@ -131,7 +133,7 @@ const QUOTA_TEXT = /insufficient[-_\s]?(?:quota|balance)|(?<!token_)quota[-_\s]?
131
133
  // explanation only. OpenAI reuses `invalid_prompt` for usage-policy rejections while
132
134
  // Bedrock Mantle reuses it for schema validation; Anthropic reports blocked output
133
135
  // under `invalid_request_error`. The Vercel AI Gateway drops OpenAI's `moderation_blocked` code.
134
- const CONTENT_POLICY_TEXT = /violating our usage policy|blocked by content filtering policy|content[-_\s]?policy|rejected (?:as a result of our|by the) safety system|detected potentially unsafe or sensitive content/i;
136
+ const CONTENT_POLICY_TEXT = /violating our usage policy|blocked by content filtering policy|content[-_\s]?policy|rejected (?:as a result of our|by the) safety system|detected potentially unsafe or sensitive content|rejected in accordance with our terms of use/i;
135
137
  const SERVER_ERROR_TEXT = /\b(?:try again|(?:please |you can )?retry (?:the |this |your )?request|try (?:the |this |your )?request again|(?:currently |temporarily )?at capacity|overloaded|temporarily unavailable|service[-_\s]?unavailable|(?:server|internal)[-_\s]?error|server (?:is )?busy|provider returned (?:an )?error|resource[-_\s]?exhausted|upstream (?:connect|connection|request)|request buffer limit while retrying upstream)\b/i;
136
138
  const Message = Schema.String.check(Schema.isPattern(/\S/));
137
139
  const messageAt = (fields, message) => Schema.Struct(fields).pipe(Schema.decodeTo(Schema.String, {
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-1315",
3
+ "version": "0.0.0-dev-1317",
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-1315",
627
+ "@opencode/http-recorder": "0.0.0-dev-1317",
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-1315",
637
+ "@opencode/schema": "0.0.0-dev-1317",
638
638
  "aws4fetch": "1.0.20",
639
639
  "effect": "4.1.0",
640
640
  "google-auth-library": "10.5.0"