@opencode/ai 2.2.0 → 2.2.1

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 (184) hide show
  1. package/README.md +66 -62
  2. package/dist/effect.d.ts +1 -1
  3. package/dist/effect.js +1 -1
  4. package/dist/image-client.d.ts +45 -0
  5. package/dist/index.d.ts +38 -20
  6. package/dist/index.js +14 -2
  7. package/dist/media-client.d.ts +1 -0
  8. package/dist/media-client.js +1 -0
  9. package/dist/protocols/alibaba-chat.d.ts +39 -4
  10. package/dist/protocols/alibaba-responses.d.ts +20 -3
  11. package/dist/protocols/google-images.js +3 -1
  12. package/dist/protocols/meta-responses.d.ts +40 -6
  13. package/dist/protocols/meta-responses.js +1 -1
  14. package/dist/protocols/minimax-images.d.ts +25 -0
  15. package/dist/protocols/minimax-images.js +150 -0
  16. package/dist/protocols/open-responses.d.ts +182 -27
  17. package/dist/protocols/open-responses.js +108 -36
  18. package/dist/protocols/openai-chat.d.ts +438 -46
  19. package/dist/protocols/openai-chat.js +121 -39
  20. package/dist/protocols/openai-compatible-chat.d.ts +35 -4
  21. package/dist/protocols/openai-compatible-responses.d.ts +20 -3
  22. package/dist/protocols/openai-freeform.d.ts +47 -0
  23. package/dist/protocols/openai-freeform.js +54 -0
  24. package/dist/protocols/openai-images.d.ts +16 -1
  25. package/dist/protocols/openai-images.js +49 -17
  26. package/dist/protocols/openai-responses.d.ts +120 -18
  27. package/dist/protocols/openai-responses.js +17 -8
  28. package/dist/protocols/venice-chat.d.ts +39 -4
  29. package/dist/protocols/venice-chat.js +1 -1
  30. package/dist/protocols/xai-images.d.ts +6 -0
  31. package/dist/protocols/xai-images.js +4 -5
  32. package/dist/protocols/xai-responses.d.ts +20 -3
  33. package/dist/protocols/xai-responses.js +2 -1
  34. package/dist/protocols/zai-chat.d.ts +39 -4
  35. package/dist/provider-error.js +5 -4
  36. package/dist/provider-package.d.ts +2 -0
  37. package/dist/providers/alibaba.d.ts +58 -10
  38. package/dist/providers/amazon-bedrock-mantle.d.ts +66 -11
  39. package/dist/providers/amazon-bedrock-mantle.js +1 -1
  40. package/dist/providers/amazon-bedrock.d.ts +1 -1
  41. package/dist/providers/amazon-bedrock.js +1 -1
  42. package/dist/providers/anthropic-compatible.d.ts +1 -1
  43. package/dist/providers/anthropic.d.ts +1 -1
  44. package/dist/providers/anthropic.js +1 -1
  45. package/dist/providers/azure.d.ts +79 -15
  46. package/dist/providers/baseten.d.ts +74 -12
  47. package/dist/providers/baseten.js +1 -1
  48. package/dist/providers/cerebras.d.ts +73 -11
  49. package/dist/providers/cerebras.js +1 -1
  50. package/dist/providers/cloudflare-ai-gateway.d.ts +113 -17
  51. package/dist/providers/cloudflare-workers-ai.d.ts +73 -11
  52. package/dist/providers/cohere/chat.d.ts +1 -1
  53. package/dist/providers/cohere/chat.js +1 -1
  54. package/dist/providers/cohere.d.ts +73 -11
  55. package/dist/providers/cohere.js +1 -1
  56. package/dist/providers/deepinfra.d.ts +73 -11
  57. package/dist/providers/deepinfra.js +1 -1
  58. package/dist/providers/deepseek.d.ts +73 -11
  59. package/dist/providers/deepseek.js +1 -1
  60. package/dist/providers/digitalocean/responses.d.ts +4 -0
  61. package/dist/providers/digitalocean/responses.js +1 -0
  62. package/dist/providers/digitalocean.d.ts +320 -21
  63. package/dist/providers/digitalocean.js +18 -7
  64. package/dist/providers/fireworks.d.ts +73 -11
  65. package/dist/providers/fireworks.js +1 -1
  66. package/dist/providers/google/interactions.d.ts +1 -1
  67. package/dist/providers/google/interactions.js +1 -1
  68. package/dist/providers/google-vertex-chat.d.ts +36 -5
  69. package/dist/providers/google-vertex-chat.js +1 -1
  70. package/dist/providers/google-vertex-interactions.d.ts +1 -1
  71. package/dist/providers/google-vertex-interactions.js +1 -1
  72. package/dist/providers/google-vertex-messages.d.ts +1 -1
  73. package/dist/providers/google-vertex-messages.js +1 -1
  74. package/dist/providers/google-vertex-mistral.d.ts +1 -1
  75. package/dist/providers/google-vertex-mistral.js +1 -1
  76. package/dist/providers/google-vertex-responses.d.ts +21 -4
  77. package/dist/providers/google-vertex-responses.js +1 -1
  78. package/dist/providers/google-vertex.d.ts +2 -2
  79. package/dist/providers/google-vertex.js +1 -1
  80. package/dist/providers/google.d.ts +2 -2
  81. package/dist/providers/google.js +1 -1
  82. package/dist/providers/groq.d.ts +77 -11
  83. package/dist/providers/groq.js +1 -1
  84. package/dist/providers/index.d.ts +0 -4
  85. package/dist/providers/index.js +0 -4
  86. package/dist/providers/meta/images.d.ts +2 -0
  87. package/dist/providers/meta/images.js +1 -0
  88. package/dist/providers/meta.d.ts +61 -12
  89. package/dist/providers/meta.js +2 -1
  90. package/dist/providers/minimax/chat.d.ts +1 -1
  91. package/dist/providers/minimax/chat.js +1 -1
  92. package/dist/providers/minimax/images.d.ts +3 -0
  93. package/dist/providers/minimax/images.js +1 -0
  94. package/dist/providers/minimax/responses.d.ts +1 -1
  95. package/dist/providers/minimax/responses.js +1 -1
  96. package/dist/providers/minimax.d.ts +63 -9
  97. package/dist/providers/minimax.js +22 -9
  98. package/dist/providers/mistral.d.ts +3 -3
  99. package/dist/providers/mistral.js +1 -1
  100. package/dist/providers/moonshot/messages.d.ts +1 -1
  101. package/dist/providers/moonshot/messages.js +1 -1
  102. package/dist/providers/moonshot/responses.d.ts +1 -1
  103. package/dist/providers/moonshot/responses.js +1 -1
  104. package/dist/providers/moonshot.d.ts +56 -8
  105. package/dist/providers/moonshot.js +1 -1
  106. package/dist/providers/openai-compatible-responses.d.ts +21 -4
  107. package/dist/providers/openai-compatible.d.ts +38 -7
  108. package/dist/providers/openai-compatible.js +9 -2
  109. package/dist/providers/openai.d.ts +59 -11
  110. package/dist/providers/openai.js +4 -2
  111. package/dist/providers/opencode.d.ts +3 -3
  112. package/dist/providers/opencode.js +1 -1
  113. package/dist/providers/openrouter/responses.d.ts +4 -0
  114. package/dist/providers/openrouter/responses.js +1 -0
  115. package/dist/providers/openrouter.d.ts +356 -26
  116. package/dist/providers/openrouter.js +42 -13
  117. package/dist/providers/togetherai.d.ts +73 -11
  118. package/dist/providers/togetherai.js +1 -1
  119. package/dist/providers/typesafe-ai.d.ts +3 -3
  120. package/dist/providers/typesafe-ai.js +1 -1
  121. package/dist/providers/venice/responses.d.ts +4 -0
  122. package/dist/providers/venice/responses.js +1 -0
  123. package/dist/providers/venice.d.ts +242 -9
  124. package/dist/providers/venice.js +33 -17
  125. package/dist/providers/vercel-ai-gateway.d.ts +8 -8
  126. package/dist/providers/vercel-ai-gateway.js +12 -2
  127. package/dist/providers/xai.d.ts +39 -8
  128. package/dist/providers/xai.js +1 -1
  129. package/dist/providers/zai-coding-plan/messages.d.ts +1 -1
  130. package/dist/providers/zai-coding-plan/messages.js +1 -1
  131. package/dist/providers/zai-coding-plan/responses.d.ts +1 -1
  132. package/dist/providers/zai-coding-plan/responses.js +1 -1
  133. package/dist/providers/zai-coding-plan.d.ts +56 -8
  134. package/dist/providers/zai-coding-plan.js +1 -1
  135. package/dist/providers/zai.d.ts +37 -6
  136. package/dist/providers/zai.js +1 -1
  137. package/dist/route/auth.d.ts +1 -1
  138. package/dist/route/media-protocol.d.ts +2 -4
  139. package/dist/route/media.d.ts +1 -1
  140. package/dist/route/media.js +2 -4
  141. package/dist/schema/messages.d.ts +35 -1
  142. package/dist/schema/messages.js +20 -0
  143. package/dist/speech-client.d.ts +48 -0
  144. package/dist/testing/decision.d.ts +16 -0
  145. package/dist/testing/decision.js +20 -0
  146. package/dist/testing/image.d.ts +14 -0
  147. package/dist/testing/image.js +12 -0
  148. package/dist/testing/media.d.ts +18 -0
  149. package/dist/testing/media.js +36 -0
  150. package/dist/testing/script.d.ts +28 -0
  151. package/dist/testing/script.js +60 -0
  152. package/dist/testing/speech.d.ts +14 -0
  153. package/dist/testing/speech.js +12 -0
  154. package/dist/testing/transcription.d.ts +14 -0
  155. package/dist/testing/transcription.js +12 -0
  156. package/dist/testing/video.d.ts +14 -0
  157. package/dist/testing/video.js +12 -0
  158. package/dist/testing.d.ts +10 -21
  159. package/dist/testing.js +11 -54
  160. package/dist/tool.d.ts +12 -1
  161. package/dist/tool.js +10 -2
  162. package/dist/transcription-client.d.ts +64 -0
  163. package/dist/video-client.d.ts +41 -0
  164. package/package.json +22 -38
  165. package/dist/protocols/bfl-images.d.ts +0 -47
  166. package/dist/protocols/bfl-images.js +0 -155
  167. package/dist/protocols/fal-images.d.ts +0 -34
  168. package/dist/protocols/fal-images.js +0 -95
  169. package/dist/protocols/fal-video.d.ts +0 -29
  170. package/dist/protocols/fal-video.js +0 -73
  171. package/dist/protocols/replicate-images.d.ts +0 -28
  172. package/dist/protocols/replicate-images.js +0 -127
  173. package/dist/protocols/stability-images.d.ts +0 -44
  174. package/dist/protocols/stability-images.js +0 -131
  175. package/dist/protocols/utils/fal-queue.d.ts +0 -26
  176. package/dist/protocols/utils/fal-queue.js +0 -67
  177. package/dist/providers/black-forest-labs.d.ts +0 -21
  178. package/dist/providers/black-forest-labs.js +0 -23
  179. package/dist/providers/fal.d.ts +0 -24
  180. package/dist/providers/fal.js +0 -26
  181. package/dist/providers/replicate.d.ts +0 -21
  182. package/dist/providers/replicate.js +0 -17
  183. package/dist/providers/stability.d.ts +0 -23
  184. package/dist/providers/stability.js +0 -18
