@opencode/ai 2.0.18 → 2.0.20
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 +24 -12
- package/dist/cache-policy.js +7 -0
- package/dist/experimental/evaluation.d.ts +7 -0
- package/dist/experimental/evaluation.js +2 -0
- package/dist/experimental/system-one.js +10 -7
- package/dist/generation.d.ts +1 -1
- package/dist/generation.js +23 -18
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/llm.d.ts +1 -1
- package/dist/promise.d.ts +3 -3
- package/dist/promise.js +4 -3
- package/dist/protocols/alibaba-chat.d.ts +8 -2
- package/dist/protocols/alibaba-responses.d.ts +14 -14
- package/dist/protocols/anthropic-messages.js +2 -15
- package/dist/protocols/bedrock-converse.d.ts +1 -1
- package/dist/protocols/bedrock-converse.js +38 -12
- package/dist/protocols/deepgram-speech.js +9 -7
- package/dist/protocols/deepgram-transcription.js +4 -10
- package/dist/protocols/elevenlabs-transcription.d.ts +28 -0
- package/dist/protocols/elevenlabs-transcription.js +137 -0
- package/dist/protocols/gemini.js +1 -10
- package/dist/protocols/google-speech.js +9 -2
- package/dist/protocols/google-transcription.js +4 -0
- package/dist/protocols/google-video.js +11 -2
- package/dist/protocols/meta-messages.d.ts +5 -1
- package/dist/protocols/meta-messages.js +11 -4
- package/dist/protocols/meta-responses.d.ts +16 -16
- package/dist/protocols/mistral-chat.d.ts +6 -0
- package/dist/protocols/mistral-chat.js +8 -5
- package/dist/protocols/open-responses.d.ts +31 -31
- package/dist/protocols/openai-chat.d.ts +53 -10
- package/dist/protocols/openai-chat.js +21 -8
- package/dist/protocols/openai-compatible-chat.d.ts +7 -2
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-responses.d.ts +22 -22
- package/dist/protocols/openai-speech.js +6 -1
- package/dist/protocols/openai-transcription.js +1 -1
- package/dist/protocols/runway-video.js +2 -1
- package/dist/protocols/utils/claude-model.d.ts +8 -0
- package/dist/protocols/utils/claude-model.js +15 -0
- package/dist/protocols/utils/gemini-generate-content.d.ts +6 -0
- package/dist/protocols/utils/gemini-generate-content.js +33 -0
- package/dist/protocols/utils/media-input.d.ts +4 -3
- package/dist/protocols/utils/media-input.js +5 -4
- package/dist/protocols/utils/speaker-turns.d.ts +3 -0
- package/dist/protocols/utils/speaker-turns.js +9 -0
- package/dist/protocols/utils/speech-stream.d.ts +1 -0
- package/dist/protocols/utils/speech-stream.js +1 -0
- package/dist/protocols/utils/tool-stream.d.ts +4 -3
- package/dist/protocols/utils/tool-stream.js +1 -1
- package/dist/protocols/xai-responses.d.ts +14 -14
- package/dist/protocols/xai-video.js +7 -1
- package/dist/protocols/zai-chat.d.ts +8 -2
- package/dist/provider-error.d.ts +6 -0
- package/dist/provider-error.js +65 -2
- package/dist/providers/alibaba.d.ts +9 -4
- package/dist/providers/amazon-bedrock-mantle.d.ts +9 -4
- package/dist/providers/anthropic-compatible.js +3 -2
- package/dist/providers/azure.d.ts +11 -6
- package/dist/providers/baseten.d.ts +14 -4
- package/dist/providers/cerebras.d.ts +14 -4
- package/dist/providers/cloudflare-ai-gateway.d.ts +18 -8
- package/dist/providers/cloudflare-workers-ai.d.ts +14 -4
- package/dist/providers/deepinfra.d.ts +14 -4
- package/dist/providers/deepseek.d.ts +14 -4
- package/dist/providers/elevenlabs.d.ts +5 -0
- package/dist/providers/elevenlabs.js +4 -0
- package/dist/providers/fireworks.d.ts +14 -4
- package/dist/providers/google-vertex-chat.d.ts +7 -2
- package/dist/providers/google-vertex-responses.d.ts +2 -2
- package/dist/providers/groq.d.ts +15 -4
- package/dist/providers/meta.d.ts +14 -5
- package/dist/providers/minimax.d.ts +9 -4
- package/dist/providers/moonshot.d.ts +9 -4
- package/dist/providers/openai-compatible-responses.d.ts +2 -2
- package/dist/providers/openai-compatible.d.ts +7 -2
- package/dist/providers/openai.d.ts +9 -4
- package/dist/providers/openrouter.d.ts +27 -6
- package/dist/providers/togetherai.d.ts +14 -4
- package/dist/providers/xai.d.ts +7 -2
- package/dist/providers/xai.js +3 -3
- package/dist/providers/zai-coding-plan.d.ts +9 -4
- package/dist/providers/zai.d.ts +7 -2
- package/dist/route/client.d.ts +1 -1
- package/dist/route/executor.js +12 -8
- package/dist/route/media-protocol.d.ts +13 -3
- package/dist/route/media-protocol.js +16 -6
- package/dist/route/media.js +18 -4
- package/dist/schema/events.d.ts +30 -30
- package/dist/testing.d.ts +8 -8
- package/dist/transcription.d.ts +1 -1
- package/dist/transcription.js +1 -1
- package/package.json +3 -3
package/dist/testing.d.ts
CHANGED
|
@@ -206,8 +206,8 @@ export declare const complete: (options: {
|
|
|
206
206
|
} | {
|
|
207
207
|
readonly id: string;
|
|
208
208
|
readonly type: "tool-error";
|
|
209
|
-
readonly name: string;
|
|
210
209
|
readonly message: string;
|
|
210
|
+
readonly name: string;
|
|
211
211
|
readonly error?: unknown;
|
|
212
212
|
readonly providerMetadata?: {
|
|
213
213
|
readonly [x: string]: {
|
|
@@ -418,8 +418,8 @@ export declare const stop: (...events: readonly LLMEvent[]) => (({
|
|
|
418
418
|
} | {
|
|
419
419
|
readonly id: string;
|
|
420
420
|
readonly type: "tool-error";
|
|
421
|
-
readonly name: string;
|
|
422
421
|
readonly message: string;
|
|
422
|
+
readonly name: string;
|
|
423
423
|
readonly error?: unknown;
|
|
424
424
|
readonly providerMetadata?: {
|
|
425
425
|
readonly [x: string]: {
|
|
@@ -630,8 +630,8 @@ export declare const toolCalls: (...events: readonly LLMEvent[]) => (({
|
|
|
630
630
|
} | {
|
|
631
631
|
readonly id: string;
|
|
632
632
|
readonly type: "tool-error";
|
|
633
|
-
readonly name: string;
|
|
634
633
|
readonly message: string;
|
|
634
|
+
readonly name: string;
|
|
635
635
|
readonly error?: unknown;
|
|
636
636
|
readonly providerMetadata?: {
|
|
637
637
|
readonly [x: string]: {
|
|
@@ -842,8 +842,8 @@ export declare const text: (value: string, id: string) => (({
|
|
|
842
842
|
} | {
|
|
843
843
|
readonly id: string;
|
|
844
844
|
readonly type: "tool-error";
|
|
845
|
-
readonly name: string;
|
|
846
845
|
readonly message: string;
|
|
846
|
+
readonly name: string;
|
|
847
847
|
readonly error?: unknown;
|
|
848
848
|
readonly providerMetadata?: {
|
|
849
849
|
readonly [x: string]: {
|
|
@@ -1054,8 +1054,8 @@ export declare const textWithUsage: (value: string, id: string, inputTokens: num
|
|
|
1054
1054
|
} | {
|
|
1055
1055
|
readonly id: string;
|
|
1056
1056
|
readonly type: "tool-error";
|
|
1057
|
-
readonly name: string;
|
|
1058
1057
|
readonly message: string;
|
|
1058
|
+
readonly name: string;
|
|
1059
1059
|
readonly error?: unknown;
|
|
1060
1060
|
readonly providerMetadata?: {
|
|
1061
1061
|
readonly [x: string]: {
|
|
@@ -1266,8 +1266,8 @@ export declare const tool: (id: string, name: string, input: unknown) => (({
|
|
|
1266
1266
|
} | {
|
|
1267
1267
|
readonly id: string;
|
|
1268
1268
|
readonly type: "tool-error";
|
|
1269
|
-
readonly name: string;
|
|
1270
1269
|
readonly message: string;
|
|
1270
|
+
readonly name: string;
|
|
1271
1271
|
readonly error?: unknown;
|
|
1272
1272
|
readonly providerMetadata?: {
|
|
1273
1273
|
readonly [x: string]: {
|
|
@@ -1478,8 +1478,8 @@ export declare const failAfter: (error: AIError, ...events: readonly LLMEvent[])
|
|
|
1478
1478
|
} | {
|
|
1479
1479
|
readonly id: string;
|
|
1480
1480
|
readonly type: "tool-error";
|
|
1481
|
-
readonly name: string;
|
|
1482
1481
|
readonly message: string;
|
|
1482
|
+
readonly name: string;
|
|
1483
1483
|
readonly error?: unknown;
|
|
1484
1484
|
readonly providerMetadata?: {
|
|
1485
1485
|
readonly [x: string]: {
|
|
@@ -1690,8 +1690,8 @@ export declare const hangAfter: (...events: readonly LLMEvent[]) => Stream.Strea
|
|
|
1690
1690
|
} | {
|
|
1691
1691
|
readonly id: string;
|
|
1692
1692
|
readonly type: "tool-error";
|
|
1693
|
-
readonly name: string;
|
|
1694
1693
|
readonly message: string;
|
|
1694
|
+
readonly name: string;
|
|
1695
1695
|
readonly error?: unknown;
|
|
1696
1696
|
readonly providerMetadata?: {
|
|
1697
1697
|
readonly [x: string]: {
|
package/dist/transcription.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export type TranscriptionRequestInput<Model extends TranscriptionModel = Transcr
|
|
|
72
72
|
readonly providerOptions?: NoInfer<TranscriptionModelOptions<Model>>;
|
|
73
73
|
readonly http?: HttpOptions.Input;
|
|
74
74
|
};
|
|
75
|
-
/** Speaker labels are provider-native (`A`, `0`, `spk:0`, or a known speaker name). */
|
|
75
|
+
/** Speaker labels are provider-native (`A`, `0`, `spk:0`, `speaker_0`, or a known speaker name). */
|
|
76
76
|
export declare const TranscriptionSegment: Schema.Struct<{
|
|
77
77
|
readonly text: Schema.String;
|
|
78
78
|
readonly startSeconds: Schema.Number;
|
package/dist/transcription.js
CHANGED
|
@@ -36,7 +36,7 @@ export class TranscriptionRequest extends Schema.Class("Transcription.Request")(
|
|
|
36
36
|
// ---------------------------------------------------------------------------
|
|
37
37
|
// Response and events
|
|
38
38
|
// ---------------------------------------------------------------------------
|
|
39
|
-
/** Speaker labels are provider-native (`A`, `0`, `spk:0`, or a known speaker name). */
|
|
39
|
+
/** Speaker labels are provider-native (`A`, `0`, `spk:0`, `speaker_0`, or a known speaker name). */
|
|
40
40
|
export const TranscriptionSegment = Schema.Struct({
|
|
41
41
|
text: Schema.String,
|
|
42
42
|
startSeconds: Schema.Number,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20",
|
|
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": "2.0.
|
|
37
|
+
"@opencode/http-recorder": "2.0.20",
|
|
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": "2.0.
|
|
47
|
+
"@opencode/schema": "2.0.20",
|
|
48
48
|
"aws4fetch": "1.0.20",
|
|
49
49
|
"effect": "4.0.0-rc.112",
|
|
50
50
|
"google-auth-library": "10.5.0"
|