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

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
@@ -84,45 +84,47 @@ export type GeminiBody = Schema.Schema.Type<typeof GeminiBody>;
84
84
  * registered) Vertex Gemini.
85
85
  */
86
86
  export declare const protocol: Protocol<{
87
- readonly contents: readonly Schema.Struct.ReadonlySide<{
88
- readonly role: Schema.Literals<readonly ["user", "model"]>;
89
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
90
- readonly text: Schema.String;
91
- readonly thought: Schema.optional<Schema.Boolean>;
92
- readonly thoughtSignature: Schema.optional<Schema.String>;
93
- }>, Schema.Struct<{
94
- readonly inlineData: Schema.Struct<{
95
- readonly mimeType: Schema.String;
96
- readonly data: Schema.String;
97
- }>;
98
- }>, Schema.Struct<{
99
- readonly functionCall: Schema.Struct<{
100
- readonly id: Schema.optional<Schema.String>;
101
- readonly name: Schema.String;
102
- readonly args: Schema.Unknown;
103
- }>;
104
- readonly thoughtSignature: Schema.optional<Schema.String>;
105
- }>, Schema.Struct<{
106
- readonly functionResponse: Schema.Struct<{
107
- readonly id: Schema.optional<Schema.String>;
108
- readonly name: Schema.String;
109
- readonly response: Schema.Unknown;
110
- readonly parts: Schema.optional<Schema.$Array<Schema.Struct<{
111
- readonly inlineData: Schema.Struct<{
112
- readonly mimeType: Schema.String;
113
- readonly data: Schema.String;
114
- }>;
115
- }>>>;
116
- }>;
117
- }>]>>;
118
- }, "Type">[];
119
- readonly tools?: readonly Schema.Struct.ReadonlySide<{
120
- readonly functionDeclarations: Schema.$Array<Schema.Struct<{
121
- readonly name: Schema.String;
122
- readonly description: Schema.String;
123
- readonly parameters: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
124
- }>>;
125
- }, "Type">[] | undefined;
87
+ readonly contents: readonly {
88
+ readonly role: "user" | "model";
89
+ readonly parts: readonly ({
90
+ readonly inlineData: {
91
+ readonly mimeType: string;
92
+ readonly data: string;
93
+ };
94
+ } | {
95
+ readonly text: string;
96
+ readonly thought?: boolean | undefined;
97
+ readonly thoughtSignature?: string | undefined;
98
+ } | {
99
+ readonly functionCall: {
100
+ readonly name: string;
101
+ readonly args: unknown;
102
+ readonly id?: string | undefined;
103
+ };
104
+ readonly thoughtSignature?: string | undefined;
105
+ } | {
106
+ readonly functionResponse: {
107
+ readonly name: string;
108
+ readonly response: unknown;
109
+ readonly id?: string | undefined;
110
+ readonly parts?: readonly {
111
+ readonly inlineData: {
112
+ readonly mimeType: string;
113
+ readonly data: string;
114
+ };
115
+ }[] | undefined;
116
+ };
117
+ })[];
118
+ }[];
119
+ readonly tools?: readonly {
120
+ readonly functionDeclarations: readonly {
121
+ readonly name: string;
122
+ readonly description: string;
123
+ readonly parameters?: {
124
+ readonly [x: string]: unknown;
125
+ } | undefined;
126
+ }[];
127
+ }[] | undefined;
126
128
  readonly generationConfig?: {
127
129
  readonly temperature?: number | undefined;
128
130
  readonly topP?: number | undefined;
@@ -134,51 +136,51 @@ export declare const protocol: Protocol<{
134
136
  } | undefined;
135
137
  readonly maxOutputTokens?: number | undefined;
136
138
  } | undefined;