@@ -5,12 +5,13 @@ import { Route, type RouteDefaultsInput } from "../route/client.js";
5
5
  import { Protocol } from "../route/protocol.js";
6
6
  import { type ModelID, type ProviderOptions } from "../schema/index.js";
7
7
  import type { OpenAIProviderOptionsInput } from "./openai-options.js";
8
+ import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js";
8
9
  export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
9
- export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
10
+ export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
10
11
  readonly baseURL?: string;
11
- readonly providerOptions?: OpenAIProviderOptionsInput;
12
+ readonly providerOptions?: OpenAIProviderOptionsInput | OpenResponsesProviderOptionsInput;
12
13
  };
13
- export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & {
14
+ export type Settings<Options = OpenAIProviderOptionsInput> = ProviderPackage.Settings & Options & {
14
15
  readonly apiKey?: string;
15
16
  };
16
17
  export declare const protocol: Protocol<{
@@ -89,7 +90,14 @@ export declare const protocol: Protocol<{
89
90
  readonly ttl?: string | undefined;
90
91
  } | undefined;
91
92
  }[] | null;
92
- readonly tool_calls?: readonly {
93
+ readonly tool_calls?: readonly ({
94
+ readonly id: string;
95
+ readonly type: "custom";
96
+ readonly custom: {
97
+ readonly name: string;
98
+ readonly input: string;
99
+ };
100
+ } | {
93
101
  readonly id: string;
94
102
  readonly type: "function";
95
103
  readonly function: {
@@ -101,13 +109,13 @@ export declare const protocol: Protocol<{
101
109
  readonly thought_signature: string;
102
110
  };
103
111
  } | undefined;
104
- }[] | undefined;
112
+ })[] | undefined;
105
113
  readonly reasoning_content?: string | undefined;
106
114
  readonly reasoning?: string | undefined;
107
115
  readonly reasoning_text?: string | undefined;
108
116
  readonly reasoning_details?: unknown;
109
117
  })[];
