@opencode-ai/ai 0.0.0-next-16255 → 0.0.0-next-16274

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.
Files changed (42) hide show
  1. package/dist/llm.d.ts +60 -60
  2. package/dist/protocols/anthropic-messages.d.ts +303 -303
  3. package/dist/protocols/anthropic-messages.js +1 -0
  4. package/dist/protocols/bedrock-converse.d.ts +246 -242
  5. package/dist/protocols/gemini.d.ts +136 -132
  6. package/dist/protocols/gemini.js +1 -0
  7. package/dist/protocols/open-responses.d.ts +232 -232
  8. package/dist/protocols/openai-chat.d.ts +147 -141
  9. package/dist/protocols/openai-chat.js +1 -0
  10. package/dist/protocols/openai-compatible-chat.d.ts +48 -46
  11. package/dist/protocols/openai-compatible-responses.d.ts +56 -56
  12. package/dist/protocols/openai-responses.d.ts +388 -388
  13. package/dist/protocols/shared.d.ts +5 -4
  14. package/dist/protocols/shared.js +1 -0
  15. package/dist/protocols/utils/bedrock-media.d.ts +10 -10
  16. package/dist/protocols/utils/tool-stream.d.ts +180 -180
  17. package/dist/providers/amazon-bedrock.d.ts +109 -107
  18. package/dist/providers/anthropic-compatible.d.ts +145 -145
  19. package/dist/providers/anthropic.d.ts +145 -145
  20. package/dist/providers/azure.d.ts +112 -110
  21. package/dist/providers/cloudflare.d.ts +144 -138
  22. package/dist/providers/github-copilot.d.ts +112 -110
  23. package/dist/providers/google-vertex-chat.d.ts +48 -46
  24. package/dist/providers/google-vertex-messages.d.ts +145 -146
  25. package/dist/providers/google-vertex-responses.d.ts +56 -56
  26. package/dist/providers/google-vertex.d.ts +52 -50
  27. package/dist/providers/google.d.ts +52 -50
  28. package/dist/providers/openai-compatible-responses.d.ts +56 -56
  29. package/dist/providers/openai-compatible.d.ts +48 -46
  30. package/dist/providers/openai.d.ts +176 -174
  31. package/dist/providers/openrouter.d.ts +147 -141
  32. package/dist/providers/xai.d.ts +112 -110
  33. package/dist/route/client.d.ts +60 -60
  34. package/dist/schema/errors.d.ts +2 -6
  35. package/dist/schema/errors.js +2 -5
  36. package/dist/schema/events.d.ts +1117 -1115
  37. package/dist/schema/messages.d.ts +9 -9
  38. package/dist/schema/messages.js +3 -4
  39. package/dist/tool-runtime.js +1 -1
  40. package/dist/tool.d.ts +5 -4
  41. package/dist/tool.js +1 -0
  42. package/package.json +5 -5
@@ -8,130 +8,132 @@ export type { OpenAIOptionsInput, OpenAIResponseIncludable } from "./openai-opti
8
8
  export type { OpenAIImageOptions } from "../protocols/openai-images";
9
9
  export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
10
10
  export declare const routes: (Route<{
11
- readonly messages: readonly (import("effect/Schema").Struct.ReadonlySide<{
12
- readonly role: import("effect/Schema").Literal<"system">;
13
- readonly content: import("effect/Schema").String;
14
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
15
- readonly role: import("effect/Schema").Literal<"user">;
16
- readonly content: import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
17
- readonly type: import("effect/Schema").Literal<"text">;
18
- readonly text: import("effect/Schema").String;
19
- }>, import("effect/Schema").Struct<{
20
- readonly type: import("effect/Schema").Literal<"image_url">;
21
- readonly image_url: import("effect/Schema").Struct<{
22
- readonly url: import("effect/Schema").String;
23
- }>;
24
- }>]>>]>;
25
- }, "Type"> | {
11
+ readonly model: string;
12
+ readonly messages: readonly ({
13
+ readonly role: "system";
14
+ readonly content: string;
15
+ } | {
16
+ readonly role: "user";
17
+ readonly content: string | readonly ({
18
+ readonly type: "text";
19
+ readonly text: string;
20
+ } | {
21
+ readonly type: "image_url";
22
+ readonly image_url: {
23
+ readonly url: string;
24
+ };
25
+ })[];
26
+ } | {
26
27
  readonly [x: string]: unknown;
27
28
  readonly content: string | null;
28
29
  readonly role: "assistant";
29
30
  readonly reasoning?: string | undefined;
30
- readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
31
- readonly id: import("effect/Schema").String;
32
- readonly type: import("effect/Schema").tag<"function">;
33
- readonly function: import("effect/Schema").Struct<{
34
- readonly name: import("effect/Schema").String;
35
- readonly arguments: import("effect/Schema").String;
36
- }>;
37
- }, "Type">[] | undefined;
38
31
  readonly reasoning_content?: string | undefined;
39
32
  readonly reasoning_text?: string | undefined;
33
+ readonly tool_calls?: readonly {
34
+ readonly id: string;
35
+ readonly type: "function";
36
+ readonly function: {
37
+ readonly name: string;
38
+ readonly arguments: string;
39
+ };
40
+ }[] | undefined;
40
41
  readonly reasoning_details?: unknown;
41
- } | import("effect/Schema").Struct.ReadonlySide<{
42
- readonly role: import("effect/Schema").Literal<"tool">;
43
- readonly tool_call_id: import("effect/Schema").String;
44
- readonly content: import("effect/Schema").String;
45
- }, "Type">)[];
46
- readonly model: string;
42
+ } | {
43
+ readonly role: "tool";
44
+ readonly tool_call_id: string;
45
+ readonly content: string;
46
+ })[];
47
47
  readonly stream: true;