137
- readonly systemInstruction?: Schema.Struct.ReadonlySide<{
138
- readonly parts: Schema.$Array<Schema.Struct<{
139
- readonly text: Schema.String;
140
- }>>;
141
- }, "Type"> | undefined;
142
- readonly toolConfig?: Schema.Struct.ReadonlySide<{
143
- readonly functionCallingConfig: Schema.Struct<{
144
- readonly mode: Schema.Literals<readonly ["AUTO", "NONE", "ANY"]>;
145
- readonly allowedFunctionNames: Schema.optional<Schema.$Array<Schema.String>>;
146
- }>;
147
- }, "Type"> | undefined;
139
+ readonly systemInstruction?: {
140
+ readonly parts: readonly {
141
+ readonly text: string;
142
+ }[];
143
+ } | undefined;
144
+ readonly toolConfig?: {
145
+ readonly functionCallingConfig: {
146
+ readonly mode: "AUTO" | "NONE" | "ANY";
147
+ readonly allowedFunctionNames?: readonly string[] | undefined;
148
+ };
149
+ } | undefined;
148
150
  }, string, {
149
151
  readonly candidates?: readonly {
150
- readonly content?: Schema.Struct.ReadonlySide<{
151
- readonly role: Schema.Literals<readonly ["user", "model"]>;
152
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
153
- readonly text: Schema.String;
154
- readonly thought: Schema.optional<Schema.Boolean>;
155
- readonly thoughtSignature: Schema.optional<Schema.String>;
156
- }>, Schema.Struct<{
157
- readonly inlineData: Schema.Struct<{
158
- readonly mimeType: Schema.String;
159
- readonly data: Schema.String;
160
- }>;
161
- }>, Schema.Struct<{
162
- readonly functionCall: Schema.Struct<{
163
- readonly id: Schema.optional<Schema.String>;
164
- readonly name: Schema.String;
165
- readonly args: Schema.Unknown;
166
- }>;
167
- readonly thoughtSignature: Schema.optional<Schema.String>;
168
- }>, Schema.Struct<{
169
- readonly functionResponse: Schema.Struct<{
170
- readonly id: Schema.optional<Schema.String>;
171
- readonly name: Schema.String;
172
- readonly response: Schema.Unknown;
173
- readonly parts: Schema.optional<Schema.$Array<Schema.Struct<{
174
- readonly inlineData: Schema.Struct<{
175
- readonly mimeType: Schema.String;
176
- readonly data: Schema.String;
177
- }>;
178
- }>>>;
179
- }>;
180
- }>]>>;
181
- }, "Type"> | undefined;
152
+ readonly content?: {
153
+ readonly role: "user" | "model";
154
+ readonly parts: readonly ({
155
+ readonly inlineData: {
156
+ readonly mimeType: string;
157
+ readonly data: string;
158
+ };
159
+ } | {
160
+ readonly text: string;
161
+ readonly thought?: boolean | undefined;
162
+ readonly thoughtSignature?: string | undefined;
163
+ } | {
164
+ readonly functionCall: {
165
+ readonly name: string;
166
+ readonly args: unknown;
167
+ readonly id?: string | undefined;
168
+ };
169
+ readonly thoughtSignature?: string | undefined;
170
+ } | {
171
+ readonly functionResponse: {
172
+ readonly name: string;
173
+ readonly response: unknown;
174
+ readonly id?: string | undefined;
175
+ readonly parts?: readonly {
176
+ readonly inlineData: {
177
+ readonly mimeType: string;
178
+ readonly data: string;
179
+ };
180
+ }[] | undefined;
181
+ };
182
+ })[];
183
+ } | undefined;
182
184
  readonly finishReason?: string | undefined;
183
185
  }[] | undefined;