110
- readonly tools?: readonly {
118
+ readonly tools?: readonly ({
111
119
  readonly type: "function";
112
120
  readonly function: {
113
121
  readonly name: string;
@@ -121,12 +129,36 @@ export declare const protocol: Protocol<{
121
129
  readonly type: "ephemeral";
122
130
  readonly ttl?: string | undefined;
123
131
  } | undefined;
124
- }[] | undefined;
132
+ } | {
133
+ readonly type: "custom";
134
+ readonly custom: {
135
+ readonly name: string;
136
+ readonly description: string;
137
+ readonly format: {
138
+ readonly type: "text";
139
+ } | {
140
+ readonly type: "grammar";
141
+ readonly grammar: {
142
+ readonly syntax: "lark" | "regex";
143
+ readonly definition: string;
144
+ };
145
+ };
146
+ };
147
+ readonly cache_control?: {
148
+ readonly type: "ephemeral";
149
+ readonly ttl?: string | undefined;
150
+ } | undefined;
151
+ })[] | undefined;
125
152
  readonly tool_choice?: "auto" | "none" | "required" | {
126
153
  readonly type: "function";
127
154
  readonly function: {
128
155
  readonly name: string;
129
156
  };
157
+ } | {
158
+ readonly type: "custom";
159
+ readonly custom: {
160
+ readonly name: string;
161
+ };
130
162
  } | undefined;
131
163
  readonly stream: true;
132
164
  readonly stream_options?: {
@@ -174,6 +206,10 @@ export declare const protocol: Protocol<{
174
206
  readonly name?: string | null | undefined;
175
207
  readonly arguments?: string | null | undefined;
176
208
  } | null | undefined;
209
+ readonly custom?: {
210
+ readonly name?: string | null | undefined;
211
+ readonly input?: string | null | undefined;
212
+ } | null | undefined;
177
213
  readonly extra_content?: unknown;
178
214
  }[] | null | undefined;
179
215
  } | null | undefined;