48
48
  readonly stop?: readonly string[] | undefined;
49
- readonly tools?: readonly import("effect/Schema").Struct.ReadonlySide<{
50
- readonly type: import("effect/Schema").tag<"function">;
51
- readonly function: import("effect/Schema").Struct<{
52
- readonly name: import("effect/Schema").String;
53
- readonly description: import("effect/Schema").String;
54
- readonly parameters: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
55
- }>;
56
- }, "Type">[] | undefined;
49
+ readonly tools?: readonly {
50
+ readonly type: "function";
51
+ readonly function: {
52
+ readonly name: string;
53
+ readonly description: string;
54
+ readonly parameters: {
55
+ readonly [x: string]: unknown;
56
+ };
57
+ };
58
+ }[] | undefined;
57
59
  readonly temperature?: number | undefined;
58
60
  readonly seed?: number | undefined;
59
61
  readonly frequency_penalty?: number | undefined;
60
62
  readonly max_tokens?: number | undefined;
61
63
  readonly presence_penalty?: number | undefined;
62
- readonly stream_options?: import("effect/Schema").Struct.ReadonlySide<{
63
- readonly include_usage: import("effect/Schema").Boolean;
64
- }, "Type"> | undefined;
65
- readonly tool_choice?: "required" | "none" | "auto" | import("effect/Schema").Struct.ReadonlySide<{
66
- readonly type: import("effect/Schema").tag<"function">;
67
- readonly function: import("effect/Schema").Struct<{
68
- readonly name: import("effect/Schema").String;
69
- }>;
70
- }, "Type"> | undefined;
64
+ readonly stream_options?: {
65
+ readonly include_usage: boolean;
66
+ } | undefined;
67
+ readonly tool_choice?: "required" | "none" | "auto" | {
68
+ readonly type: "function";
69
+ readonly function: {
70
+ readonly name: string;
71
+ };
72
+ } | undefined;
71
73
  readonly top_p?: number | undefined;
72
74
  readonly store?: boolean | undefined;
73
75
  readonly reasoning_effort?: string | undefined;
