@opencode-ai/ai 0.0.0-beta-17492

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 (194) hide show
  1. package/README.md +392 -0
  2. package/dist/cache-policy.d.ts +2 -0
  3. package/dist/cache-policy.js +121 -0
  4. package/dist/image-client.d.ts +19 -0
  5. package/dist/image-client.js +19 -0
  6. package/dist/image.d.ts +110 -0
  7. package/dist/image.js +102 -0
  8. package/dist/index.d.ts +18 -0
  9. package/dist/index.js +12 -0
  10. package/dist/llm.d.ts +230 -0
  11. package/dist/llm.js +77 -0
  12. package/dist/protocols/anthropic-messages.d.ts +633 -0
  13. package/dist/protocols/anthropic-messages.js +860 -0
  14. package/dist/protocols/bedrock-converse.d.ts +533 -0
  15. package/dist/protocols/bedrock-converse.js +584 -0
  16. package/dist/protocols/bedrock-event-stream.d.ts +9 -0
  17. package/dist/protocols/bedrock-event-stream.js +73 -0
  18. package/dist/protocols/gemini.d.ts +300 -0
  19. package/dist/protocols/gemini.js +512 -0
  20. package/dist/protocols/google-images.d.ts +30 -0
  21. package/dist/protocols/google-images.js +191 -0
  22. package/dist/protocols/index.d.ts +10 -0
  23. package/dist/protocols/index.js +10 -0
  24. package/dist/protocols/open-responses-channel.d.ts +26 -0
  25. package/dist/protocols/open-responses-channel.js +120 -0
  26. package/dist/protocols/open-responses.d.ts +951 -0
  27. package/dist/protocols/open-responses.js +873 -0
  28. package/dist/protocols/openai-chat.d.ts +795 -0
  29. package/dist/protocols/openai-chat.js +718 -0
  30. package/dist/protocols/openai-compatible-chat.d.ts +107 -0
  31. package/dist/protocols/openai-compatible-chat.js +20 -0
  32. package/dist/protocols/openai-compatible-responses.d.ts +96 -0
  33. package/dist/protocols/openai-compatible-responses.js +17 -0
  34. package/dist/protocols/openai-images.d.ts +32 -0
  35. package/dist/protocols/openai-images.js +188 -0
  36. package/dist/protocols/openai-responses-channel.d.ts +12 -0
  37. package/dist/protocols/openai-responses-channel.js +142 -0
  38. package/dist/protocols/openai-responses.d.ts +596 -0
  39. package/dist/protocols/openai-responses.js +208 -0
  40. package/dist/protocols/shared.d.ts +194 -0
  41. package/dist/protocols/shared.js +238 -0
  42. package/dist/protocols/utils/bedrock-auth.d.ts +21 -0
  43. package/dist/protocols/utils/bedrock-auth.js +43 -0
  44. package/dist/protocols/utils/bedrock-cache.d.ts +15 -0
  45. package/dist/protocols/utils/bedrock-cache.js +29 -0
  46. package/dist/protocols/utils/bedrock-media.d.ts +49 -0
  47. package/dist/protocols/utils/bedrock-media.js +70 -0
  48. package/dist/protocols/utils/cache.d.ts +6 -0
  49. package/dist/protocols/utils/cache.js +8 -0
  50. package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
  51. package/dist/protocols/utils/gemini-tool-schema.js +103 -0
  52. package/dist/protocols/utils/image-input.d.ts +21 -0
  53. package/dist/protocols/utils/image-input.js +22 -0
  54. package/dist/protocols/utils/lifecycle.d.ts +20 -0
  55. package/dist/protocols/utils/lifecycle.js +68 -0
  56. package/dist/protocols/utils/open-responses-options.d.ts +21 -0
  57. package/dist/protocols/utils/open-responses-options.js +41 -0
  58. package/dist/protocols/utils/openai-image.d.ts +5 -0
  59. package/dist/protocols/utils/openai-image.js +18 -0
  60. package/dist/protocols/utils/openai-options.d.ts +14 -0
  61. package/dist/protocols/utils/openai-options.js +14 -0
  62. package/dist/protocols/utils/tool-schema.d.ts +8 -0
  63. package/dist/protocols/utils/tool-schema.js +81 -0
  64. package/dist/protocols/utils/tool-stream.d.ts +639 -0
  65. package/dist/protocols/utils/tool-stream.js +141 -0
  66. package/dist/protocols/xai-images.d.ts +26 -0
  67. package/dist/protocols/xai-images.js +111 -0
  68. package/dist/protocols/zai-images.d.ts +22 -0
  69. package/dist/protocols/zai-images.js +84 -0
  70. package/dist/protocols.d.ts +1 -0
  71. package/dist/protocols.js +1 -0
  72. package/dist/provider-error.d.ts +14 -0
  73. package/dist/provider-error.js +130 -0
  74. package/dist/provider-package.d.ts +15 -0
  75. package/dist/provider-package.js +1 -0
  76. package/dist/provider.d.ts +23 -0
  77. package/dist/provider.js +2 -0
  78. package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
  79. package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
  80. package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
  81. package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
  82. package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
  83. package/dist/providers/amazon-bedrock/mantle.js +1 -0
  84. package/dist/providers/amazon-bedrock-mantle.d.ts +247 -0
  85. package/dist/providers/amazon-bedrock-mantle.js +68 -0
  86. package/dist/providers/amazon-bedrock.d.ts +172 -0
  87. package/dist/providers/amazon-bedrock.js +41 -0
  88. package/dist/providers/anthropic-compatible.d.ts +218 -0
  89. package/dist/providers/anthropic-compatible.js +45 -0
  90. package/dist/providers/anthropic.d.ts +216 -0
  91. package/dist/providers/anthropic.js +40 -0
  92. package/dist/providers/azure/chat.d.ts +2 -0
  93. package/dist/providers/azure/chat.js +1 -0
  94. package/dist/providers/azure/responses.d.ts +2 -0
  95. package/dist/providers/azure/responses.js +1 -0
  96. package/dist/providers/azure.d.ts +248 -0
  97. package/dist/providers/azure.js +90 -0
  98. package/dist/providers/cloudflare.d.ts +338 -0
  99. package/dist/providers/cloudflare.js +87 -0
  100. package/dist/providers/google-vertex/chat.d.ts +2 -0
  101. package/dist/providers/google-vertex/chat.js +1 -0
  102. package/dist/providers/google-vertex/gemini.d.ts +2 -0
  103. package/dist/providers/google-vertex/gemini.js +1 -0
  104. package/dist/providers/google-vertex/messages.d.ts +2 -0
  105. package/dist/providers/google-vertex/messages.js +1 -0
  106. package/dist/providers/google-vertex/responses.d.ts +2 -0
  107. package/dist/providers/google-vertex/responses.js +1 -0
  108. package/dist/providers/google-vertex-chat.d.ts +131 -0
  109. package/dist/providers/google-vertex-chat.js +50 -0
  110. package/dist/providers/google-vertex-messages.d.ts +215 -0
  111. package/dist/providers/google-vertex-messages.js +75 -0
  112. package/dist/providers/google-vertex-responses.d.ts +122 -0
  113. package/dist/providers/google-vertex-responses.js +51 -0
  114. package/dist/providers/google-vertex-shared.d.ts +22 -0
  115. package/dist/providers/google-vertex-shared.js +61 -0
  116. package/dist/providers/google-vertex.d.ts +115 -0
  117. package/dist/providers/google-vertex.js +64 -0
  118. package/dist/providers/google.d.ts +112 -0
  119. package/dist/providers/google.js +43 -0
  120. package/dist/providers/index.d.ts +18 -0
  121. package/dist/providers/index.js +18 -0
  122. package/dist/providers/open-responses-options.d.ts +16 -0
  123. package/dist/providers/open-responses-options.js +1 -0
  124. package/dist/providers/openai/chat.d.ts +2 -0
  125. package/dist/providers/openai/chat.js +1 -0
  126. package/dist/providers/openai/responses.d.ts +2 -0
  127. package/dist/providers/openai/responses.js +1 -0
  128. package/dist/providers/openai-compatible/responses.d.ts +1 -0
  129. package/dist/providers/openai-compatible/responses.js +1 -0
  130. package/dist/providers/openai-compatible-profile.d.ts +43 -0
  131. package/dist/providers/openai-compatible-profile.js +12 -0
  132. package/dist/providers/openai-compatible-responses.d.ts +120 -0
  133. package/dist/providers/openai-compatible-responses.js +33 -0
  134. package/dist/providers/openai-compatible.d.ts +167 -0
  135. package/dist/providers/openai-compatible.js +55 -0
  136. package/dist/providers/openai-options.d.ts +21 -0
  137. package/dist/providers/openai-options.js +41 -0
  138. package/dist/providers/openai.d.ts +264 -0
  139. package/dist/providers/openai.js +83 -0
  140. package/dist/providers/openrouter.d.ts +537 -0
  141. package/dist/providers/openrouter.js +117 -0
  142. package/dist/providers/xai.d.ts +249 -0
  143. package/dist/providers/xai.js +79 -0
  144. package/dist/providers/zai.d.ts +24 -0
  145. package/dist/providers/zai.js +21 -0
  146. package/dist/providers.d.ts +1 -0
  147. package/dist/providers.js +1 -0
  148. package/dist/route/auth-options.d.ts +34 -0
  149. package/dist/route/auth-options.js +14 -0
  150. package/dist/route/auth.d.ts +51 -0
  151. package/dist/route/auth.js +89 -0
  152. package/dist/route/client.d.ts +348 -0
  153. package/dist/route/client.js +214 -0
  154. package/dist/route/endpoint.d.ts +28 -0
  155. package/dist/route/endpoint.js +21 -0
  156. package/dist/route/executor.d.ts +23 -0
  157. package/dist/route/executor.js +227 -0
  158. package/dist/route/framing.d.ts +23 -0
  159. package/dist/route/framing.js +4 -0
  160. package/dist/route/index.d.ts +16 -0
  161. package/dist/route/index.js +9 -0
  162. package/dist/route/protocol.d.ts +77 -0
  163. package/dist/route/protocol.js +17 -0
  164. package/dist/route/transport/http.d.ts +34 -0
  165. package/dist/route/transport/http.js +63 -0
  166. package/dist/route/transport/index.d.ts +39 -0
  167. package/dist/route/transport/index.js +4 -0
  168. package/dist/route/transport/websocket-channel.d.ts +56 -0
  169. package/dist/route/transport/websocket-channel.js +1 -0
  170. package/dist/route/transport/websocket.d.ts +55 -0
  171. package/dist/route/transport/websocket.js +326 -0
  172. package/dist/route.d.ts +1 -0
  173. package/dist/route.js +1 -0
  174. package/dist/schema/errors.d.ts +159 -0
  175. package/dist/schema/errors.js +155 -0
  176. package/dist/schema/events.d.ts +4587 -0
  177. package/dist/schema/events.js +492 -0
  178. package/dist/schema/ids.d.ts +30 -0
  179. package/dist/schema/ids.js +19 -0
  180. package/dist/schema/index.d.ts +5 -0
  181. package/dist/schema/index.js +5 -0
  182. package/dist/schema/messages.d.ts +402 -0
  183. package/dist/schema/messages.js +244 -0
  184. package/dist/schema/options.d.ts +159 -0
  185. package/dist/schema/options.js +202 -0
  186. package/dist/testing.d.ts +1493 -0
  187. package/dist/testing.js +88 -0
  188. package/dist/tool-runtime.d.ts +15 -0
  189. package/dist/tool-runtime.js +54 -0
  190. package/dist/tool.d.ts +135 -0
  191. package/dist/tool.js +66 -0
  192. package/dist/utils/record.d.ts +2 -0
  193. package/dist/utils/record.js +2 -0
  194. package/package.json +47 -0
