@opencode/ai 2.0.32 → 2.1.0

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 (149) hide show
  1. package/dist/ai-client.d.ts +2 -2
  2. package/dist/experimental/evaluation-client.d.ts +1 -1
  3. package/dist/experimental/evaluation.d.ts +20 -20
  4. package/dist/experimental/realtime.d.ts +6 -14
  5. package/dist/experimental/realtime.js +28 -3
  6. package/dist/experimental/system-one.d.ts +1 -1
  7. package/dist/image-client.d.ts +8 -8
  8. package/dist/image.d.ts +593 -437
  9. package/dist/llm.d.ts +51 -51
  10. package/dist/media-client.d.ts +1 -1
  11. package/dist/media.d.ts +4 -4
  12. package/dist/promise.d.ts +199 -198
  13. package/dist/protocols/alibaba-chat.d.ts +81 -82
  14. package/dist/protocols/alibaba-chat.js +0 -1
  15. package/dist/protocols/alibaba-messages.d.ts +99 -99
  16. package/dist/protocols/alibaba-responses.d.ts +120 -120
  17. package/dist/protocols/anthropic-messages.d.ts +187 -187
  18. package/dist/protocols/anthropic-messages.js +3 -2
  19. package/dist/protocols/assemblyai-transcription.d.ts +1 -1
  20. package/dist/protocols/bedrock-converse.d.ts +75 -79
  21. package/dist/protocols/bfl-images.d.ts +1 -1
  22. package/dist/protocols/cartesia-speech.d.ts +17 -17
  23. package/dist/protocols/cohere-chat.d.ts +26 -23
  24. package/dist/protocols/cohere-chat.js +22 -1
  25. package/dist/protocols/deepgram-speech.d.ts +17 -17
  26. package/dist/protocols/deepgram-transcription.d.ts +1 -1
  27. package/dist/protocols/elevenlabs-speech.d.ts +17 -17
  28. package/dist/protocols/elevenlabs-transcription.d.ts +1 -1
  29. package/dist/protocols/fal-images.d.ts +1 -1
  30. package/dist/protocols/fal-video.d.ts +1 -1
  31. package/dist/protocols/gemini.d.ts +55 -55
  32. package/dist/protocols/google-images.d.ts +1 -1
  33. package/dist/protocols/google-interactions.d.ts +64 -62
  34. package/dist/protocols/google-interactions.js +19 -1
  35. package/dist/protocols/google-speech.d.ts +17 -17
  36. package/dist/protocols/google-transcription.d.ts +47 -47
  37. package/dist/protocols/google-video.d.ts +1 -1
  38. package/dist/protocols/meta-messages.d.ts +121 -121
  39. package/dist/protocols/meta-responses.d.ts +201 -201
  40. package/dist/protocols/mistral-chat.d.ts +45 -45
  41. package/dist/protocols/open-responses-channel.d.ts +1 -1
  42. package/dist/protocols/open-responses.d.ts +584 -450
  43. package/dist/protocols/open-responses.js +27 -35
  44. package/dist/protocols/openai-chat.d.ts +248 -248
  45. package/dist/protocols/openai-chat.js +11 -42
  46. package/dist/protocols/openai-compatible-chat.d.ts +32 -32
  47. package/dist/protocols/openai-compatible-responses.d.ts +88 -88
  48. package/dist/protocols/openai-images.d.ts +17 -17
  49. package/dist/protocols/openai-responses.d.ts +567 -567
  50. package/dist/protocols/openai-responses.js +1 -1
  51. package/dist/protocols/openai-speech.d.ts +17 -17
  52. package/dist/protocols/openai-transcription.d.ts +47 -47
  53. package/dist/protocols/replicate-images.d.ts +1 -1
  54. package/dist/protocols/runway-video.d.ts +1 -1
  55. package/dist/protocols/shared.d.ts +12 -1
  56. package/dist/protocols/shared.js +17 -1
  57. package/dist/protocols/stability-images.d.ts +2 -2
  58. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  59. package/dist/protocols/utils/bedrock-media.d.ts +4 -4
  60. package/dist/protocols/utils/openai-options.d.ts +1 -1
  61. package/dist/protocols/utils/speech-stream.d.ts +1 -1
  62. package/dist/protocols/utils/tool-schema.d.ts +10 -5
  63. package/dist/protocols/utils/tool-stream.d.ts +152 -152
  64. package/dist/protocols/venice-chat.d.ts +109 -110
  65. package/dist/protocols/venice-chat.js +0 -1
  66. package/dist/protocols/xai-images.d.ts +1 -1
  67. package/dist/protocols/xai-responses.d.ts +79 -79
  68. package/dist/protocols/xai-video.d.ts +1 -1
  69. package/dist/protocols/zai-chat.d.ts +77 -78
  70. package/dist/protocols/zai-chat.js +0 -1
  71. package/dist/protocols/zai-images.d.ts +1 -1
  72. package/dist/protocols/zai-messages.d.ts +97 -97
  73. package/dist/providers/alibaba.d.ts +222 -283
  74. package/dist/providers/amazon-bedrock-mantle.d.ts +291 -298
  75. package/dist/providers/amazon-bedrock.d.ts +22 -28
  76. package/dist/providers/anthropic-compatible.d.ts +86 -90
  77. package/dist/providers/anthropic.d.ts +86 -90
  78. package/dist/providers/assemblyai.d.ts +2 -6
  79. package/dist/providers/azure.d.ts +228 -238
  80. package/dist/providers/baseten.d.ts +66 -70
  81. package/dist/providers/black-forest-labs.d.ts +2 -6
  82. package/dist/providers/cartesia.d.ts +2 -6
  83. package/dist/providers/cerebras.d.ts +66 -70
  84. package/dist/providers/cerebras.js +0 -1
  85. package/dist/providers/cloudflare-ai-gateway.d.ts +352 -356
  86. package/dist/providers/cloudflare-workers-ai.d.ts +66 -70
  87. package/dist/providers/cohere.d.ts +122 -132
  88. package/dist/providers/cohere.js +0 -2
  89. package/dist/providers/deepgram.d.ts +2 -7
  90. package/dist/providers/deepinfra.d.ts +66 -70
  91. package/dist/providers/deepinfra.js +0 -1
  92. package/dist/providers/deepseek.d.ts +66 -70
  93. package/dist/providers/deepseek.js +1 -1
  94. package/dist/providers/digitalocean.d.ts +137 -141
  95. package/dist/providers/elevenlabs.d.ts +2 -7
  96. package/dist/providers/fal.d.ts +2 -7
  97. package/dist/providers/fireworks.d.ts +66 -70
  98. package/dist/providers/google-vertex-chat.d.ts +34 -38
  99. package/dist/providers/google-vertex-interactions.d.ts +31 -41
  100. package/dist/providers/google-vertex-messages.d.ts +81 -85
  101. package/dist/providers/google-vertex-mistral.d.ts +23 -27
  102. package/dist/providers/google-vertex-responses.d.ts +90 -94
  103. package/dist/providers/google-vertex.d.ts +26 -30
  104. package/dist/providers/google.d.ts +94 -109
  105. package/dist/providers/groq.d.ts +111 -115
  106. package/dist/providers/groq.js +0 -1
  107. package/dist/providers/meta.d.ts +309 -317
  108. package/dist/providers/meta.js +1 -1
  109. package/dist/providers/minimax.d.ts +296 -303
  110. package/dist/providers/minimax.js +1 -1
  111. package/dist/providers/mistral.d.ts +22 -26
  112. package/dist/providers/moonshot.d.ts +296 -303
  113. package/dist/providers/moonshot.js +0 -1
  114. package/dist/providers/openai-compatible-responses.d.ts +90 -94
  115. package/dist/providers/openai-compatible.d.ts +34 -38
  116. package/dist/providers/openai.d.ts +93 -108
  117. package/dist/providers/opencode.d.ts +2 -8
  118. package/dist/providers/openrouter.d.ts +137 -144
  119. package/dist/providers/replicate.d.ts +2 -6
  120. package/dist/providers/runway.d.ts +2 -6
  121. package/dist/providers/stability.d.ts +2 -7
  122. package/dist/providers/togetherai.d.ts +66 -70
  123. package/dist/providers/togetherai.js +1 -1
  124. package/dist/providers/typesafe-ai.d.ts +2 -8
  125. package/dist/providers/venice.d.ts +58 -63
  126. package/dist/providers/vercel-ai-gateway.d.ts +2 -12
  127. package/dist/providers/xai.d.ts +38 -50
  128. package/dist/providers/zai-coding-plan.d.ts +206 -213
  129. package/dist/providers/zai.d.ts +40 -46
  130. package/dist/route/client.d.ts +51 -51
  131. package/dist/route/media-protocol.d.ts +1 -1
  132. package/dist/route/transport/http.d.ts +1 -1
  133. package/dist/route/transport/websocket.d.ts +8 -8
  134. package/dist/schema/errors.d.ts +19 -19
  135. package/dist/schema/events.d.ts +3090 -3288
  136. package/dist/schema/messages.d.ts +8 -7
  137. package/dist/schema/options.d.ts +2 -1
  138. package/dist/schema/options.js +2 -1
  139. package/dist/speech-client.d.ts +8 -8
  140. package/dist/speech.d.ts +434 -398
  141. package/dist/testing.d.ts +338 -338
  142. package/dist/tool-runtime.d.ts +1 -1
  143. package/dist/transcription-client.d.ts +23 -23
  144. package/dist/transcription.d.ts +562 -646
  145. package/dist/utils/sanitize.d.ts +4 -0
  146. package/dist/utils/sanitize.js +23 -6
  147. package/dist/video-client.d.ts +8 -8
  148. package/dist/video.d.ts +416 -372
  149. package/package.json +6 -6