74
76
  }, import("../route/transport/http").HttpPrepared<string>> | Route<{
75
77
  readonly input: readonly ({
76
78
  readonly type: "reasoning";
77
- readonly summary: readonly import("effect/Schema").Struct.ReadonlySide<{
78
- readonly type: import("effect/Schema").tag<"summary_text">;
79
- readonly text: import("effect/Schema").String;
80
- }, "Type">[];
79
+ readonly summary: readonly {
80
+ readonly type: "summary_text";
81
+ readonly text: string;
82
+ }[];
81
83
  readonly id?: string | undefined;
82
84
  readonly encrypted_content?: string | null | undefined;
83
- } | import("effect/Schema").Struct.ReadonlySide<{
84
- readonly type: import("effect/Schema").tag<"item_reference">;
85
- readonly id: import("effect/Schema").String;
86
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
87
- readonly role: import("effect/Schema").tag<"system">;
88
- readonly content: import("effect/Schema").String;
89
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
90
- readonly role: import("effect/Schema").tag<"user">;
91
- readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
92
- readonly type: import("effect/Schema").tag<"input_text">;
93
- readonly text: import("effect/Schema").String;
94
- }>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
95
- readonly type: import("effect/Schema").tag<"input_image">;
96
- readonly image_url: import("effect/Schema").String;
97
- }>, import("effect/Schema").Struct<{
98
- readonly type: import("effect/Schema").tag<"input_file">;
99
- readonly filename: import("effect/Schema").String;
100
- readonly file_data: import("effect/Schema").String;
101
- readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
102
- }>]>]>>;
103
- }, "Type"> | {
104
- readonly content: readonly import("effect/Schema").Struct.ReadonlySide<{
105
- readonly type: import("effect/Schema").tag<"output_text">;
106
- readonly text: import("effect/Schema").String;
107
- }, "Type">[];
85
+ } | {
86
+ readonly type: "item_reference";
87
+ readonly id: string;
88
+ } | {
89
+ readonly role: "system";
90
+ readonly content: string;
91
+ } | {
92
+ readonly role: "user";
93
+ readonly content: readonly ({
94
+ readonly type: "input_image";
95
+ readonly image_url: string;
96
+ } | {
97
+ readonly type: "input_file";
98
+ readonly filename: string;
99
+ readonly file_data: string;
100
+ readonly mime_type?: string | undefined;
101
+ } | {
102
+ readonly type: "input_text";
103
+ readonly text: string;
104
+ })[];
105
+ } | {
106
+ readonly content: readonly {
107
+ readonly type: "output_text";
108
+ readonly text: string;
109
+ }[];
108
110
  readonly role: "assistant";
109
111
  readonly phase?: "commentary" | "final_answer" | undefined;
110
- } | import("effect/Schema").Struct.ReadonlySide<{
111
- readonly type: import("effect/Schema").tag<"function_call">;
112
- readonly call_id: import("effect/Schema").String;
113
- readonly name: import("effect/Schema").String;
114
- readonly arguments: import("effect/Schema").String;
115
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
116
- readonly type: import("effect/Schema").tag<"function_call_output">;
117
- readonly call_id: import("effect/Schema").String;
118
- readonly output: import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
119
- readonly type: import("effect/Schema").tag<"input_text">;
120
- readonly text: import("effect/Schema").String;
121
- }>, import("effect/Schema").Struct<{
122
- readonly type: import("effect/Schema").tag<"input_image">;
123
- readonly image_url: import("effect/Schema").String;
124
- }>, import("effect/Schema").Struct<{
125
- readonly type: import("effect/Schema").tag<"input_file">;
126
- readonly filename: import("effect/Schema").String;
127
- readonly file_data: import("effect/Schema").String;
128
- readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
129
- }>]>>]>;
130
- }, "Type"> | {
131
- readonly content: readonly import("effect/Schema").Struct.ReadonlySide<{
132
- readonly type: import("effect/Schema").tag<"output_text">;
133
- readonly text: import("effect/Schema").String;
134
- }, "Type">[];
112
+ } | {
113
+ readonly type: "function_call";
114
+ readonly call_id: string;
115
+ readonly name: string;
116
+ readonly arguments: string;
117
+ } | {
118
+ readonly type: "function_call_output";
119
+ readonly call_id: string;
120
+ readonly output: string | readonly ({
121
+ readonly type: "input_image";
122
+ readonly image_url: string;
123
+ } | {
124
+ readonly type: "input_file";
125
+ readonly filename: string;
126
+ readonly file_data: string;
127
+ readonly mime_type?: string | undefined;
128
+ } | {
129
+ readonly type: "input_text";
130
+ readonly text: string;
131
+ })[];
132
+ } | {
133
+ readonly content: readonly {
134
+ readonly type: "output_text";
135
+ readonly text: string;
136
+ }[];
135
137
  readonly role: "assistant";
136
138
  readonly phase?: "commentary" | "final_answer" | null | undefined;
137
139
  })[];