184
186
  readonly usageMetadata?: {
@@ -194,45 +196,47 @@ export declare const protocol: Protocol<{
194
196
  lifecycle: Lifecycle.State;
195
197
  }>;
196
198
  export declare const route: Route<{
197
- readonly contents: readonly Schema.Struct.ReadonlySide<{
198
- readonly role: Schema.Literals<readonly ["user", "model"]>;
199
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
200
- readonly text: Schema.String;
201
- readonly thought: Schema.optional<Schema.Boolean>;
202
- readonly thoughtSignature: Schema.optional<Schema.String>;
203
- }>, Schema.Struct<{
204
- readonly inlineData: Schema.Struct<{
205
- readonly mimeType: Schema.String;
206
- readonly data: Schema.String;
207
- }>;
208
- }>, Schema.Struct<{
209
- readonly functionCall: Schema.Struct<{
210
- readonly id: Schema.optional<Schema.String>;
211
- readonly name: Schema.String;
212
- readonly args: Schema.Unknown;
213
- }>;
214
- readonly thoughtSignature: Schema.optional<Schema.String>;
215
- }>, Schema.Struct<{
216
- readonly functionResponse: Schema.Struct<{
217
- readonly id: Schema.optional<Schema.String>;
218
- readonly name: Schema.String;
219
- readonly response: Schema.Unknown;
220
- readonly parts: Schema.optional<Schema.$Array<Schema.Struct<{
221
- readonly inlineData: Schema.Struct<{
222
- readonly mimeType: Schema.String;
223
- readonly data: Schema.String;
224
- }>;
225
- }>>>;
226
- }>;
227
- }>]>>;
228
- }, "Type">[];
229
- readonly tools?: readonly Schema.Struct.ReadonlySide<{
230
- readonly functionDeclarations: Schema.$Array<Schema.Struct<{
231
- readonly name: Schema.String;
232
- readonly description: Schema.String;
233
- readonly parameters: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
234
- }>>;
235
- }, "Type">[] | undefined;
199
+ readonly contents: readonly {
200
+ readonly role: "user" | "model";
201
+ readonly parts: readonly ({
202
+ readonly inlineData: {
203
+ readonly mimeType: string;
204
+ readonly data: string;
205
+ };
206
+ } | {
207
+ readonly text: string;
208
+ readonly thought?: boolean | undefined;
209
+ readonly thoughtSignature?: string | undefined;
210
+ } | {
211
+ readonly functionCall: {
212
+ readonly name: string;
213
+ readonly args: unknown;
214
+ readonly id?: string | undefined;
215
+ };
216
+ readonly thoughtSignature?: string | undefined;
217
+ } | {
218
+ readonly functionResponse: {
219
+ readonly name: string;
220
+ readonly response: unknown;
221
+ readonly id?: string | undefined;
222
+ readonly parts?: readonly {
223
+ readonly inlineData: {
224
+ readonly mimeType: string;
225
+ readonly data: string;
226
+ };
227
+ }[] | undefined;
228
+ };
229
+ })[];
230
+ }[];
231
+ readonly tools?: readonly {
232
+ readonly functionDeclarations: readonly {
233
+ readonly name: string;
234
+ readonly description: string;
235
+ readonly parameters?: {
236
+ readonly [x: string]: unknown;
237
+ } | undefined;
238
+ }[];
239
+ }[] | undefined;
236
240
  readonly generationConfig?: {
237
241
  readonly temperature?: number | undefined;
238
242
  readonly topP?: number | undefined;
@@ -244,16 +248,16 @@ export declare const route: Route<{
244
248
  } | undefined;
245
249
  readonly maxOutputTokens?: number | undefined;
246
250
  } | undefined;
247
- readonly systemInstruction?: Schema.Struct.ReadonlySide<{
248
- readonly parts: Schema.$Array<Schema.Struct<{
249
- readonly text: Schema.String;
250
- }>>;
251
- }, "Type"> | undefined;
252
- readonly toolConfig?: Schema.Struct.ReadonlySide<{
253
- readonly functionCallingConfig: Schema.Struct<{
254
- readonly mode: Schema.Literals<readonly ["AUTO", "NONE", "ANY"]>;
255
- readonly allowedFunctionNames: Schema.optional<Schema.$Array<Schema.String>>;
256
- }>;
257
- }, "Type"> | undefined;
251
+ readonly systemInstruction?: {
252
+ readonly parts: readonly {
253
+ readonly text: string;
254
+ }[];
255
+ } | undefined;
256
+ readonly toolConfig?: {
257
+ readonly functionCallingConfig: {
258
+ readonly mode: "AUTO" | "NONE" | "ANY";
259
+ readonly allowedFunctionNames?: readonly string[] | undefined;
260
+ };
261
+ } | undefined;
258
262
  }, import("../route/transport/http").HttpPrepared<string>>;
259
263
  export * as Gemini from "./gemini";
@@ -1,4 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
+ import { Tool } from "@opencode-ai/schema/tool";
2
3
  import { Route } from "../route/client";
3
4
  import { Auth } from "../route/auth";
4
5
  import { Endpoint } from "../route/endpoint";