@@ -11,64 +11,16 @@ declare const Options: Schema.Struct<{
11
11
  }>;
12
12
  export type OptionsInput = typeof Options.Type;
13
13
  export declare const protocol: Protocol<{
14
+ readonly model: string;
14
15
  readonly input: readonly ({
15
- readonly [x: string]: unknown;
16
- readonly id: string;
17
- readonly type: "web_search_call";
18
- readonly status?: string | undefined;
19
- readonly action?: {
20
- readonly [x: string]: unknown;
21
- } | null | undefined;
22
- } | {
23
- readonly [x: string]: unknown;
24
- readonly id: string;
25
- readonly type: "file_search_call";
26
- readonly status?: string | undefined;
27
- readonly queries?: readonly string[] | undefined;
28
- readonly results?: readonly {
29
- readonly [x: string]: unknown;
30
- }[] | null | undefined;
31
- } | {
32
- readonly [x: string]: unknown;
33
- readonly id: string;
34
- readonly type: "code_interpreter_call";
35
- readonly status?: string | undefined;
36
- readonly code?: string | null | undefined;
37
- readonly container_id?: string | null | undefined;
38
- readonly outputs?: readonly {
39
- readonly [x: string]: unknown;
40
- }[] | null | undefined;
41
- } | {
42
- readonly [x: string]: unknown;
43
- readonly id: string;
44
- readonly type: "mcp_call";
45
- readonly status?: string | undefined;
46
- readonly name?: string | undefined;
47
- readonly output?: string | null | undefined;
48
- readonly error?: unknown;
49
- readonly arguments?: string | undefined;
50
- readonly server_label?: string | undefined;
16
+ readonly type: "compaction";
17
+ readonly id?: string | null | undefined;
18
+ readonly encrypted_content: string;
51
19
  } | {
52
20
  readonly type: "configuration_update";
53
21
  readonly reasoning: {
54
22
  readonly effort: OpenResponsesOptions.ReasoningEffort;
55
23
  };
56
- } | {
57
- readonly [x: string]: unknown;
58
- readonly type: string;
59
- readonly id: string;
60
- } | {
61
- readonly type: "reasoning";
62
- readonly summary: readonly {
63
- readonly type: "summary_text";
64
- readonly text: string;
65
- }[];
66
- readonly id?: string | undefined;
67
- readonly encrypted_content?: string | null | undefined;
68
- } | {
69
- readonly type: "compaction";
70
- readonly encrypted_content: string;
71
- readonly id?: string | null | undefined;
72
24
  } | {
73
25
  readonly type: "message";
74
26
  readonly role: "system";
@@ -79,6 +31,7 @@ export declare const protocol: Protocol<{
79
31
  readonly content: string;
80
32
  } | {
81
33
  readonly type: "message";
34
+ readonly role: "user";
82
35
  readonly content: readonly ({
83
36
  readonly type: "input_image";
84
37
  readonly image_url: string;
@@ -93,26 +46,33 @@ export declare const protocol: Protocol<{
93
46
  readonly type: "input_text";
94
47
  readonly text: string;
95
48
  })[];
96
- readonly role: "user";
97
49
  readonly id?: string | undefined;
98
50
  readonly status?: string | undefined;
99
51
  } | {
100
52
  readonly type: "message";
53
+ readonly id?: string | undefined;
54
+ readonly role: "assistant";
101
55
  readonly content: readonly {
102
56
  readonly type: "output_text";
103
57
  readonly text: string;
104
58
  }[];
105
- readonly role: "assistant";
106
- readonly id?: string | undefined;
107
- readonly status?: string | undefined;
108
59
  readonly phase?: "commentary" | "final_answer" | null | undefined;
60
+ readonly status?: string | undefined;
61
+ } | {
62
+ readonly type: "reasoning";
63
+ readonly id?: string | undefined;
64
+ readonly summary: readonly {
65
+ readonly type: "summary_text";
66
+ readonly text: string;
67
+ }[];
68
+ readonly encrypted_content?: string | null | undefined;
109
69
  } | {
110
70
  readonly type: "function_call";
111
- readonly name: string;
112
- readonly arguments: string;
113
- readonly call_id: string;
114
71
  readonly id?: string | undefined;
72
+ readonly call_id: string;
73
+ readonly name: string;
115
74
  readonly namespace?: string | undefined;
75
+ readonly arguments: string;
116
76
  } | {
117
77
  readonly type: "function_call_output";
118
78
  readonly call_id: string;
@@ -133,120 +93,160 @@ export declare const protocol: Protocol<{
133
93
  readonly type: "input_video";
134
94
  readonly video_url: string;
135
95
  })[];
96
+ } | {
97
+ readonly [x: string]: unknown;
98
+ readonly type: "web_search_call";
99
+ readonly id: string;
100
+ readonly status?: string | undefined;
101
+ readonly action?: {
102
+ readonly [x: string]: unknown;
103
+ } | null | undefined;
104
+ } | {
105
+ readonly [x: string]: unknown;
106
+ readonly type: "file_search_call";
107
+ readonly id: string;
108
+ readonly status?: string | undefined;
109
+ readonly queries?: readonly string[] | undefined;
110
+ readonly results?: readonly {
111
+ readonly [x: string]: unknown;
112
+ }[] | null | undefined;
113
+ } | {
114
+ readonly [x: string]: unknown;
115
+ readonly type: "code_interpreter_call";
116
+ readonly id: string;
117
+ readonly status?: string | undefined;
118
+ readonly code?: string | null | undefined;
119
+ readonly container_id?: string | null | undefined;
120
+ readonly outputs?: readonly {
121
+ readonly [x: string]: unknown;
122
+ }[] | null | undefined;
123
+ } | {
124
+ readonly [x: string]: unknown;
125
+ readonly type: "mcp_call";
126
+ readonly id: string;
127
+ readonly status?: string | undefined;
128
+ readonly server_label?: string | undefined;
129
+ readonly name?: string | undefined;
130
+ readonly arguments?: string | undefined;
131
+ readonly output?: string | null | undefined;
132
+ readonly error?: unknown;
133
+ } | {
134
+ readonly [x: string]: unknown;
135
+ readonly type: string;
136
+ readonly id: string;
136
137
  })[];
137
- readonly model: string;
138
- readonly stream: true;
139
- readonly metadata?: {
140
- readonly [x: string]: string;
141
- } | undefined;
142
138
  readonly instructions?: string | undefined;
143
- readonly reasoning?: {
144
- readonly summary?: "auto" | "concise" | "detailed" | undefined;
145
- readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
146
- } | undefined;
147
- readonly temperature?: number | undefined;
148
139
  readonly tools?: readonly ({
149
- readonly [x: string]: unknown;
150
- readonly type: string;
151
- } | {
152
140
  readonly type: "function";
153
- readonly description: string;
154
141
  readonly name: string;
142
+ readonly description: string;
155
143
  readonly parameters: {
156
144
  readonly [x: string]: unknown;
157
145
  };
158
146
  readonly strict?: boolean | undefined;
147
+ } | {
148
+ readonly [x: string]: unknown;
149
+ readonly type: string;
159
150
  })[] | undefined;
160
- readonly text?: {
161
- readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
162
- } | undefined;
163
- readonly service_tier?: OpenResponsesOptions.ServiceTier | undefined;
164
- readonly tool_choice?: "required" | "auto" | "none" | {
151
+ readonly tool_choice?: "auto" | "none" | "required" | {
165
152
  readonly type: "function";
166
153
  readonly name: string;
167
154
  } | {
168
155
  readonly type: "allowed_tools";
169
- readonly mode: "required" | "auto" | "none";
156
+ readonly mode: "auto" | "none" | "required";
170
157
  readonly tools: readonly {
171
158
  readonly type: "function";
172
159
  readonly name: string;
173
160
  }[];
174
161
  } | undefined;
175
- readonly top_p?: number | undefined;
176
- readonly frequency_penalty?: number | undefined;
177
- readonly presence_penalty?: number | undefined;
178
162
  readonly store?: boolean | undefined;
179
- readonly max_output_tokens?: number | undefined;
180
- readonly prompt_cache_key?: string | undefined;
181
- readonly parallel_tool_calls?: boolean | undefined;
182
- readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
183
- readonly truncation?: "auto" | "disabled" | undefined;
163
+ readonly metadata?: {
164
+ readonly [x: string]: string;
165
+ } | undefined;
166
+ readonly safety_identifier?: string | undefined;
184
167
  readonly stream_options?: {
185
168
  readonly include_obfuscation?: boolean | undefined;
186
169
  } | undefined;
187
- readonly safety_identifier?: string | undefined;
188
170
  readonly top_logprobs?: number | undefined;
171
+ readonly truncation?: "auto" | "disabled" | undefined;
172
+ readonly service_tier?: OpenResponsesOptions.ServiceTier | undefined;
173
+ readonly prompt_cache_key?: string | undefined;
174
+ readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
175
+ readonly reasoning?: {
176
+ readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
177
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
178
+ } | undefined;
179
+ readonly text?: {
180
+ readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
181
+ } | undefined;
182
+ readonly max_output_tokens?: number | undefined;
189
183
  readonly max_tool_calls?: number | undefined;
184
+ readonly parallel_tool_calls?: boolean | undefined;
185
+ readonly temperature?: number | undefined;
186
+ readonly top_p?: number | undefined;
187
+ readonly presence_penalty?: number | undefined;
188
+ readonly frequency_penalty?: number | undefined;
189
+ readonly enable_thinking?: boolean | undefined;
190
190
  readonly previous_response_id?: string | undefined;
191
191
  readonly conversation?: string | undefined;
192
- readonly enable_thinking?: boolean | undefined;
192
+ readonly stream: true;
193
193
  }, string, {
194
194
  readonly [x: string]: unknown;
195
195
  readonly type: string;
196
- readonly status?: unknown;
197
- readonly message?: unknown;
198
- readonly code?: unknown;
196
+ readonly delta?: string | undefined;
197
+ readonly arguments?: string | undefined;
199
198
  readonly text?: string | undefined;
200
- readonly error?: unknown;
199
+ readonly item_id?: string | undefined;
200
+ readonly output_index?: number | undefined;
201
+ readonly summary_index?: number | undefined;
202
+ readonly item?: {
203
+ readonly [x: string]: unknown;
204
+ readonly type: string;
205
+ readonly id?: string | undefined;
206
+ readonly call_id?: string | undefined;
207
+ readonly name?: string | undefined;
208
+ readonly namespace?: string | undefined;
209
+ readonly arguments?: string | undefined;
210
+ readonly encrypted_content?: string | null | undefined;
211
+ } | null | undefined;
201
212
  readonly response?: {
202
213
  readonly [x: string]: unknown;
203
214
  readonly id?: string | undefined;
215
+ readonly service_tier?: string | null | undefined;
216
+ readonly incomplete_details?: {
217
+ readonly reason?: string | undefined;
218
+ } | null | undefined;
204
219
  readonly output?: readonly {
205
220
  readonly [x: string]: unknown;
206
221
  readonly type: string;
207
222
  readonly id?: string | undefined;
223
+ readonly call_id?: string | undefined;
208
224
  readonly name?: string | undefined;
209
- readonly namespace?: string | null | undefined;
225
+ readonly namespace?: string | undefined;
210
226
  readonly arguments?: string | undefined;
211
- readonly call_id?: string | undefined;
212
227
  readonly encrypted_content?: string | null | undefined;
213
228
  }[] | undefined;
214
- readonly error?: unknown;
215
229
  readonly usage?: {
216
230
  readonly [x: string]: unknown;
217
231
  readonly input_tokens?: number | undefined;
232
+ readonly input_tokens_details?: {
233
+ readonly [x: string]: unknown;
234
+ readonly cached_tokens?: number | undefined;
235
+ readonly cache_write_tokens?: number | undefined;
236
+ } | null | undefined;
218
237
  readonly output_tokens?: number | undefined;
219
238
  readonly output_tokens_details?: {
220
239
  readonly [x: string]: unknown;
221
240
  readonly reasoning_tokens?: number | undefined;
222
241
  } | null | undefined;
223
242
  readonly total_tokens?: number | undefined;
224
- readonly input_tokens_details?: {
225
- readonly [x: string]: unknown;
226
- readonly cached_tokens?: number | undefined;
227
- readonly cache_write_tokens?: number | undefined;
228
- } | null | undefined;
229
- } | null | undefined;
230
- readonly service_tier?: string | null | undefined;
231
- readonly incomplete_details?: {
232
- readonly reason?: string | undefined;
233
243
  } | null | undefined;
244
+ readonly error?: unknown;
234
245
  } | undefined;
235
- readonly item?: {
236
- readonly [x: string]: unknown;
237
- readonly type: string;
238
- readonly id?: string | undefined;
239
- readonly name?: string | undefined;
240
- readonly namespace?: string | null | undefined;
241
- readonly arguments?: string | undefined;
242
- readonly call_id?: string | undefined;
243
- readonly encrypted_content?: string | null | undefined;
244
- } | null | undefined;
245
- readonly delta?: string | undefined;
246
- readonly arguments?: string | undefined;
247
- readonly item_id?: string | undefined;
248
- readonly output_index?: number | undefined;
249
- readonly summary_index?: number | undefined;
246
+ readonly code?: unknown;
247
+ readonly message?: unknown;
248
+ readonly error?: unknown;
249
+ readonly status?: unknown;
250
250
  readonly status_code?: unknown;
251
251
  }, OpenResponses.ParserState>;
252
252
  export * as AlibabaResponses from "./alibaba-responses.js";