@@ -304,7 +340,14 @@ export declare const route: Route<{
304
340
  readonly ttl?: string | undefined;
305
341
  } | undefined;
306
342
  }[] | null;
307
- readonly tool_calls?: readonly {
343
+ readonly tool_calls?: readonly ({
344
+ readonly id: string;
345
+ readonly type: "custom";
346
+ readonly custom: {
347
+ readonly name: string;
348
+ readonly input: string;
349
+ };
350
+ } | {
308
351
  readonly id: string;
309
352
  readonly type: "function";
310
353
  readonly function: {
@@ -316,13 +359,13 @@ export declare const route: Route<{
316
359
  readonly thought_signature: string;
317
360
  };
318
361
  } | undefined;
319
- }[] | undefined;
362
+ })[] | undefined;
320
363
  readonly reasoning_content?: string | undefined;
321
364
  readonly reasoning?: string | undefined;
322
365
  readonly reasoning_text?: string | undefined;
323
366
  readonly reasoning_details?: unknown;
324
367
  })[];
325
- readonly tools?: readonly {
368
+ readonly tools?: readonly ({
326
369
  readonly type: "function";
327
370
  readonly function: {
328
371
  readonly name: string;
@@ -336,12 +379,36 @@ export declare const route: Route<{
336
379
  readonly type: "ephemeral";
337
380
  readonly ttl?: string | undefined;
338
381
  } | undefined;
339
- }[] | undefined;
382
+ } | {
383
+ readonly type: "custom";
384
+ readonly custom: {
385
+ readonly name: string;
386
+ readonly description: string;
387
+ readonly format: {
388
+ readonly type: "text";
389
+ } | {
390
+ readonly type: "grammar";
391
+ readonly grammar: {
392
+ readonly syntax: "lark" | "regex";
393
+ readonly definition: string;
394
+ };
395
+ };
396
+ };
397
+ readonly cache_control?: {
398
+ readonly type: "ephemeral";
399
+ readonly ttl?: string | undefined;
400
+ } | undefined;
401
+ })[] | undefined;
340
402
  readonly tool_choice?: "auto" | "none" | "required" | {
341
403
  readonly type: "function";
342
404
  readonly function: {
343
405
  readonly name: string;
344
406
  };
407
+ } | {
408
+ readonly type: "custom";
409
+ readonly custom: {
410
+ readonly name: string;
411
+ };
345
412
  } | undefined;
346
413
  readonly stream: true;
347
414
  readonly stream_options?: {
@@ -371,7 +438,204 @@ export declare const route: Route<{
371
438
  readonly seed?: number | undefined;
372
439
  readonly stop?: readonly string[] | undefined;
373
440
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
374
- export declare const routes: Route<{
441
+ export declare const routes: (Route<{
442
+ readonly model: string;
443
+ readonly input: readonly ({
444
+ readonly type: "configuration_update";
445
+ readonly reasoning: {
446
+ readonly effort: import("../schema/options.js").ReasoningEffort;
447
+ };
448
+ } | {
449
+ readonly type: "message";
450
+ readonly role: "system";
451
+ readonly content: string;
452
+ } | {
453
+ readonly type: "message";
454
+ readonly role: "developer";
455
+ readonly content: string;
456
+ } | {
457
+ readonly type: "custom_tool_call_output" | "function_call_output";
458
+ readonly call_id: string;
459
+ readonly output: string | readonly ({
460
+ readonly type: "input_text";
461
+ readonly text: string;
462
+ } | {
463
+ readonly type: "input_video";
464
+ readonly video_url: string;
465
+ } | {
466
+ readonly type: "input_image";
467
+ readonly image_url: string;
468
+ readonly detail?: string | undefined;
469
+ } | {
470
+ readonly type: "input_file";
471
+ readonly filename: string;
472
+ readonly detail?: string | undefined;
473
+ readonly file_data?: string | undefined;
474
+ readonly file_url?: string | undefined;
475
+ })[];
476
+ } | {
477
+ readonly type: "reasoning";
478
+ readonly id?: string | undefined;
479
+ readonly summary: readonly {
480
+ readonly type: "summary_text";
481
+ readonly text: string;
482
+ }[];
483
+ readonly encrypted_content?: string | null | undefined;
484
+ } | {
485
+ readonly type: "compaction";
486
+ readonly id?: string | null | undefined;
487
+ readonly encrypted_content: string;
488
+ } | {
489
+ readonly type: "message";
490
+ readonly role: "user";
491
+ readonly content: readonly ({
492
+ readonly type: "input_text";
493
+ readonly text: string;
494
+ } | {
495
+ readonly type: "input_video";
496
+ readonly video_url: string;
497
+ } | {
498
+ readonly type: "input_image";
499
+ readonly image_url: string;
500
+ readonly detail?: string | undefined;
501
+ } | {
502
+ readonly type: "input_file";
503
+ readonly filename: string;
504
+ readonly detail?: string | undefined;
505
+ readonly file_data?: string | undefined;
506
+ readonly file_url?: string | undefined;
507
+ })[];
508
+ readonly id?: string | undefined;
509
+ readonly status?: string | undefined;
510
+ } | {
511
+ readonly type: "message";
512
+ readonly id?: string | undefined;
513
+ readonly role: "assistant";
514
+ readonly content: readonly {
515
+ readonly type: "output_text";
516
+ readonly text: string;
517
+ }[];
518
+ readonly phase?: "commentary" | "final_answer" | null | undefined;
519
+ readonly status?: string | undefined;
520
+ } | {
521
+ readonly type: "function_call";
522
+ readonly id?: string | undefined;
523
+ readonly call_id: string;
524
+ readonly name: string;
525
+ readonly namespace?: string | undefined;
526
+ readonly arguments: string;
527
+ } | {
528
+ readonly type: "custom_tool_call";
529
+ readonly id?: string | undefined;
530
+ readonly call_id: string;
531
+ readonly name: string;
532
+ readonly input: string;
533
+ } | {
534
+ readonly [x: string]: unknown;
535
+ readonly type: "web_search_call";
536
+ readonly id: string;
537
+ readonly status?: string | undefined;
538
+ readonly action?: {
539
+ readonly [x: string]: unknown;
540
+ } | null | undefined;
541
+ } | {
542
+ readonly [x: string]: unknown;
543
+ readonly type: "file_search_call";
544
+ readonly id: string;
545
+ readonly status?: string | undefined;
546
+ readonly queries?: readonly string[] | undefined;
547
+ readonly results?: readonly {
548
+ readonly [x: string]: unknown;
549
+ }[] | null | undefined;
550
+ } | {
551
+ readonly [x: string]: unknown;
552
+ readonly type: "code_interpreter_call";
553
+ readonly id: string;
554
+ readonly status?: string | undefined;
555
+ readonly code?: string | null | undefined;
556
+ readonly container_id?: string | null | undefined;
557
+ readonly outputs?: readonly {
558
+ readonly [x: string]: unknown;
559
+ }[] | null | undefined;
560
+ } | {
561
+ readonly [x: string]: unknown;
562
+ readonly type: "mcp_call";
563
+ readonly id: string;
564
+ readonly status?: string | undefined;
565
+ readonly server_label?: string | undefined;
566
+ readonly name?: string | undefined;
567
+ readonly arguments?: string | undefined;
568
+ readonly output?: string | null | undefined;
569
+ readonly error?: unknown;
570
+ } | {
571
+ readonly [x: string]: unknown;
572
+ readonly type: string;
573
+ readonly id: string;
574
+ })[];
575
+ readonly instructions?: string | undefined;
576
+ readonly tools?: readonly ({
577
+ readonly type: "custom";
578
+ readonly name: string;
579
+ readonly description: string;
580
+ readonly format: {
581
+ readonly type: "text";
582
+ } | {
583
+ readonly type: "grammar";
584
+ readonly syntax: "lark" | "regex";
585
+ readonly definition: string;
586
+ };
587
+ } | {
588
+ readonly type: "function";
589
+ readonly name: string;
590
+ readonly description: string;
591
+ readonly parameters: {
592
+ readonly [x: string]: unknown;
593
+ };
594
+ readonly strict?: boolean | undefined;
595
+ } | {
596
+ readonly [x: string]: unknown;
597
+ readonly type: string;
598
+ })[] | undefined;
599
+ readonly tool_choice?: "auto" | "none" | "required" | {
600
+ readonly type: "custom" | "function";
601
+ readonly name: string;
602
+ } | {
603
+ readonly type: "allowed_tools";
604
+ readonly mode: "auto" | "none" | "required";
605
+ readonly tools: readonly {
606
+ readonly type: "custom" | "function";
607
+ readonly name: string;
608
+ }[];
609
+ } | undefined;
610
+ readonly store?: boolean | undefined;
611
+ readonly metadata?: {
612
+ readonly [x: string]: string;
613
+ } | undefined;
614
+ readonly safety_identifier?: string | undefined;
615
+ readonly stream_options?: {
616
+ readonly include_obfuscation?: boolean | undefined;
617
+ } | undefined;
618
+ readonly top_logprobs?: number | undefined;
619
+ readonly truncation?: "auto" | "disabled" | undefined;
620
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
621
+ readonly prompt_cache_key?: string | undefined;
622
+ readonly include?: readonly import("../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">[] | undefined;
623
+ readonly reasoning?: {
624
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
625
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
626
+ } | undefined;
627
+ readonly text?: {
628
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
629
+ } | undefined;
630
+ readonly max_output_tokens?: number | undefined;
631
+ readonly max_tool_calls?: number | undefined;
632
+ readonly parallel_tool_calls?: boolean | undefined;
633
+ readonly temperature?: number | undefined;
634
+ readonly top_p?: number | undefined;
635
+ readonly presence_penalty?: number | undefined;
636
+ readonly frequency_penalty?: number | undefined;
637
+ readonly stream: true;
638
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | Route<{
375
639
  readonly model: string;
376
640
  readonly messages: readonly ({
377
641
  readonly role: "system";
@@ -447,7 +711,14 @@ export declare const routes: Route<{
447
711
  readonly ttl?: string | undefined;
448
712
  } | undefined;
449
713
  }[] | null;
450
- readonly tool_calls?: readonly {
714
+ readonly tool_calls?: readonly ({
715
+ readonly id: string;
716
+ readonly type: "custom";
717
+ readonly custom: {
718
+ readonly name: string;
719
+ readonly input: string;
720
+ };
721
+ } | {
451
722
  readonly id: string;
452
723
  readonly type: "function";
453
724
  readonly function: {
@@ -459,13 +730,13 @@ export declare const routes: Route<{
459
730
  readonly thought_signature: string;
460
731
  };
461
732
  } | undefined;
462
- }[] | undefined;
733
+ })[] | undefined;
463
734
  readonly reasoning_content?: string | undefined;
464
735
  readonly reasoning?: string | undefined;
465
736
  readonly reasoning_text?: string | undefined;
466
737
  readonly reasoning_details?: unknown;
467
738
  })[];
468
- readonly tools?: readonly {
739
+ readonly tools?: readonly ({
469
740
  readonly type: "function";
470
741
  readonly function: {
471
742
  readonly name: string;
@@ -479,12 +750,36 @@ export declare const routes: Route<{
479
750
  readonly type: "ephemeral";
480
751
  readonly ttl?: string | undefined;
481
752
  } | undefined;
482
- }[] | undefined;
753
+ } | {
754
+ readonly type: "custom";
755
+ readonly custom: {
756
+ readonly name: string;
757
+ readonly description: string;
758
+ readonly format: {
759
+ readonly type: "text";
760
+ } | {
761
+ readonly type: "grammar";
762
+ readonly grammar: {
763
+ readonly syntax: "lark" | "regex";
764
+ readonly definition: string;
765
+ };
766
+ };
767
+ };
768
+ readonly cache_control?: {
769
+ readonly type: "ephemeral";
770
+ readonly ttl?: string | undefined;
771
+ } | undefined;
772
+ })[] | undefined;
483
773
  readonly tool_choice?: "auto" | "none" | "required" | {
484
774
  readonly type: "function";
485
775
  readonly function: {
486
776
  readonly name: string;
487
777
  };
778
+ } | {
779
+ readonly type: "custom";
780
+ readonly custom: {
781
+ readonly name: string;
782
+ };
488
783
  } | undefined;
489
784
  readonly stream: true;
490
785
  readonly stream_options?: {
@@ -513,10 +808,11 @@ export declare const routes: Route<{
513
808
  readonly presence_penalty?: number | undefined;
514
809
  readonly seed?: number | undefined;
515
810
  readonly stop?: readonly string[] | undefined;
516
- }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
517
- export declare const configure: (input?: LanguageModelOptions) => {
811
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
812
+ export declare const configure: (input?: Config) => {
518
813
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
519
814
  model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
815
+ responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
520
816
  image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
521
817
  decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
522
818
  configure: typeof configure;
@@ -524,13 +820,16 @@ export declare const configure: (input?: LanguageModelOptions) => {
524
820
  export declare const provider: {
525
821
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
526
822
  model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
823
+ responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
527
824
  image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
528
825
  decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
529
826
  configure: typeof configure;
530
827
  };
531
828
  export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
532
829
  export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
533
- export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
534
- export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
535
- export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
830
+ export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
831
+ export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
832
+ export declare const responsesModel: ProviderPackage.Model<Settings<OpenResponsesProviderOptionsInput>, OpenResponsesProviderOptionsInput>;
833
+ export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
834
+ export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
536
835
  export * as DigitalOcean from "./digitalocean.js";
@@ -1,5 +1,6 @@
1
1
  import { OpenAIChat } from "../protocols/openai-chat.js";
2
2
  import { OpenAIImages } from "../protocols/openai-images.js";
3
+ import { OpenResponses } from "../protocols/open-responses.js";
3
4
  import { SystemOne } from "../protocols/system-one.js";
4
5
  import { cacheControl } from "../protocols/utils/cache.js";
5
6
  import { AuthOptions } from "../route/auth-options.js";
@@ -26,15 +27,22 @@ export const route = Route.make({
26
27
  endpoint: Endpoint.path("/chat/completions", { baseURL }),
27
28
  framing: OpenAIChat.framing,
28
29
  });
29
- export const routes = [route];
30
+ const responsesRoute = Route.make({
31
+ id: "digitalocean-responses",
32
+ provider: id,
33
+ providerMetadataKey: "digitalocean",
34
+ protocol: OpenResponses.protocol,
35
+ endpoint: Endpoint.path("/responses", { baseURL }),
36
+ transport: OpenResponses.httpTransport,
37
+ defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } },
38
+ });
39
+ export const routes = [route, responsesRoute];
30
40
  export const configure = (input = {}) => {
31
41
  const { apiKey: _apiKey, auth: _auth, baseURL: endpoint, ...defaults } = input;
32
42
  const auth = AuthOptions.bearer(input, ["DIGITALOCEAN_ACCESS_TOKEN", "DIGITALOCEAN_API_KEY", "DO_INFERENCE_API_KEY"]);
33
- const configured = route.with({
34
- ...defaults,
35
- endpoint: { baseURL: endpoint ?? baseURL },
36
- auth,
37
- });
43
+ const options = { ...defaults, endpoint: { baseURL: endpoint ?? baseURL }, auth };
44
+ const configured = route.with(options);
45
+ const configuredResponses = responsesRoute.with(options);
38
46
  const decisionRoute = SystemOne.route.with({
39
47
  provider: id,
40
48
  providerMetadataKey: "digitalocean",
@@ -55,6 +63,7 @@ export const configure = (input = {}) => {
55
63
  supportsPromptCacheKey: true,
56
64
  },
57
65
  }),
66
+ responses: (modelID) => configuredResponses.model({ id: modelID }),
58
67
  image,
59
68
  decision,
60
69
  configure,
@@ -63,7 +72,9 @@ export const configure = (input = {}) => {
63
72
  export const provider = configure();
64
73
  export const decision = provider.decision;
65
74
  export const image = provider.image;
75
+ export const responses = provider.responses;
66
76
  export const model = (modelID, settings) => configure(config(settings)).model(modelID);
77
+ export const responsesModel = (modelID, settings) => configure(config(settings)).responses(modelID);
67
78
  export const imageModel = (modelID, settings) => {
68
79
  const input = config(settings);
69
80
  return configure(input).image(modelID, input.providerOptions);
@@ -72,7 +83,7 @@ export const decisionModel = (modelID, settings) => {
72
83
  const input = config(settings);
73
84
  return configure(input).decision(modelID, input.providerOptions);
74
85
  };
75
- function config({ apiKey, baseURL, body, headers, ...providerOptions }) {
86
+ function config({ apiKey, baseURL, body, headers, ...providerOptions } = {}) {
76
87
  return {
77
88
  apiKey,
78
89
  baseURL,