@@ -140,9 +142,10 @@ export declare const routes: (Route<{
140
142
  readonly text?: {
141
143
  readonly verbosity?: "low" | "medium" | "high" | undefined;
142
144
  } | undefined;
145
+ readonly instructions?: string | undefined;
143
146
  readonly reasoning?: {
144
- readonly effort?: string | undefined;
145
147
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
148
+ readonly effort?: string | undefined;
146
149
  } | undefined;
147
150
  readonly tools?: readonly ({
148
151
  readonly type: "function";
@@ -154,25 +157,24 @@ export declare const routes: (Route<{
154
157
  readonly strict?: boolean | undefined;
155
158
  } | {
156
159
  readonly type: "image_generation";
157
- readonly output_format?: "png" | "jpeg" | "webp" | undefined;
158
160
  readonly size?: string | undefined;
161
+ readonly action?: "generate" | "auto" | "edit" | undefined;
162
+ readonly output_format?: "png" | "jpeg" | "webp" | undefined;
159
163
  readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
160
164
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
161
165
  readonly output_compression?: number | undefined;
162
- readonly action?: "generate" | "auto" | "edit" | undefined;
163
166
  readonly input_fidelity?: "low" | "high" | undefined;
164
167
  readonly partial_images?: number | undefined;
165
168
  })[] | undefined;
166
169
  readonly temperature?: number | undefined;
167
- readonly tool_choice?: "required" | "none" | "auto" | import("effect/Schema").Struct.ReadonlySide<{
168
- readonly type: import("effect/Schema").tag<"function">;
169
- readonly name: import("effect/Schema").String;
170
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
171
- readonly type: import("effect/Schema").tag<"image_generation">;
172
- }, "Type"> | undefined;
170
+ readonly tool_choice?: "required" | "none" | "auto" | {
171
+ readonly type: "function";
172
+ readonly name: string;
173
+ } | {
174
+ readonly type: "image_generation";
175
+ } | undefined;
173
176
  readonly top_p?: number | undefined;
174
177
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
175
- readonly instructions?: string | undefined;
176
178
  readonly store?: boolean | undefined;
177
179
  readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
178
180
  readonly prompt_cache_key?: string | undefined;
@@ -180,64 +182,64 @@ export declare const routes: (Route<{
180
182
  }, import("../route/transport/http").HttpPrepared<string>> | Route<{
181
183
  readonly input: readonly ({
182
184
  readonly type: "reasoning";
183
- readonly summary: readonly import("effect/Schema").Struct.ReadonlySide<{
184
- readonly type: import("effect/Schema").tag<"summary_text">;
185
- readonly text: import("effect/Schema").String;
186
- }, "Type">[];
185
+ readonly summary: readonly {
186
+ readonly type: "summary_text";
187
+ readonly text: string;
188
+ }[];
187
189
  readonly id?: string | undefined;
188
190
  readonly encrypted_content?: string | null | undefined;
189
- } | import("effect/Schema").Struct.ReadonlySide<{
190
- readonly type: import("effect/Schema").tag<"item_reference">;
191
- readonly id: import("effect/Schema").String;
192
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
193
- readonly role: import("effect/Schema").tag<"system">;
194
- readonly content: import("effect/Schema").String;
195
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
196
- readonly role: import("effect/Schema").tag<"user">;
197
- readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
198
- readonly type: import("effect/Schema").tag<"input_text">;
199
- readonly text: import("effect/Schema").String;
200
- }>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
201
- readonly type: import("effect/Schema").tag<"input_image">;
202
- readonly image_url: import("effect/Schema").String;
203
- }>, import("effect/Schema").Struct<{
204
- readonly type: import("effect/Schema").tag<"input_file">;
205
- readonly filename: import("effect/Schema").String;
206
- readonly file_data: import("effect/Schema").String;
207
- readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
208
- }>]>]>>;
209
- }, "Type"> | {
210
- readonly content: readonly import("effect/Schema").Struct.ReadonlySide<{
211
- readonly type: import("effect/Schema").tag<"output_text">;
212
- readonly text: import("effect/Schema").String;
213
- }, "Type">[];
191
+ } | {
192
+ readonly type: "item_reference";
193
+ readonly id: string;
194
+ } | {
195
+ readonly role: "system";
196
+ readonly content: string;
197
+ } | {
198
+ readonly role: "user";
199
+ readonly content: readonly ({
200
+ readonly type: "input_image";
201
+ readonly image_url: string;
202
+ } | {
203
+ readonly type: "input_file";
204
+ readonly filename: string;
205
+ readonly file_data: string;
206
+ readonly mime_type?: string | undefined;
207
+ } | {
208
+ readonly type: "input_text";
209
+ readonly text: string;
210
+ })[];
211
+ } | {
212
+ readonly content: readonly {
213
+ readonly type: "output_text";
214
+ readonly text: string;
215
+ }[];
214
216
  readonly role: "assistant";
215
217
  readonly phase?: "commentary" | "final_answer" | undefined;
216
- } | import("effect/Schema").Struct.ReadonlySide<{
217
- readonly type: import("effect/Schema").tag<"function_call">;
218
- readonly call_id: import("effect/Schema").String;
219
- readonly name: import("effect/Schema").String;
220
- readonly arguments: import("effect/Schema").String;
221
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
222
- readonly type: import("effect/Schema").tag<"function_call_output">;
223
- readonly call_id: import("effect/Schema").String;
224
- readonly output: import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
225
- readonly type: import("effect/Schema").tag<"input_text">;
226
- readonly text: import("effect/Schema").String;
227
- }>, import("effect/Schema").Struct<{
228
- readonly type: import("effect/Schema").tag<"input_image">;
229
- readonly image_url: import("effect/Schema").String;
230
- }>, import("effect/Schema").Struct<{
231
- readonly type: import("effect/Schema").tag<"input_file">;
232
- readonly filename: import("effect/Schema").String;
233
- readonly file_data: import("effect/Schema").String;
234
- readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
235
- }>]>>]>;
236
- }, "Type"> | {
237
- readonly content: readonly import("effect/Schema").Struct.ReadonlySide<{
238
- readonly type: import("effect/Schema").tag<"output_text">;
239
- readonly text: import("effect/Schema").String;
240
- }, "Type">[];
218
+ } | {
219
+ readonly type: "function_call";
220
+ readonly call_id: string;
221
+ readonly name: string;
222
+ readonly arguments: string;
223
+ } | {
224
+ readonly type: "function_call_output";
225
+ readonly call_id: string;
226
+ readonly output: string | readonly ({
227
+ readonly type: "input_image";
228
+ readonly image_url: string;
229
+ } | {
230
+ readonly type: "input_file";
231
+ readonly filename: string;
232
+ readonly file_data: string;
233
+ readonly mime_type?: string | undefined;
234
+ } | {
235
+ readonly type: "input_text";
236
+ readonly text: string;
237
+ })[];
238
+ } | {
239
+ readonly content: readonly {
240
+ readonly type: "output_text";
241
+ readonly text: string;
242
+ }[];
241
243
  readonly role: "assistant";
242
244
  readonly phase?: "commentary" | "final_answer" | null | undefined;
243
245
  })[];
