@opencode/ai 0.0.0-dev-20679 → 0.0.0-dev-20681
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/protocols/anthropic-messages.d.ts +5 -5
- package/dist/protocols/anthropic-messages.js +10 -7
- package/dist/protocols/bedrock-converse.js +3 -1
- package/dist/protocols/meta-messages.d.ts +1 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +1 -1
- package/dist/providers/amazon-bedrock-mantle.js +4 -3
- package/dist/providers/anthropic-compatible.d.ts +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/cloudflare-ai-gateway.d.ts +2 -2
- package/dist/providers/google-vertex-messages.d.ts +1 -1
- package/dist/providers/meta.d.ts +1 -1
- package/dist/providers/minimax.d.ts +1 -1
- package/dist/providers/moonshot.d.ts +1 -1
- package/package.json +3 -3
|
@@ -58,7 +58,7 @@ declare const Thinking: Schema.Union<readonly [Schema.decodeTo<Schema.Struct<{
|
|
|
58
58
|
}>>;
|
|
59
59
|
readonly type: Schema.tag<"adaptive">;
|
|
60
60
|
}>, Schema.Struct<{
|
|
61
|
-
readonly type: Schema.
|
|
61
|
+
readonly type: Schema.Literals<readonly ["disabled", "between_tools"]>;
|
|
62
62
|
}>]>;
|
|
63
63
|
declare const Options: Schema.Struct<{
|
|
64
64
|
/** Advanced in-band compaction. The caller owns checkpoint persistence and recovery. */
|
|
@@ -101,7 +101,7 @@ declare const Options: Schema.Struct<{
|
|
|
101
101
|
}>>;
|
|
102
102
|
readonly type: Schema.tag<"adaptive">;
|
|
103
103
|
}>, Schema.Struct<{
|
|
104
|
-
readonly type: Schema.
|
|
104
|
+
readonly type: Schema.Literals<readonly ["disabled", "between_tools"]>;
|
|
105
105
|
}>]>>;
|
|
106
106
|
readonly effort: Schema.optional<Schema.String>;
|
|
107
107
|
readonly service_tier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "standard_only">, import("../schema/options.js").OpenString<"auto" | "standard_only">>>;
|
|
@@ -382,7 +382,7 @@ export declare const AnthropicMessagesBody: Schema.Struct<{
|
|
|
382
382
|
}>>;
|
|
383
383
|
readonly type: Schema.tag<"adaptive">;
|
|
384
384
|
}>, Schema.Struct<{
|
|
385
|
-
readonly type: Schema.
|
|
385
|
+
readonly type: Schema.Literals<readonly ["disabled", "between_tools"]>;
|
|
386
386
|
}>]>>;
|
|
387
387
|
output_config: Schema.optional<Schema.Struct<{
|
|
388
388
|
readonly effort: Schema.optional<Schema.String>;
|
|
@@ -638,7 +638,7 @@ export declare const protocol: Protocol<{
|
|
|
638
638
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
639
639
|
} | undefined;
|
|
640
640
|
} | {
|
|
641
|
-
readonly type: "disabled";
|
|
641
|
+
readonly type: "disabled" | "between_tools";
|
|
642
642
|
} | undefined;
|
|
643
643
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
644
644
|
readonly container?: string | {
|
|
@@ -998,7 +998,7 @@ export declare const route: Route<{
|
|
|
998
998
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
999
999
|
} | undefined;
|
|
1000
1000
|
} | {
|
|
1001
|
-
readonly type: "disabled";
|
|
1001
|
+
readonly type: "disabled" | "between_tools";
|
|
1002
1002
|
} | undefined;
|
|
1003
1003
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
1004
1004
|
readonly container?: string | {
|
|
@@ -223,7 +223,7 @@ const AnthropicThinkingEnabled = Schema.Struct({
|
|
|
223
223
|
...AnthropicThinkingFields,
|
|
224
224
|
});
|
|
225
225
|
const AnthropicThinkingAdaptive = Schema.Struct({ type: Schema.tag("adaptive"), ...AnthropicThinkingFields });
|
|
226
|
-
const AnthropicThinkingDisabled = Schema.Struct({ type: Schema.
|
|
226
|
+
const AnthropicThinkingDisabled = Schema.Struct({ type: Schema.Literals(["disabled", "between_tools"]) });
|
|
227
227
|
const AnthropicThinking = Schema.Union([AnthropicThinkingEnabled, AnthropicThinkingAdaptive, AnthropicThinkingDisabled]);
|
|
228
228
|
// SDK OutputConfig:2684 {effort?: "low"|"medium"|"high"|"xhigh"|"max"|null, format?: JSONOutputFormat:2399}
|
|
229
229
|
const AnthropicJsonOutputFormat = Schema.Struct({
|
|
@@ -855,12 +855,15 @@ const lowerMessages = Effect.fnUntraced(function* (request, breakpoints) {
|
|
|
855
855
|
// TODO: Move per-model capability heuristics (`supportsEffortUpdates`, `supportsNativeSystemUpdates`,
|
|
856
856
|
// `supportsThinkingBlockBinding`) into explicit model/provider `compatibility` metadata so the protocol
|
|
857
857
|
// only reads `request.model.compatibility`.
|
|
858
|
+
const isThinkingOff = Schema.is(AnthropicThinkingDisabled);
|
|
858
859
|
// Per-turn effort started with Claude Opus 5 and every Claude 5.1 model; later versions of any family inherit it.
|
|
859
|
-
const supportsEffortUpdates = (
|
|
860
|
-
|
|
860
|
+
const supportsEffortUpdates = (request) => {
|
|
861
|
+
if (isThinkingOff(request.providerOptions?.thinking))
|
|
862
|
+
return false;
|
|
863
|
+
const override = request.model.compatibility?.supportsEffortUpdates;
|
|
861
864
|
if (override !== undefined)
|
|
862
865
|
return override;
|
|
863
|
-
const version = claudeVersion(model.id);
|
|
866
|
+
const version = claudeVersion(request.model.id);
|
|
864
867
|
if (version === undefined)
|
|
865
868
|
return false;
|
|
866
869
|
if (version.family === "opus" && version.major >= 5)
|
|
@@ -868,7 +871,7 @@ const supportsEffortUpdates = (model) => {
|
|
|
868
871
|
return version.major > 5 || (version.major === 5 && version.minor >= 1);
|
|
869
872
|
};
|
|
870
873
|
const applyThinkingBindingDefault = (model, thinking) => {
|
|
871
|
-
if (thinking
|
|
874
|
+
if (isThinkingOff(thinking))
|
|
872
875
|
return thinking;
|
|
873
876
|
if (!supportsThinkingBlockBinding(model))
|
|
874
877
|
return thinking;
|
|
@@ -1390,7 +1393,7 @@ export const protocol = Protocol.make({
|
|
|
1390
1393
|
}),
|
|
1391
1394
|
step,
|
|
1392
1395
|
},
|
|
1393
|
-
supportsEffortUpdates
|
|
1396
|
+
supportsEffortUpdates,
|
|
1394
1397
|
});
|
|
1395
1398
|
export const transport = () => {
|
|
1396
1399
|
const http = HttpTransport.httpJson({ framing });
|
|
@@ -1430,7 +1433,7 @@ function requiredBetaHeaders(body) {
|
|
|
1430
1433
|
if (body.messages.some((message) => message.role === "system" && message.output_config !== undefined))
|
|
1431
1434
|
betas.push("mid-conversation-output-config-2026-07-01");
|
|
1432
1435
|
const thinking = body.thinking;
|
|
1433
|
-
if (thinking && thinking
|
|
1436
|
+
if (thinking && !isThinkingOff(thinking) && thinking.block_binding)
|
|
1434
1437
|
betas.push(THINKING_BINDING_BETA);
|
|
1435
1438
|
return betas;
|
|
1436
1439
|
}
|
|
@@ -382,7 +382,9 @@ const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(Opt
|
|
|
382
382
|
// Claude on Bedrock requires the thinking budget below `maxTokens`, with a minimum of 1,024.
|
|
383
383
|
const MIN_THINKING_BUDGET = 1_024;
|
|
384
384
|
const isThinkingDisabled = Schema.is(Schema.Struct({
|
|
385
|
-
additionalModelRequestFields: Schema.Struct({
|
|
385
|
+
additionalModelRequestFields: Schema.Struct({
|
|
386
|
+
thinking: Schema.Struct({ type: Schema.Literals(["disabled", "between_tools"]) }),
|
|
387
|
+
}),
|
|
386
388
|
}));
|
|
387
389
|
// Claude 5.1+ binds each thinking signature to the prefix above it. Ask Bedrock to drop the affected blocks instead of
|
|
388
390
|
// failing when that prefix changes. `http.body` overlays this field by field, so callers can still override it.
|
|
@@ -236,7 +236,7 @@ export declare const protocol: Protocol<{
|
|
|
236
236
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
237
237
|
} | undefined;
|
|
238
238
|
} | {
|
|
239
|
-
readonly type: "disabled";
|
|
239
|
+
readonly type: "disabled" | "between_tools";
|
|
240
240
|
} | undefined;
|
|
241
241
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
242
242
|
readonly container?: string | {
|
|
@@ -257,7 +257,7 @@ export declare const routes: (Route<{
|
|
|
257
257
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
258
258
|
} | undefined;
|
|
259
259
|
} | {
|
|
260
|
-
readonly type: "disabled";
|
|
260
|
+
readonly type: "disabled" | "between_tools";
|
|
261
261
|
} | undefined;
|
|
262
262
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
263
263
|
readonly container?: string | {
|
|
@@ -30,9 +30,10 @@ const messagesRoute = Route.make({
|
|
|
30
30
|
...AnthropicMessages.protocol,
|
|
31
31
|
// Mantle rejects mid-conversation `output_config` on Opus 5.0; support starts at 5.1+.
|
|
32
32
|
supportsEffortUpdates: (request) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (!(AnthropicMessages.protocol.supportsEffortUpdates?.(request) ?? false))
|
|
34
|
+
return false;
|
|
35
|
+
if (request.model.compatibility?.supportsEffortUpdates !== undefined)
|
|
36
|
+
return true;
|
|
36
37
|
const version = claudeVersion(request.model.id);
|
|
37
38
|
return version !== undefined && (version.major > 5 || (version.major === 5 && version.minor >= 1));
|
|
38
39
|
},
|
|
@@ -249,7 +249,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
249
249
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
250
250
|
} | undefined;
|
|
251
251
|
} | {
|
|
252
|
-
readonly type: "disabled";
|
|
252
|
+
readonly type: "disabled" | "between_tools";
|
|
253
253
|
} | undefined;
|
|
254
254
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
255
255
|
readonly container?: string | {
|
|
@@ -234,7 +234,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
234
234
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
235
235
|
} | undefined;
|
|
236
236
|
} | {
|
|
237
|
-
readonly type: "disabled";
|
|
237
|
+
readonly type: "disabled" | "between_tools";
|
|
238
238
|
} | undefined;
|
|
239
239
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
240
240
|
readonly container?: string | {
|
|
@@ -461,7 +461,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
|
|
|
461
461
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
462
462
|
} | undefined;
|
|
463
463
|
} | {
|
|
464
|
-
readonly type: "disabled";
|
|
464
|
+
readonly type: "disabled" | "between_tools";
|
|
465
465
|
} | undefined;
|
|
466
466
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
467
467
|
readonly container?: string | {
|
|
@@ -856,7 +856,7 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
856
856
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
857
857
|
} | undefined;
|
|
858
858
|
} | {
|
|
859
|
-
readonly type: "disabled";
|
|
859
|
+
readonly type: "disabled" | "between_tools";
|
|
860
860
|
} | undefined;
|
|
861
861
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
862
862
|
readonly container?: string | {
|
|
@@ -247,7 +247,7 @@ export declare const routes: Route<{
|
|
|
247
247
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
248
248
|
} | undefined;
|
|
249
249
|
} | {
|
|
250
|
-
readonly type: "disabled";
|
|
250
|
+
readonly type: "disabled" | "between_tools";
|
|
251
251
|
} | undefined;
|
|
252
252
|
service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
253
253
|
container?: string | {
|
package/dist/providers/meta.d.ts
CHANGED
|
@@ -573,7 +573,7 @@ export declare const routes: (Route<{
|
|
|
573
573
|
readonly prefix_mismatch_behavior?: OpenString<"error" | "drop_block"> | undefined;
|
|
574
574
|
} | undefined;
|
|
575
575
|
} | {
|
|
576
|
-
readonly type: "disabled";
|
|
576
|
+
readonly type: "disabled" | "between_tools";
|
|
577
577
|
} | undefined;
|
|
578
578
|
readonly service_tier?: OpenString<"auto" | "standard_only"> | undefined;
|
|
579
579
|
readonly container?: string | {
|
|
@@ -260,7 +260,7 @@ export declare const routes: (Route<{
|
|
|
260
260
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
261
261
|
} | undefined;
|
|
262
262
|
} | {
|
|
263
|
-
readonly type: "disabled";
|
|
263
|
+
readonly type: "disabled" | "between_tools";
|
|
264
264
|
} | undefined;
|
|
265
265
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
266
266
|
readonly container?: string | {
|
|
@@ -258,7 +258,7 @@ export declare const routes: (Route<{
|
|
|
258
258
|
readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
|
|
259
259
|
} | undefined;
|
|
260
260
|
} | {
|
|
261
|
-
readonly type: "disabled";
|
|
261
|
+
readonly type: "disabled" | "between_tools";
|
|
262
262
|
} | undefined;
|
|
263
263
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
264
264
|
readonly container?: 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-
|
|
3
|
+
"version": "0.0.0-dev-20681",
|
|
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-20681",
|
|
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-20681",
|
|
48
48
|
"aws4fetch": "1.0.20",
|
|
49
49
|
"effect": "4.0.0-rc.112",
|
|
50
50
|
"google-auth-library": "10.5.0"
|