@opencode/ai 2.1.2 → 2.1.4
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/cache-policy.js +6 -5
- package/dist/experimental/evaluation.d.ts +7 -6
- package/dist/experimental/evaluation.js +3 -11
- package/dist/experimental/realtime.d.ts +59 -0
- package/dist/experimental/realtime.js +21 -13
- package/dist/experimental.d.ts +1 -1
- package/dist/generation.js +1 -1
- package/dist/image-client.d.ts +11 -9
- package/dist/image.d.ts +158 -150
- package/dist/image.js +2 -2
- package/dist/llm.d.ts +2 -4
- package/dist/llm.js +2 -2
- package/dist/media-model.d.ts +2 -2
- package/dist/media-model.js +1 -1
- package/dist/promise.d.ts +121 -121
- package/dist/promise.js +3 -5
- package/dist/protocols/alibaba-chat.d.ts +18 -18
- package/dist/protocols/alibaba-chat.js +3 -3
- package/dist/protocols/alibaba-messages.d.ts +12 -12
- package/dist/protocols/alibaba-messages.js +1 -1
- package/dist/protocols/alibaba-responses.d.ts +38 -38
- package/dist/protocols/anthropic-messages.d.ts +40 -44
- package/dist/protocols/anthropic-messages.js +13 -15
- package/dist/protocols/bedrock-converse.d.ts +36 -85
- package/dist/protocols/bedrock-converse.js +6 -6
- package/dist/protocols/bedrock-event-stream.d.ts +6 -1
- package/dist/protocols/bedrock-event-stream.js +9 -8
- package/dist/protocols/cartesia-speech.d.ts +32 -32
- package/dist/protocols/cohere-chat.d.ts +13 -10
- package/dist/protocols/cohere-chat.js +2 -2
- package/dist/protocols/deepgram-speech.d.ts +32 -32
- package/dist/protocols/elevenlabs-speech.d.ts +32 -32
- package/dist/protocols/gemini.d.ts +46 -36
- package/dist/protocols/gemini.js +12 -15
- package/dist/protocols/google-interactions.d.ts +14 -13
- package/dist/protocols/google-interactions.js +16 -11
- package/dist/protocols/google-speech.d.ts +32 -32
- package/dist/protocols/google-transcription.d.ts +32 -32
- package/dist/protocols/meta-messages.d.ts +23 -23
- package/dist/protocols/meta-responses.d.ts +84 -84
- package/dist/protocols/mistral-chat.d.ts +81 -78
- package/dist/protocols/mistral-chat.js +3 -5
- package/dist/protocols/open-responses-channel.js +47 -46
- package/dist/protocols/open-responses-continuation.d.ts +8 -2
- package/dist/protocols/open-responses-continuation.js +3 -1
- package/dist/protocols/open-responses.d.ts +419 -419
- package/dist/protocols/open-responses.js +11 -10
- package/dist/protocols/openai-chat.d.ts +68 -67
- package/dist/protocols/openai-chat.js +7 -8
- package/dist/protocols/openai-compatible-chat.d.ts +13 -14
- package/dist/protocols/openai-compatible-responses.d.ts +39 -40
- package/dist/protocols/openai-images.d.ts +32 -32
- package/dist/protocols/openai-responses.d.ts +253 -253
- package/dist/protocols/openai-responses.js +1 -1
- package/dist/protocols/openai-speech.d.ts +32 -32
- package/dist/protocols/openai-transcription.d.ts +32 -32
- package/dist/protocols/openai-transcription.js +12 -7
- package/dist/protocols/utils/open-responses-options.d.ts +8 -8
- package/dist/protocols/utils/open-responses-options.js +4 -6
- package/dist/protocols/utils/partial-json-options.d.ts +0 -1
- package/dist/protocols/utils/partial-json-options.js +0 -1
- package/dist/protocols/utils/partial-json.js +5 -4
- package/dist/protocols/utils/tool-schema.d.ts +0 -3
- package/dist/protocols/utils/tool-schema.js +0 -4
- package/dist/protocols/utils/tool-stream.d.ts +1 -1
- package/dist/protocols/venice-chat.d.ts +52 -53
- package/dist/protocols/venice-chat.js +6 -5
- package/dist/protocols/xai-images.js +3 -4
- package/dist/protocols/xai-responses.d.ts +81 -81
- package/dist/protocols/zai-chat.d.ts +33 -30
- package/dist/protocols/zai-chat.js +8 -3
- package/dist/protocols/zai-messages.d.ts +21 -19
- package/dist/protocols/zai-messages.js +3 -2
- package/dist/provider-error.js +8 -7
- package/dist/providers/alibaba.d.ts +74 -74
- package/dist/providers/amazon-bedrock-mantle.d.ts +202 -202
- package/dist/providers/amazon-bedrock.d.ts +16 -13
- package/dist/providers/anthropic-compatible.d.ts +13 -13
- package/dist/providers/anthropic.d.ts +13 -13
- package/dist/providers/azure.d.ts +112 -112
- package/dist/providers/baseten.d.ts +24 -24
- package/dist/providers/cerebras.d.ts +24 -24
- package/dist/providers/cloudflare-ai-gateway.d.ts +237 -234
- package/dist/providers/cloudflare-ai-gateway.js +3 -6
- package/dist/providers/cloudflare-workers-ai.d.ts +24 -24
- package/dist/providers/cohere.d.ts +78 -74
- package/dist/providers/deepinfra.d.ts +24 -24
- package/dist/providers/deepseek.d.ts +24 -24
- package/dist/providers/digitalocean.d.ts +36 -36
- package/dist/providers/fireworks.d.ts +24 -24
- package/dist/providers/google-vertex-chat.d.ts +12 -12
- package/dist/providers/google-vertex-interactions.d.ts +3 -3
- package/dist/providers/google-vertex-messages.d.ts +20 -20
- package/dist/providers/google-vertex-mistral.d.ts +14 -14
- package/dist/providers/google-vertex-responses.d.ts +38 -38
- package/dist/providers/google-vertex.d.ts +17 -17
- package/dist/providers/google-vertex.js +2 -2
- package/dist/providers/google.d.ts +79 -79
- package/dist/providers/groq.d.ts +24 -24
- package/dist/providers/meta.d.ts +189 -189
- package/dist/providers/minimax.d.ts +202 -202
- package/dist/providers/mistral.d.ts +28 -28
- package/dist/providers/moonshot.d.ts +202 -202
- package/dist/providers/open-responses-options.d.ts +0 -1
- package/dist/providers/open-responses-options.js +1 -1
- package/dist/providers/openai-compatible-responses.d.ts +38 -38
- package/dist/providers/openai-compatible.d.ts +12 -12
- package/dist/providers/openai-compatible.js +1 -1
- package/dist/providers/openai-options.d.ts +3 -4
- package/dist/providers/openai-options.js +0 -1
- package/dist/providers/openai.d.ts +103 -103
- package/dist/providers/openrouter.d.ts +171 -112
- package/dist/providers/openrouter.js +40 -33
- package/dist/providers/togetherai.d.ts +24 -24
- package/dist/providers/venice.d.ts +195 -20
- package/dist/providers/xai.d.ts +12 -12
- package/dist/providers/zai-coding-plan.d.ts +152 -72
- package/dist/providers/zai.d.ts +84 -19
- package/dist/route/auth-options.d.ts +0 -3
- package/dist/route/auth.d.ts +0 -2
- package/dist/route/auth.js +0 -2
- package/dist/route/client.d.ts +0 -218
- package/dist/route/client.js +3 -7
- package/dist/route/executor-service.js +1 -1
- package/dist/route/transport/http.js +5 -8
- package/dist/schema/errors.d.ts +1 -1
- package/dist/schema/errors.js +1 -1
- package/dist/schema/messages.js +4 -7
- package/dist/speech-client.d.ts +11 -9
- package/dist/speech.d.ts +158 -150
- package/dist/speech.js +2 -2
- package/dist/transcription-client.d.ts +11 -9
- package/dist/transcription.d.ts +158 -150
- package/dist/transcription.js +2 -2
- package/dist/video-client.d.ts +11 -9
- package/dist/video.d.ts +124 -116
- package/dist/video.js +2 -2
- package/package.json +7 -6
- package/dist/protocols/utils/openai-options.d.ts +0 -16
- package/dist/protocols/utils/openai-options.js +0 -15
|
@@ -14,13 +14,6 @@ export declare const routes: (Route<{
|
|
|
14
14
|
readonly messages: readonly ({
|
|
15
15
|
readonly role: "system";
|
|
16
16
|
readonly content: string | readonly ({
|
|
17
|
-
readonly type: "text";
|
|
18
|
-
readonly text: string;
|
|
19
|
-
readonly cache_control?: {
|
|
20
|
-
readonly type: "ephemeral";
|
|
21
|
-
readonly ttl?: string | undefined;
|
|
22
|
-
} | undefined;
|
|
23
|
-
} | {
|
|
24
17
|
readonly type: "image_url";
|
|
25
18
|
readonly image_url: {
|
|
26
19
|
readonly url: string;
|
|
@@ -31,17 +24,17 @@ export declare const routes: (Route<{
|
|
|
31
24
|
readonly filename: string;
|
|
32
25
|
readonly file_data: string;
|
|
33
26
|
};
|
|
34
|
-
}
|
|
35
|
-
} | {
|
|
36
|
-
readonly role: "user";
|
|
37
|
-
readonly content: string | readonly ({
|
|
27
|
+
} | {
|
|
38
28
|
readonly type: "text";
|
|
39
29
|
readonly text: string;
|
|
40
30
|
readonly cache_control?: {
|
|
41
31
|
readonly type: "ephemeral";
|
|
42
32
|
readonly ttl?: string | undefined;
|
|
43
33
|
} | undefined;
|
|
44
|
-
}
|
|
34
|
+
})[];
|
|
35
|
+
} | {
|
|
36
|
+
readonly role: "user";
|
|
37
|
+
readonly content: string | readonly ({
|
|
45
38
|
readonly type: "image_url";
|
|
46
39
|
readonly image_url: {
|
|
47
40
|
readonly url: string;
|
|
@@ -52,6 +45,13 @@ export declare const routes: (Route<{
|
|
|
52
45
|
readonly filename: string;
|
|
53
46
|
readonly file_data: string;
|
|
54
47
|
};
|
|
48
|
+
} | {
|
|
49
|
+
readonly type: "text";
|
|
50
|
+
readonly text: string;
|
|
51
|
+
readonly cache_control?: {
|
|
52
|
+
readonly type: "ephemeral";
|
|
53
|
+
readonly ttl?: string | undefined;
|
|
54
|
+
} | undefined;
|
|
55
55
|
})[];
|
|
56
56
|
} | {
|
|
57
57
|
readonly role: "tool";
|
|
@@ -133,55 +133,10 @@ export declare const routes: (Route<{
|
|
|
133
133
|
}, import("../route/transport/http.js").HttpPrepared<string>, CompactionOperations | undefined> | Route<{
|
|
134
134
|
readonly model: string;
|
|
135
135
|
readonly input: readonly ({
|
|
136
|
-
readonly [x: string]: unknown;
|
|
137
|
-
readonly type: "web_search_call";
|
|
138
|
-
readonly id: string;
|
|
139
|
-
readonly status?: string | undefined;
|
|
140
|
-
readonly action?: {
|
|
141
|
-
readonly [x: string]: unknown;
|
|
142
|
-
} | null | undefined;
|
|
143
|
-
} | {
|
|
144
|
-
readonly [x: string]: unknown;
|
|
145
|
-
readonly type: "file_search_call";
|
|
146
|
-
readonly id: string;
|
|
147
|
-
readonly status?: string | undefined;
|
|
148
|
-
readonly queries?: readonly string[] | undefined;
|
|
149
|
-
readonly results?: readonly {
|
|
150
|
-
readonly [x: string]: unknown;
|
|
151
|
-
}[] | null | undefined;
|
|
152
|
-
} | {
|
|
153
|
-
readonly [x: string]: unknown;
|
|
154
|
-
readonly type: "code_interpreter_call";
|
|
155
|
-
readonly id: string;
|
|
156
|
-
readonly status?: string | undefined;
|
|
157
|
-
readonly code?: string | null | undefined;
|
|
158
|
-
readonly container_id?: string | null | undefined;
|
|
159
|
-
readonly outputs?: readonly {
|
|
160
|
-
readonly [x: string]: unknown;
|
|
161
|
-
}[] | null | undefined;
|
|
162
|
-
} | {
|
|
163
|
-
readonly [x: string]: unknown;
|
|
164
|
-
readonly type: "mcp_call";
|
|
165
|
-
readonly id: string;
|
|
166
|
-
readonly status?: string | undefined;
|
|
167
|
-
readonly server_label?: string | undefined;
|
|
168
|
-
readonly name?: string | undefined;
|
|
169
|
-
readonly arguments?: string | undefined;
|
|
170
|
-
readonly output?: string | null | undefined;
|
|
171
|
-
readonly error?: unknown;
|
|
172
|
-
} | {
|
|
173
136
|
readonly type: "configuration_update";
|
|
174
137
|
readonly reasoning: {
|
|
175
138
|
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
176
139
|
};
|
|
177
|
-
} | {
|
|
178
|
-
readonly [x: string]: unknown;
|
|
179
|
-
readonly type: string;
|
|
180
|
-
readonly id: string;
|
|
181
|
-
} | {
|
|
182
|
-
readonly type: "compaction";
|
|
183
|
-
readonly id?: string | null | undefined;
|
|
184
|
-
readonly encrypted_content: string;
|
|
185
140
|
} | {
|
|
186
141
|
readonly type: "message";
|
|
187
142
|
readonly role: "system";
|
|
@@ -190,10 +145,45 @@ export declare const routes: (Route<{
|
|
|
190
145
|
readonly type: "message";
|
|
191
146
|
readonly role: "developer";
|
|
192
147
|
readonly content: string;
|
|
148
|
+
} | {
|
|
149
|
+
readonly type: "function_call_output";
|
|
150
|
+
readonly call_id: string;
|
|
151
|
+
readonly output: string | readonly ({
|
|
152
|
+
readonly type: "input_text";
|
|
153
|
+
readonly text: string;
|
|
154
|
+
} | {
|
|
155
|
+
readonly type: "input_video";
|
|
156
|
+
readonly video_url: string;
|
|
157
|
+
} | {
|
|
158
|
+
readonly type: "input_image";
|
|
159
|
+
readonly image_url: string;
|
|
160
|
+
readonly detail?: string | undefined;
|
|
161
|
+
} | {
|
|
162
|
+
readonly type: "input_file";
|
|
163
|
+
readonly filename: string;
|
|
164
|
+
readonly detail?: string | undefined;
|
|
165
|
+
readonly file_data?: string | undefined;
|
|
166
|
+
readonly file_url?: string | undefined;
|
|
167
|
+
})[];
|
|
168
|
+
} | {
|
|
169
|
+
readonly type: "reasoning";
|
|
170
|
+
readonly id?: string | undefined;
|
|
171
|
+
readonly summary: readonly {
|
|
172
|
+
readonly type: "summary_text";
|
|
173
|
+
readonly text: string;
|
|
174
|
+
}[];
|
|
175
|
+
readonly encrypted_content?: string | null | undefined;
|
|
176
|
+
} | {
|
|
177
|
+
readonly type: "compaction";
|
|
178
|
+
readonly id?: string | null | undefined;
|
|
179
|
+
readonly encrypted_content: string;
|
|
193
180
|
} | {
|
|
194
181
|
readonly type: "message";
|
|
195
182
|
readonly role: "user";
|
|
196
183
|
readonly content: readonly ({
|
|
184
|
+
readonly type: "input_text";
|
|
185
|
+
readonly text: string;
|
|
186
|
+
} | {
|
|
197
187
|
readonly type: "input_image";
|
|
198
188
|
readonly image_url: string;
|
|
199
189
|
readonly detail?: string | undefined;
|
|
@@ -203,9 +193,6 @@ export declare const routes: (Route<{
|
|
|
203
193
|
readonly detail?: string | undefined;
|
|
204
194
|
readonly file_data?: string | undefined;
|
|
205
195
|
readonly file_url?: string | undefined;
|
|
206
|
-
} | {
|
|
207
|
-
readonly type: "input_text";
|
|
208
|
-
readonly text: string;
|
|
209
196
|
})[];
|
|
210
197
|
readonly id?: string | undefined;
|
|
211
198
|
readonly status?: string | undefined;
|
|
@@ -219,14 +206,6 @@ export declare const routes: (Route<{
|
|
|
219
206
|
}[];
|
|
220
207
|
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
221
208
|
readonly status?: string | undefined;
|
|
222
|
-
} | {
|
|
223
|
-
readonly type: "reasoning";
|
|
224
|
-
readonly id?: string | undefined;
|
|
225
|
-
readonly summary: readonly {
|
|
226
|
-
readonly type: "summary_text";
|
|
227
|
-
readonly text: string;
|
|
228
|
-
}[];
|
|
229
|
-
readonly encrypted_content?: string | null | undefined;
|
|
230
209
|
} | {
|
|
231
210
|
readonly type: "function_call";
|
|
232
211
|
readonly id?: string | undefined;
|
|
@@ -235,25 +214,46 @@ export declare const routes: (Route<{
|
|
|
235
214
|
readonly namespace?: string | undefined;
|
|
236
215
|
readonly arguments: string;
|
|
237
216
|
} | {
|
|
238
|
-
readonly
|
|
239
|
-
readonly
|
|
240
|
-
readonly
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
readonly
|
|
244
|
-
} |
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
readonly
|
|
253
|
-
} |
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
217
|
+
readonly [x: string]: unknown;
|
|
218
|
+
readonly type: "web_search_call";
|
|
219
|
+
readonly id: string;
|
|
220
|
+
readonly status?: string | undefined;
|
|
221
|
+
readonly action?: {
|
|
222
|
+
readonly [x: string]: unknown;
|
|
223
|
+
} | null | undefined;
|
|
224
|
+
} | {
|
|
225
|
+
readonly [x: string]: unknown;
|
|
226
|
+
readonly type: "file_search_call";
|
|
227
|
+
readonly id: string;
|
|
228
|
+
readonly status?: string | undefined;
|
|
229
|
+
readonly queries?: readonly string[] | undefined;
|
|
230
|
+
readonly results?: readonly {
|
|
231
|
+
readonly [x: string]: unknown;
|
|
232
|
+
}[] | null | undefined;
|
|
233
|
+
} | {
|
|
234
|
+
readonly [x: string]: unknown;
|
|
235
|
+
readonly type: "code_interpreter_call";
|
|
236
|
+
readonly id: string;
|
|
237
|
+
readonly status?: string | undefined;
|
|
238
|
+
readonly code?: string | null | undefined;
|
|
239
|
+
readonly container_id?: string | null | undefined;
|
|
240
|
+
readonly outputs?: readonly {
|
|
241
|
+
readonly [x: string]: unknown;
|
|
242
|
+
}[] | null | undefined;
|
|
243
|
+
} | {
|
|
244
|
+
readonly [x: string]: unknown;
|
|
245
|
+
readonly type: "mcp_call";
|
|
246
|
+
readonly id: string;
|
|
247
|
+
readonly status?: string | undefined;
|
|
248
|
+
readonly server_label?: string | undefined;
|
|
249
|
+
readonly name?: string | undefined;
|
|
250
|
+
readonly arguments?: string | undefined;
|
|
251
|
+
readonly output?: string | null | undefined;
|
|
252
|
+
readonly error?: unknown;
|
|
253
|
+
} | {
|
|
254
|
+
readonly [x: string]: unknown;
|
|
255
|
+
readonly type: string;
|
|
256
|
+
readonly id: string;
|
|
257
257
|
})[];
|
|
258
258
|
readonly instructions?: string | undefined;
|
|
259
259
|
readonly store?: boolean | undefined;
|
|
@@ -266,15 +266,15 @@ export declare const routes: (Route<{
|
|
|
266
266
|
} | undefined;
|
|
267
267
|
readonly top_logprobs?: number | undefined;
|
|
268
268
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
269
|
-
readonly service_tier?:
|
|
269
|
+
readonly service_tier?: OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
270
270
|
readonly prompt_cache_key?: string | undefined;
|
|
271
|
-
readonly include?: readonly
|
|
271
|
+
readonly include?: readonly OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">[] | undefined;
|
|
272
272
|
readonly reasoning?: {
|
|
273
273
|
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
274
274
|
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
275
275
|
} | undefined;
|
|
276
276
|
readonly text?: {
|
|
277
|
-
readonly verbosity?:
|
|
277
|
+
readonly verbosity?: OpenString<"high" | "low" | "medium"> | undefined;
|
|
278
278
|
} | undefined;
|
|
279
279
|
readonly max_output_tokens?: number | undefined;
|
|
280
280
|
readonly max_tool_calls?: number | undefined;
|
|
@@ -284,6 +284,19 @@ export declare const routes: (Route<{
|
|
|
284
284
|
readonly presence_penalty?: number | undefined;
|
|
285
285
|
readonly frequency_penalty?: number | undefined;
|
|
286
286
|
readonly tools?: readonly ({
|
|
287
|
+
readonly type: "namespace";
|
|
288
|
+
readonly name: string;
|
|
289
|
+
readonly description: string;
|
|
290
|
+
readonly tools: readonly {
|
|
291
|
+
readonly type: "function";
|
|
292
|
+
readonly name: string;
|
|
293
|
+
readonly description: string;
|
|
294
|
+
readonly parameters: {
|
|
295
|
+
readonly [x: string]: unknown;
|
|
296
|
+
};
|
|
297
|
+
readonly strict?: boolean | undefined;
|
|
298
|
+
}[];
|
|
299
|
+
} | {
|
|
287
300
|
readonly type: "function";
|
|
288
301
|
readonly name: string;
|
|
289
302
|
readonly description: string;
|
|
@@ -301,19 +314,6 @@ export declare const routes: (Route<{
|
|
|
301
314
|
readonly partial_images?: number | undefined;
|
|
302
315
|
readonly quality?: "auto" | "high" | "low" | "medium" | undefined;
|
|
303
316
|
readonly size?: string | undefined;
|
|
304
|
-
} | {
|
|
305
|
-
readonly type: "namespace";
|
|
306
|
-
readonly name: string;
|
|
307
|
-
readonly description: string;
|
|
308
|
-
readonly tools: readonly {
|
|
309
|
-
readonly type: "function";
|
|
310
|
-
readonly name: string;
|
|
311
|
-
readonly description: string;
|
|
312
|
-
readonly parameters: {
|
|
313
|
-
readonly [x: string]: unknown;
|
|
314
|
-
};
|
|
315
|
-
readonly strict?: boolean | undefined;
|
|
316
|
-
}[];
|
|
317
317
|
})[] | undefined;
|
|
318
318
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
319
319
|
readonly type: "function";
|