@@ -0,0 +1,596 @@
1
+ import { Schema } from "effect";
2
+ import { Route } from "../route/client.js";
3
+ import { Protocol } from "../route/protocol.js";
4
+ import { HttpTransport } from "../route/transport/index.js";
5
+ import { OpenResponses } from "./open-responses.js";
6
+ export declare const DEFAULT_BASE_URL = "https://api.openai.com/v1";
7
+ export declare const PATH = "/responses";
8
+ declare const OpenAIResponsesBody: Schema.Struct<{
9
+ readonly stream: Schema.Literal<true>;
10
+ readonly input: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
11
+ readonly role: Schema.tag<"assistant">;
12
+ readonly content: Schema.$Array<Schema.Struct<{
13
+ readonly type: Schema.tag<"output_text">;
14
+ readonly text: Schema.String;
15
+ }>>;
16
+ readonly phase: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["commentary", "final_answer"]>>>;
17
+ }>, Schema.Union<readonly [Schema.Struct<{
18
+ readonly role: Schema.tag<"system">;
19
+ readonly content: Schema.String;
20
+ }>, Schema.Struct<{
21
+ readonly role: Schema.tag<"user">;
22
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
23
+ readonly type: Schema.tag<"input_text">;
24
+ readonly text: Schema.String;
25
+ }>, Schema.Union<readonly [Schema.Struct<{
26
+ readonly type: Schema.tag<"input_image">;
27
+ readonly image_url: Schema.String;
28
+ }>, Schema.Struct<{
29
+ readonly type: Schema.tag<"input_file">;
30
+ readonly filename: Schema.String;
31
+ readonly file_data: Schema.String;
32
+ readonly mime_type: Schema.optional<Schema.String>;
33
+ }>]>]>>;
34
+ }>, Schema.Struct<{
35
+ readonly role: Schema.tag<"assistant">;
36
+ readonly content: Schema.$Array<Schema.Struct<{
37
+ readonly type: Schema.tag<"output_text">;
38
+ readonly text: Schema.String;
39
+ }>>;
40
+ readonly phase: Schema.optionalKey<Schema.Literals<readonly ["commentary", "final_answer"]>>;
41
+ }>, Schema.Struct<{
42
+ readonly type: Schema.tag<"reasoning">;
43
+ readonly id: Schema.optionalKey<Schema.String>;
44
+ readonly summary: Schema.$Array<Schema.Struct<{
45
+ readonly type: Schema.tag<"summary_text">;
46
+ readonly text: Schema.String;
47
+ }>>;
48
+ readonly encrypted_content: Schema.optional<Schema.NullOr<Schema.String>>;
49
+ }>, Schema.Struct<{
50
+ readonly type: Schema.tag<"item_reference">;
51
+ readonly id: Schema.String;
52
+ }>, Schema.Struct<{
53
+ readonly type: Schema.tag<"function_call">;
54
+ readonly call_id: Schema.String;
55
+ readonly name: Schema.String;
56
+ readonly arguments: Schema.String;
57
+ }>, Schema.Struct<{
58
+ readonly type: Schema.tag<"function_call_output">;
59
+ readonly call_id: Schema.String;
60
+ readonly output: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
61
+ readonly type: Schema.tag<"input_text">;
62
+ readonly text: Schema.String;
63
+ }>, Schema.Struct<{
64
+ readonly type: Schema.tag<"input_image">;
65
+ readonly image_url: Schema.String;
66
+ }>, Schema.Struct<{
67
+ readonly type: Schema.tag<"input_file">;
68
+ readonly filename: Schema.String;
69
+ readonly file_data: Schema.String;
70
+ readonly mime_type: Schema.optional<Schema.String>;
71
+ }>]>>]>;
72
+ }>]>]>>;
73
+ readonly tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
74
+ readonly type: Schema.tag<"function">;
75
+ readonly name: Schema.String;
76
+ readonly description: Schema.String;
77
+ readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
78
+ readonly strict: Schema.optional<Schema.Boolean>;
79
+ }>, Schema.Struct<{
80
+ readonly type: Schema.tag<"image_generation">;
81
+ readonly action: Schema.optional<Schema.Literals<readonly ["auto", "generate", "edit"]>>;
82
+ readonly background: Schema.optional<Schema.Literals<readonly ["auto", "opaque", "transparent"]>>;
83
+ readonly input_fidelity: Schema.optional<Schema.Literals<readonly ["low", "high"]>>;
84
+ readonly output_compression: Schema.optional<Schema.Int>;
85
+ readonly output_format: Schema.optional<Schema.Literals<readonly ["png", "jpeg", "webp"]>>;
86
+ readonly partial_images: Schema.optional<Schema.Int>;
87
+ readonly quality: Schema.optional<Schema.Literals<readonly ["auto", "low", "medium", "high"]>>;
88
+ readonly size: Schema.optional<Schema.String>;
89
+ }>]>>>;
90
+ readonly tool_choice: Schema.optional<Schema.Union<readonly [Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
91
+ readonly type: Schema.tag<"function">;
92
+ readonly name: Schema.String;
93
+ }>]>, Schema.Struct<{
94
+ readonly type: Schema.tag<"image_generation">;
95
+ }>]>>;
96
+ readonly model: Schema.String;
97
+ readonly instructions: Schema.optional<Schema.String>;
98
+ readonly store: Schema.optional<Schema.Boolean>;
99
+ readonly service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
100
+ readonly prompt_cache_key: Schema.optional<Schema.String>;
101
+ readonly include: Schema.optional<Schema.$Array<Schema.Literals<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"]>>>;
102
+ readonly reasoning: Schema.optional<Schema.Struct<{
103
+ readonly effort: Schema.optional<Schema.String>;
104
+ readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
105
+ }>>;
106
+ readonly text: Schema.optional<Schema.Struct<{
107
+ readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
108
+ }>>;
109
+ readonly max_output_tokens: Schema.optional<Schema.Number>;
110
+ readonly temperature: Schema.optional<Schema.Number>;
111
+ readonly top_p: Schema.optional<Schema.Number>;
112
+ }>;
113
+ export type OpenAIResponsesBody = Schema.Schema.Type<typeof OpenAIResponsesBody>;
114
+ export declare const protocol: Protocol<{
115
+ readonly input: readonly ({
116
+ readonly type: "reasoning";
117
+ readonly summary: readonly {
118
+ readonly type: "summary_text";
119
+ readonly text: string;
120
+ }[];
121
+ readonly id?: string | undefined;
122
+ readonly encrypted_content?: string | null | undefined;
123
+ } | {
124
+ readonly type: "item_reference";
125
+ readonly id: string;
126
+ } | {
127
+ readonly role: "system";
128
+ readonly content: string;
129
+ } | {
130
+ readonly role: "user";
131
+ readonly content: readonly ({
132
+ readonly type: "input_image";
133
+ readonly image_url: string;
134
+ } | {
135
+ readonly type: "input_file";
136
+ readonly filename: string;
137
+ readonly file_data: string;
138
+ readonly mime_type?: string | undefined;
139
+ } | {
140
+ readonly type: "input_text";
141
+ readonly text: string;
142
+ })[];
143
+ } | {
144
+ readonly content: readonly {
145
+ readonly type: "output_text";
146
+ readonly text: string;
147
+ }[];
148
+ readonly role: "assistant";
149
+ readonly phase?: "commentary" | "final_answer" | undefined;
150
+ } | {
151
+ readonly type: "function_call";
152
+ readonly call_id: string;
153
+ readonly name: string;
154
+ readonly arguments: string;
155
+ } | {
156
+ readonly type: "function_call_output";
157
+ readonly call_id: string;
158
+ readonly output: string | readonly ({
159
+ readonly type: "input_image";
160
+ readonly image_url: string;
161
+ } | {
162
+ readonly type: "input_file";
163
+ readonly filename: string;
164
+ readonly file_data: string;
165
+ readonly mime_type?: string | undefined;
166
+ } | {
167
+ readonly type: "input_text";
168
+ readonly text: string;
169
+ })[];
170
+ } | {
171
+ readonly content: readonly {
172
+ readonly type: "output_text";
173
+ readonly text: string;
174
+ }[];
175
+ readonly role: "assistant";
176
+ readonly phase?: "commentary" | "final_answer" | null | undefined;
177
+ })[];
178
+ readonly model: string;
179
+ readonly stream: true;
180
+ readonly instructions?: string | undefined;
181
+ readonly reasoning?: {
182
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
183
+ readonly effort?: string | undefined;
184
+ } | undefined;
185
+ readonly tools?: readonly ({
186
+ readonly type: "function";
187
+ readonly description: string;
188
+ readonly name: string;
189
+ readonly parameters: {
190
+ readonly [x: string]: unknown;
191
+ };
192
+ readonly strict?: boolean | undefined;
193
+ } | {
194
+ readonly type: "image_generation";
195
+ readonly size?: string | undefined;
196
+ readonly action?: "generate" | "auto" | "edit" | undefined;
197
+ readonly output_format?: "png" | "jpeg" | "webp" | undefined;
198
+ readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
199
+ readonly background?: "auto" | "opaque" | "transparent" | undefined;
200
+ readonly output_compression?: number | undefined;
201
+ readonly input_fidelity?: "low" | "high" | undefined;
202
+ readonly partial_images?: number | undefined;
203
+ })[] | undefined;
204
+ readonly text?: {
205
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
206
+ } | undefined;
207
+ readonly temperature?: number | undefined;
208
+ readonly tool_choice?: "required" | "none" | "auto" | {
209
+ readonly type: "function";
210
+ readonly name: string;
211
+ } | {
212
+ readonly type: "image_generation";
213
+ } | undefined;
214
+ readonly top_p?: number | undefined;
215
+ 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;
216
+ readonly store?: boolean | undefined;
217
+ readonly prompt_cache_key?: string | undefined;
218
+ readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
219
+ readonly max_output_tokens?: number | undefined;
220
+ }, string, {
221
+ readonly [x: string]: unknown;
222
+ readonly type: string;
223
+ readonly error?: {
224
+ readonly type?: string | null | undefined;
225
+ readonly code?: string | null | undefined;
226
+ readonly message?: string | null | undefined;
227
+ readonly param?: string | null | undefined;
228
+ } | null | undefined;
229
+ readonly status?: unknown;
230
+ readonly code?: string | null | undefined;
231
+ readonly message?: string | undefined;
232
+ readonly headers?: unknown;
233
+ readonly text?: string | undefined;
234
+ readonly item?: {
235
+ readonly [x: string]: unknown;
236
+ readonly type: string;
237
+ readonly id?: string | undefined;
238
+ readonly name?: string | undefined;
239
+ readonly arguments?: string | undefined;
240
+ readonly encrypted_content?: string | null | undefined;
241
+ readonly call_id?: string | undefined;
242
+ } | undefined;
243
+ readonly delta?: string | undefined;
244
+ readonly response?: {
245
+ readonly [x: string]: unknown;
246
+ readonly error?: {
247
+ readonly type?: string | null | undefined;
248
+ readonly code?: string | null | undefined;
249
+ readonly message?: string | null | undefined;
250
+ readonly param?: string | null | undefined;
251
+ } | null | undefined;
252
+ readonly id?: string | undefined;
253
+ readonly usage?: {
254
+ readonly input_tokens?: number | undefined;
255
+ readonly output_tokens?: number | undefined;
256
+ readonly output_tokens_details?: {
257
+ readonly reasoning_tokens?: number | undefined;
258
+ } | null | undefined;
259
+ readonly total_tokens?: number | undefined;
260
+ readonly input_tokens_details?: {
261
+ readonly cached_tokens?: number | undefined;
262
+ readonly cache_write_tokens?: number | undefined;
263
+ } | null | undefined;
264
+ } | null | undefined;
265
+ readonly service_tier?: string | null | undefined;
266
+ readonly incomplete_details?: {
267
+ readonly reason?: string | undefined;
268
+ } | null | undefined;
269
+ } | undefined;
270
+ readonly param?: string | null | undefined;
271
+ readonly status_code?: unknown;
272
+ readonly item_id?: string | undefined;
273
+ readonly summary_index?: number | undefined;
274
+ }, OpenResponses.ParserState>;
275
+ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
276
+ readonly input: readonly ({
277
+ readonly type: "reasoning";
278
+ readonly summary: readonly {
279
+ readonly type: "summary_text";
280
+ readonly text: string;
281
+ }[];
282
+ readonly id?: string | undefined;
283
+ readonly encrypted_content?: string | null | undefined;
284
+ } | {
285
+ readonly type: "item_reference";
286
+ readonly id: string;
287
+ } | {
288
+ readonly role: "system";
289
+ readonly content: string;
290
+ } | {
291
+ readonly role: "user";
292
+ readonly content: readonly ({
293
+ readonly type: "input_image";
294
+ readonly image_url: string;
295
+ } | {
296
+ readonly type: "input_file";
297
+ readonly filename: string;
298
+ readonly file_data: string;
299
+ readonly mime_type?: string | undefined;
300
+ } | {
301
+ readonly type: "input_text";
302
+ readonly text: string;
303
+ })[];
304
+ } | {
305
+ readonly content: readonly {
306
+ readonly type: "output_text";
307
+ readonly text: string;
308
+ }[];
309
+ readonly role: "assistant";
310
+ readonly phase?: "commentary" | "final_answer" | undefined;
311
+ } | {
312
+ readonly type: "function_call";
313
+ readonly call_id: string;
314
+ readonly name: string;
315
+ readonly arguments: string;
316
+ } | {
317
+ readonly type: "function_call_output";
318
+ readonly call_id: string;
319
+ readonly output: string | readonly ({
320
+ readonly type: "input_image";
321
+ readonly image_url: string;
322
+ } | {
323
+ readonly type: "input_file";
324
+ readonly filename: string;
325
+ readonly file_data: string;
326
+ readonly mime_type?: string | undefined;
327
+ } | {
328
+ readonly type: "input_text";
329
+ readonly text: string;
330
+ })[];
331
+ } | {
332
+ readonly content: readonly {
333
+ readonly type: "output_text";
334
+ readonly text: string;
335
+ }[];
336
+ readonly role: "assistant";
337
+ readonly phase?: "commentary" | "final_answer" | null | undefined;
338
+ })[];
339
+ readonly model: string;
340
+ readonly stream: true;
341
+ readonly instructions?: string | undefined;
342
+ readonly reasoning?: {
343
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
344
+ readonly effort?: string | undefined;
345
+ } | undefined;
346
+ readonly tools?: readonly ({
347
+ readonly type: "function";
348
+ readonly description: string;
349
+ readonly name: string;
350
+ readonly parameters: {
351
+ readonly [x: string]: unknown;
352
+ };
353
+ readonly strict?: boolean | undefined;
354
+ } | {
355
+ readonly type: "image_generation";
356
+ readonly size?: string | undefined;
357
+ readonly action?: "generate" | "auto" | "edit" | undefined;
358
+ readonly output_format?: "png" | "jpeg" | "webp" | undefined;
359
+ readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
360
+ readonly background?: "auto" | "opaque" | "transparent" | undefined;
361
+ readonly output_compression?: number | undefined;
362
+ readonly input_fidelity?: "low" | "high" | undefined;
363
+ readonly partial_images?: number | undefined;
364
+ })[] | undefined;
365
+ readonly text?: {
366
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
367
+ } | undefined;
368
+ readonly temperature?: number | undefined;
369
+ readonly tool_choice?: "required" | "none" | "auto" | {
370
+ readonly type: "function";
371
+ readonly name: string;
372
+ } | {
373
+ readonly type: "image_generation";
374
+ } | undefined;
375
+ readonly top_p?: number | undefined;
376
+ 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;
377
+ readonly store?: boolean | undefined;
378
+ readonly prompt_cache_key?: string | undefined;
379
+ readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
380
+ readonly max_output_tokens?: number | undefined;
381
+ }, string>;
382
+ export declare const transport: import("../route/transport/index.js").Transport<{
383
+ readonly input: readonly ({
384
+ readonly type: "reasoning";
385
+ readonly summary: readonly {
386
+ readonly type: "summary_text";
387
+ readonly text: string;
388
+ }[];
389
+ readonly id?: string | undefined;
390
+ readonly encrypted_content?: string | null | undefined;
391
+ } | {
392
+ readonly type: "item_reference";
393
+ readonly id: string;
394
+ } | {
395
+ readonly role: "system";
396
+ readonly content: string;
397
+ } | {
398
+ readonly role: "user";
399
+ readonly content: readonly ({
400
+ readonly type: "input_image";
401
+ readonly image_url: string;
402
+ } | {
403
+ readonly type: "input_file";
404
+ readonly filename: string;
405
+ readonly file_data: string;
406
+ readonly mime_type?: string | undefined;
407
+ } | {
408
+ readonly type: "input_text";
409
+ readonly text: string;
410
+ })[];
411
+ } | {
412
+ readonly content: readonly {
413
+ readonly type: "output_text";
414
+ readonly text: string;
415
+ }[];
416
+ readonly role: "assistant";
417
+ readonly phase?: "commentary" | "final_answer" | undefined;
418
+ } | {
419
+ readonly type: "function_call";
420
+ readonly call_id: string;
421
+ readonly name: string;
422
+ readonly arguments: string;
423
+ } | {
424
+ readonly type: "function_call_output";
425
+ readonly call_id: string;
426
+ readonly output: string | readonly ({
427
+ readonly type: "input_image";
428
+ readonly image_url: string;
429
+ } | {
430
+ readonly type: "input_file";
431
+ readonly filename: string;
432
+ readonly file_data: string;
433
+ readonly mime_type?: string | undefined;
434
+ } | {
435
+ readonly type: "input_text";
436
+ readonly text: string;
437
+ })[];
438
+ } | {
439
+ readonly content: readonly {
440
+ readonly type: "output_text";
441
+ readonly text: string;
442
+ }[];
443
+ readonly role: "assistant";
444
+ readonly phase?: "commentary" | "final_answer" | null | undefined;
445
+ })[];
446
+ readonly model: string;
447
+ readonly stream: true;
448
+ readonly instructions?: string | undefined;
449
+ readonly reasoning?: {
450
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
451
+ readonly effort?: string | undefined;
452
+ } | undefined;
453
+ readonly tools?: readonly ({
454
+ readonly type: "function";
455
+ readonly description: string;
456
+ readonly name: string;
457
+ readonly parameters: {
458
+ readonly [x: string]: unknown;
459
+ };
460
+ readonly strict?: boolean | undefined;
461
+ } | {
462
+ readonly type: "image_generation";
463
+ readonly size?: string | undefined;
464
+ readonly action?: "generate" | "auto" | "edit" | undefined;
465
+ readonly output_format?: "png" | "jpeg" | "webp" | undefined;
466
+ readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
467
+ readonly background?: "auto" | "opaque" | "transparent" | undefined;
468
+ readonly output_compression?: number | undefined;
469
+ readonly input_fidelity?: "low" | "high" | undefined;
470
+ readonly partial_images?: number | undefined;
471
+ })[] | undefined;
472
+ readonly text?: {
473
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
474
+ } | undefined;
475
+ readonly temperature?: number | undefined;
476
+ readonly tool_choice?: "required" | "none" | "auto" | {
477
+ readonly type: "function";
478
+ readonly name: string;
479
+ } | {
480
+ readonly type: "image_generation";
481
+ } | undefined;
482
+ readonly top_p?: number | undefined;
483
+ 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;
484
+ readonly store?: boolean | undefined;
485
+ readonly prompt_cache_key?: string | undefined;
486
+ readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
487
+ readonly max_output_tokens?: number | undefined;
488
+ }, import("./open-responses-channel.js").Prepared, string>;
489
+ export declare const route: Route<{
490
+ readonly input: readonly ({
491
+ readonly type: "reasoning";
492
+ readonly summary: readonly {
493
+ readonly type: "summary_text";
494
+ readonly text: string;
495
+ }[];
496
+ readonly id?: string | undefined;
497
+ readonly encrypted_content?: string | null | undefined;
498
+ } | {
499
+ readonly type: "item_reference";
500
+ readonly id: string;
501
+ } | {
502
+ readonly role: "system";
503
+ readonly content: string;
504
+ } | {
505
+ readonly role: "user";
506
+ readonly content: readonly ({
507
+ readonly type: "input_image";
508
+ readonly image_url: string;
509
+ } | {
510
+ readonly type: "input_file";
511
+ readonly filename: string;
512
+ readonly file_data: string;
513
+ readonly mime_type?: string | undefined;
514
+ } | {
515
+ readonly type: "input_text";
516
+ readonly text: string;
517
+ })[];
518
+ } | {
519
+ readonly content: readonly {
520
+ readonly type: "output_text";
521
+ readonly text: string;
522
+ }[];
523
+ readonly role: "assistant";
524
+ readonly phase?: "commentary" | "final_answer" | undefined;
525
+ } | {
526
+ readonly type: "function_call";
527
+ readonly call_id: string;
528
+ readonly name: string;
529
+ readonly arguments: string;
530
+ } | {
531
+ readonly type: "function_call_output";
532
+ readonly call_id: string;
533
+ readonly output: string | readonly ({
534
+ readonly type: "input_image";
535
+ readonly image_url: string;
536
+ } | {
537
+ readonly type: "input_file";
538
+ readonly filename: string;
539
+ readonly file_data: string;
540
+ readonly mime_type?: string | undefined;
541
+ } | {
542
+ readonly type: "input_text";
543
+ readonly text: string;
544
+ })[];
545
+ } | {
546
+ readonly content: readonly {
547
+ readonly type: "output_text";
548
+ readonly text: string;
549
+ }[];
550
+ readonly role: "assistant";
551
+ readonly phase?: "commentary" | "final_answer" | null | undefined;
552
+ })[];
553
+ readonly model: string;
554
+ readonly stream: true;
555
+ readonly instructions?: string | undefined;
556
+ readonly reasoning?: {
557
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
558
+ readonly effort?: string | undefined;
559
+ } | undefined;
560
+ readonly tools?: readonly ({
561
+ readonly type: "function";
562
+ readonly description: string;
563
+ readonly name: string;
564
+ readonly parameters: {
565
+ readonly [x: string]: unknown;
566
+ };
567
+ readonly strict?: boolean | undefined;
568
+ } | {
569
+ readonly type: "image_generation";
570
+ readonly size?: string | undefined;
571
+ readonly action?: "generate" | "auto" | "edit" | undefined;
572
+ readonly output_format?: "png" | "jpeg" | "webp" | undefined;
573
+ readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
574
+ readonly background?: "auto" | "opaque" | "transparent" | undefined;
575
+ readonly output_compression?: number | undefined;
576
+ readonly input_fidelity?: "low" | "high" | undefined;
577
+ readonly partial_images?: number | undefined;
578
+ })[] | undefined;
579
+ readonly text?: {
580
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
581
+ } | undefined;
582
+ readonly temperature?: number | undefined;
583
+ readonly tool_choice?: "required" | "none" | "auto" | {
584
+ readonly type: "function";
585
+ readonly name: string;
586
+ } | {
587
+ readonly type: "image_generation";
588
+ } | undefined;
589
+ readonly top_p?: number | undefined;
590
+ 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;
591
+ readonly store?: boolean | undefined;
592
+ readonly prompt_cache_key?: string | undefined;
593
+ readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
594
+ readonly max_output_tokens?: number | undefined;
595
+ }, import("./open-responses-channel.js").Prepared>;
596
+ export * as OpenAIResponses from "./openai-responses.js";