@@ -246,9 +248,10 @@ export declare const routes: (Route<{
246
248
  readonly text?: {
247
249
  readonly verbosity?: "low" | "medium" | "high" | undefined;
248
250
  } | undefined;
251
+ readonly instructions?: string | undefined;
249
252
  readonly reasoning?: {
250
- readonly effort?: string | undefined;
251
253
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
254
+ readonly effort?: string | undefined;
252
255
  } | undefined;
253
256
  readonly tools?: readonly ({
254
257
  readonly type: "function";
@@ -260,25 +263,24 @@ export declare const routes: (Route<{
260
263
  readonly strict?: boolean | undefined;
261
264
  } | {
262
265
  readonly type: "image_generation";
263
- readonly output_format?: "png" | "jpeg" | "webp" | undefined;
264
266
  readonly size?: string | undefined;
267
+ readonly action?: "generate" | "auto" | "edit" | undefined;
268
+ readonly output_format?: "png" | "jpeg" | "webp" | undefined;
265
269
  readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
266
270
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
267
271
  readonly output_compression?: number | undefined;
268
- readonly action?: "generate" | "auto" | "edit" | undefined;
269
272
  readonly input_fidelity?: "low" | "high" | undefined;
270
273
  readonly partial_images?: number | undefined;
271
274
  })[] | undefined;
272
275
  readonly temperature?: number | undefined;
273
- readonly tool_choice?: "required" | "none" | "auto" | import("effect/Schema").Struct.ReadonlySide<{
274
- readonly type: import("effect/Schema").tag<"function">;
275
- readonly name: import("effect/Schema").String;
276
- }, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
277
- readonly type: import("effect/Schema").tag<"image_generation">;
278
- }, "Type"> | undefined;
276
+ readonly tool_choice?: "required" | "none" | "auto" | {
277
+ readonly type: "function";
278
+ readonly name: string;
279
+ } | {
280
+ readonly type: "image_generation";
281
+ } | undefined;
279
282
  readonly top_p?: number | undefined;
280
283
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
281
- readonly instructions?: string | undefined;
282
284
  readonly store?: boolean | undefined;
283
285
  readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
284
286
  readonly prompt_cache_key?: string | undefined;