@opencode-ai/ai 0.0.0-beta-18050 → 0.0.0-beta-18135

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 (35) hide show
  1. package/dist/protocols/anthropic-messages.d.ts +259 -17
  2. package/dist/protocols/anthropic-messages.js +337 -24
  3. package/dist/protocols/gemini.d.ts +4 -31
  4. package/dist/protocols/gemini.js +23 -4
  5. package/dist/protocols/open-responses.d.ts +8 -4
  6. package/dist/protocols/open-responses.js +73 -38
  7. package/dist/protocols/openai-chat.d.ts +25 -11
  8. package/dist/protocols/openai-chat.js +124 -8
  9. package/dist/protocols/openai-compatible-chat.d.ts +3 -1
  10. package/dist/protocols/openai-compatible-responses.d.ts +1 -1
  11. package/dist/protocols/openai-responses.d.ts +5 -5
  12. package/dist/protocols/openai-responses.js +21 -5
  13. package/dist/protocols/utils/bedrock-media.d.ts +1 -0
  14. package/dist/protocols/xai-responses.d.ts +1 -1
  15. package/dist/protocols/xai-responses.js +2 -10
  16. package/dist/providers/amazon-bedrock-mantle.d.ts +4 -2
  17. package/dist/providers/anthropic-compatible.d.ts +75 -4
  18. package/dist/providers/anthropic.d.ts +75 -4
  19. package/dist/providers/azure.d.ts +4 -2
  20. package/dist/providers/cloudflare.d.ts +9 -3
  21. package/dist/providers/google-vertex-chat.d.ts +3 -1
  22. package/dist/providers/google-vertex-messages.d.ts +75 -4
  23. package/dist/providers/google-vertex-responses.d.ts +1 -1
  24. package/dist/providers/google-vertex.d.ts +1 -1
  25. package/dist/providers/google.d.ts +1 -1
  26. package/dist/providers/openai-compatible-responses.d.ts +1 -1
  27. package/dist/providers/openai-compatible.d.ts +3 -1
  28. package/dist/providers/openai.d.ts +4 -2
  29. package/dist/providers/openrouter.d.ts +11 -3
  30. package/dist/providers/xai.d.ts +3 -1
  31. package/dist/schema/messages.d.ts +4 -0
  32. package/dist/schema/messages.js +2 -0
  33. package/dist/schema/options.d.ts +5 -0
  34. package/dist/schema/options.js +5 -0
  35. package/package.json +3 -3
@@ -27,6 +27,39 @@ export interface OptionsInput {
27
27
  readonly [key: string]: unknown;
28
28
  readonly thinking?: ThinkingInput;
29
29
  readonly effort?: string;
30
+ readonly service_tier?: "auto" | "standard_only";
31
+ readonly serviceTier?: "auto" | "standard_only";
32
+ readonly metadata?: {
33
+ readonly user_id?: string | null;
34
+ };
35
+ readonly container?: string | {
36
+ readonly id?: string | null;
37
+ readonly skills?: ReadonlyArray<Record<string, unknown>> | null;
38
+ };
39
+ readonly inference_geo?: string | null;
40
+ readonly inferenceGeo?: string | null;
41
+ readonly cache_control?: {
42
+ readonly type: "ephemeral";
43
+ readonly ttl?: "5m" | "1h";
44
+ };
45
+ readonly cacheControl?: {
46
+ readonly type: "ephemeral";
47
+ readonly ttl?: "5m" | "1h";
48
+ };
49
+ readonly output_config?: {
50
+ readonly effort?: string | null;
51
+ readonly format?: {
52
+ readonly type: "json_schema";
53
+ readonly schema: Record<string, unknown>;
54
+ } | null;
55
+ };
56
+ readonly outputConfig?: {
57
+ readonly effort?: string | null;
58
+ readonly format?: {
59
+ readonly type: "json_schema";
60
+ readonly schema: Record<string, unknown>;
61
+ } | null;
62
+ };
30
63
  }
31
64
  export type ProviderOptionsInput = OptionsInput;
32
65
  export declare const AnthropicMessagesBody: Schema.Struct<{
@@ -50,26 +83,50 @@ export declare const AnthropicMessagesBody: Schema.Struct<{
50
83
  }>>;
51
84
  }>, Schema.Struct<{
52
85
  readonly type: Schema.tag<"image">;
53
- readonly source: Schema.Struct<{
86
+ readonly source: Schema.Union<readonly [Schema.Struct<{
54
87
  readonly type: Schema.tag<"base64">;
55
88
  readonly media_type: Schema.String;
56
89
  readonly data: Schema.String;
57
- }>;
90
+ }>, Schema.Struct<{
91
+ readonly type: Schema.tag<"url">;
92
+ readonly url: Schema.String;
93
+ }>, Schema.Struct<{
94
+ readonly type: Schema.tag<"file">;
95
+ readonly file_id: Schema.String;
96
+ }>]>;
58
97
  readonly cache_control: Schema.optional<Schema.Struct<{
59
98
  readonly type: Schema.tag<"ephemeral">;
60
99
  readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
61
100
  }>>;
101
+ readonly transformations: Schema.optional<Schema.Struct<{
102
+ readonly oversized_image: Schema.optional<Schema.Literals<readonly ["downsize", "error"]>>;
103
+ }>>;
62
104
  }>, Schema.Struct<{
63
105
  readonly type: Schema.tag<"document">;
64
- readonly source: Schema.Struct<{
106
+ readonly source: Schema.Union<readonly [Schema.Struct<{
65
107
  readonly type: Schema.tag<"base64">;
66
108
  readonly media_type: Schema.Literal<"application/pdf">;
67
109
  readonly data: Schema.String;
68
- }>;
110
+ }>, Schema.Struct<{
111
+ readonly type: Schema.tag<"text">;
112
+ readonly media_type: Schema.Literal<"text/plain">;
113
+ readonly data: Schema.String;
114
+ }>, Schema.Struct<{
115
+ readonly type: Schema.tag<"url">;
116
+ readonly url: Schema.String;
117
+ }>, Schema.Struct<{
118
+ readonly type: Schema.tag<"file">;
119
+ readonly file_id: Schema.String;
120
+ }>]>;
69
121
  readonly cache_control: Schema.optional<Schema.Struct<{
70
122
  readonly type: Schema.tag<"ephemeral">;
71
123
  readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
72
124
  }>>;
125
+ readonly title: Schema.optional<Schema.String>;
126
+ readonly context: Schema.optional<Schema.String>;
127
+ readonly citations: Schema.optional<Schema.Struct<{
128
+ readonly enabled: Schema.Boolean;
129
+ }>>;
73
130
  }>, Schema.Struct<{
74
131
  readonly type: Schema.tag<"tool_result">;
75
132
  readonly tool_use_id: Schema.String;
@@ -82,26 +139,50 @@ export declare const AnthropicMessagesBody: Schema.Struct<{
82
139
  }>>;
83
140
  }>, Schema.Struct<{
84
141
  readonly type: Schema.tag<"image">;
85
- readonly source: Schema.Struct<{
142
+ readonly source: Schema.Union<readonly [Schema.Struct<{
86
143
  readonly type: Schema.tag<"base64">;
87
144
  readonly media_type: Schema.String;
88
145
  readonly data: Schema.String;
89
- }>;
146
+ }>, Schema.Struct<{
147
+ readonly type: Schema.tag<"url">;
148
+ readonly url: Schema.String;
149
+ }>, Schema.Struct<{
150
+ readonly type: Schema.tag<"file">;
151
+ readonly file_id: Schema.String;
152
+ }>]>;
90
153
  readonly cache_control: Schema.optional<Schema.Struct<{
91
154
  readonly type: Schema.tag<"ephemeral">;
92
155
  readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
93
156
  }>>;
157
+ readonly transformations: Schema.optional<Schema.Struct<{
158
+ readonly oversized_image: Schema.optional<Schema.Literals<readonly ["downsize", "error"]>>;
159
+ }>>;
94
160
  }>, Schema.Struct<{
95
161
  readonly type: Schema.tag<"document">;
96
- readonly source: Schema.Struct<{
162
+ readonly source: Schema.Union<readonly [Schema.Struct<{
97
163
  readonly type: Schema.tag<"base64">;
98
164
  readonly media_type: Schema.Literal<"application/pdf">;
99
165
  readonly data: Schema.String;
100
- }>;
166
+ }>, Schema.Struct<{
167
+ readonly type: Schema.tag<"text">;
168
+ readonly media_type: Schema.Literal<"text/plain">;
169
+ readonly data: Schema.String;
170
+ }>, Schema.Struct<{
171
+ readonly type: Schema.tag<"url">;
172
+ readonly url: Schema.String;
173
+ }>, Schema.Struct<{
174
+ readonly type: Schema.tag<"file">;
175
+ readonly file_id: Schema.String;
176
+ }>]>;
101
177
  readonly cache_control: Schema.optional<Schema.Struct<{
102
178
  readonly type: Schema.tag<"ephemeral">;
103
179
  readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
104
180
  }>>;
181
+ readonly title: Schema.optional<Schema.String>;
182
+ readonly context: Schema.optional<Schema.String>;
183
+ readonly citations: Schema.optional<Schema.Struct<{
184
+ readonly enabled: Schema.Boolean;
185
+ }>>;
105
186
  }>]>>]>;
106
187
  readonly is_error: Schema.optional<Schema.Boolean>;
107
188
  readonly cache_control: Schema.optional<Schema.Struct<{
@@ -121,7 +202,7 @@ export declare const AnthropicMessagesBody: Schema.Struct<{
121
202
  }>, Schema.Struct<{
122
203
  readonly type: Schema.tag<"thinking">;
123
204
  readonly thinking: Schema.String;
124
- readonly signature: Schema.optional<Schema.String>;
205
+ readonly signature: Schema.String;
125
206
  readonly cache_control: Schema.optional<Schema.Struct<{
126
207
  readonly type: Schema.tag<"ephemeral">;
127
208
  readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
@@ -182,9 +263,11 @@ export declare const AnthropicMessagesBody: Schema.Struct<{
182
263
  }>>>;
183
264
  tool_choice: Schema.optional<Schema.Union<readonly [Schema.Struct<{
184
265
  readonly type: Schema.Literals<readonly ["auto", "any", "none"]>;
266
+ readonly disable_parallel_tool_use: Schema.optional<Schema.Boolean>;
185
267
  }>, Schema.Struct<{
186
268
  readonly type: Schema.tag<"tool">;
187
269
  readonly name: Schema.String;
270
+ readonly disable_parallel_tool_use: Schema.optional<Schema.Boolean>;
188
271
  }>]>>;
189
272
  stream: Schema.Literal<true>;
190
273
  max_tokens: Schema.Number;
@@ -204,7 +287,24 @@ export declare const AnthropicMessagesBody: Schema.Struct<{
204
287
  }>]>>;
205
288
  output_config: Schema.optional<Schema.Struct<{
206
289
  readonly effort: Schema.optional<Schema.String>;
290
+ readonly format: Schema.optional<Schema.NullOr<Schema.Struct<{
291
+ readonly type: Schema.Literal<"json_schema">;
292
+ readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
293
+ }>>>;
294
+ }>>;
295
+ cache_control: Schema.optional<Schema.Struct<{
296
+ readonly type: Schema.tag<"ephemeral">;
297
+ readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
207
298
  }>>;
299
+ container: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Struct<{
300
+ readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
301
+ readonly skills: Schema.optional<Schema.NullOr<Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>>>;
302
+ }>]>>>;
303
+ inference_geo: Schema.optional<Schema.NullOr<Schema.String>>;
304
+ metadata: Schema.optional<Schema.Struct<{
305
+ readonly user_id: Schema.optional<Schema.NullOr<Schema.String>>;
306
+ }>>;
307
+ service_tier: Schema.optional<Schema.Literals<readonly ["auto", "standard_only"]>>;
208
308
  }>;
209
309
  export type AnthropicMessagesBody = Schema.Schema.Type<typeof AnthropicMessagesBody>;
210
310
  /**
@@ -230,22 +330,46 @@ export declare const protocol: Protocol<{
230
330
  readonly type: "base64";
231
331
  readonly media_type: string;
232
332
  readonly data: string;
333
+ } | {
334
+ readonly type: "url";
335
+ readonly url: string;
336
+ } | {
337
+ readonly type: "file";
338
+ readonly file_id: string;
233
339
  };
234
340
  readonly cache_control?: {
235
341
  readonly type: "ephemeral";
236
342
  readonly ttl?: "1h" | "5m" | undefined;
237
343
  } | undefined;
344
+ readonly transformations?: {
345
+ readonly oversized_image?: "error" | "downsize" | undefined;
346
+ } | undefined;
238
347
  } | {
239
348
  readonly type: "document";
240
349
  readonly source: {
241
350
  readonly type: "base64";
242
351
  readonly media_type: "application/pdf";
243
352
  readonly data: string;
353
+ } | {
354
+ readonly type: "text";
355
+ readonly media_type: "text/plain";
356
+ readonly data: string;
357
+ } | {
358
+ readonly type: "url";
359
+ readonly url: string;
360
+ } | {
361
+ readonly type: "file";
362
+ readonly file_id: string;
244
363
  };
364
+ readonly title?: string | undefined;
365
+ readonly context?: string | undefined;
245
366
  readonly cache_control?: {
246
367
  readonly type: "ephemeral";
247
368
  readonly ttl?: "1h" | "5m" | undefined;
248
369
  } | undefined;
370
+ readonly citations?: {
371
+ readonly enabled: boolean;
372
+ } | undefined;
249
373
  } | {
250
374
  readonly type: "tool_result";
251
375
  readonly content: string | readonly ({
@@ -261,22 +385,46 @@ export declare const protocol: Protocol<{
261
385
  readonly type: "base64";
262
386
  readonly media_type: string;
263
387
  readonly data: string;
388
+ } | {
389
+ readonly type: "url";
390
+ readonly url: string;
391
+ } | {
392
+ readonly type: "file";
393
+ readonly file_id: string;
264
394
  };
265
395
  readonly cache_control?: {
266
396
  readonly type: "ephemeral";
267
397
  readonly ttl?: "1h" | "5m" | undefined;
268
398
  } | undefined;
399
+ readonly transformations?: {
400
+ readonly oversized_image?: "error" | "downsize" | undefined;
401
+ } | undefined;
269
402
  } | {
270
403
  readonly type: "document";
271
404
  readonly source: {
272
405
  readonly type: "base64";
273
406
  readonly media_type: "application/pdf";
274
407
  readonly data: string;
408
+ } | {
409
+ readonly type: "text";
410
+ readonly media_type: "text/plain";
411
+ readonly data: string;
412
+ } | {
413
+ readonly type: "url";
414
+ readonly url: string;
415
+ } | {
416
+ readonly type: "file";
417
+ readonly file_id: string;
275
418
  };
419
+ readonly title?: string | undefined;
420
+ readonly context?: string | undefined;
276
421
  readonly cache_control?: {
277
422
  readonly type: "ephemeral";
278
423
  readonly ttl?: "1h" | "5m" | undefined;
279
424
  } | undefined;
425
+ readonly citations?: {
426
+ readonly enabled: boolean;
427
+ } | undefined;
280
428
  })[];
281
429
  readonly tool_use_id: string;
282
430
  readonly cache_control?: {
@@ -323,11 +471,11 @@ export declare const protocol: Protocol<{
323
471
  } | {
324
472
  readonly type: "thinking";
325
473
  readonly thinking: string;
474
+ readonly signature: string;
326
475
  readonly cache_control?: {
327
476
  readonly type: "ephemeral";
328
477
  readonly ttl?: "1h" | "5m" | undefined;
329
478
  } | undefined;
330
- readonly signature?: string | undefined;
331
479
  } | {
332
480
  readonly data: string;
333
481
  readonly type: "redacted_thinking";
@@ -348,6 +496,9 @@ export declare const protocol: Protocol<{
348
496
  }[];
349
497
  })[];
350
498
  readonly stream: true;
499
+ readonly metadata?: {
500
+ readonly user_id?: string | null | undefined;
501
+ } | undefined;
351
502
  readonly tools?: readonly {
352
503
  readonly description: string;
353
504
  readonly name: string;
@@ -378,18 +529,38 @@ export declare const protocol: Protocol<{
378
529
  } | {
379
530
  readonly type: "disabled";
380
531
  } | undefined;
532
+ readonly service_tier?: "auto" | "standard_only" | undefined;
533
+ readonly container?: string | {
534
+ readonly id?: string | null | undefined;
535
+ readonly skills?: readonly {
536
+ readonly [x: string]: unknown;
537
+ }[] | null | undefined;
538
+ } | null | undefined;
539
+ readonly inference_geo?: string | null | undefined;
540
+ readonly cache_control?: {
541
+ readonly type: "ephemeral";
542
+ readonly ttl?: "1h" | "5m" | undefined;
543
+ } | undefined;
544
+ readonly output_config?: {
545
+ readonly format?: {
546
+ readonly type: "json_schema";
547
+ readonly schema: {
548
+ readonly [x: string]: unknown;
549
+ };
550
+ } | null | undefined;
551
+ readonly effort?: string | undefined;
552
+ } | undefined;
381
553
  readonly tool_choice?: {
382
554
  readonly type: "auto" | "none" | "any";
555
+ readonly disable_parallel_tool_use?: boolean | undefined;
383
556
  } | {
384
557
  readonly type: "tool";
385
558
  readonly name: string;
559
+ readonly disable_parallel_tool_use?: boolean | undefined;
386
560
  } | undefined;
387
561
  readonly top_p?: number | undefined;
388
562
  readonly top_k?: number | undefined;
389
563
  readonly stop_sequences?: readonly string[] | undefined;
390
- readonly output_config?: {
391
- readonly effort?: string | undefined;
392
- } | undefined;
393
564
  }, string, {
394
565
  readonly type: string;
395
566
  readonly message?: {
@@ -473,22 +644,46 @@ export declare const route: Route<{
473
644
  readonly type: "base64";
474
645
  readonly media_type: string;
475
646
  readonly data: string;
647
+ } | {
648
+ readonly type: "url";
649
+ readonly url: string;
650
+ } | {
651
+ readonly type: "file";
652
+ readonly file_id: string;
476
653
  };
477
654
  readonly cache_control?: {
478
655
  readonly type: "ephemeral";
479
656
  readonly ttl?: "1h" | "5m" | undefined;
480
657
  } | undefined;
658
+ readonly transformations?: {
659
+ readonly oversized_image?: "error" | "downsize" | undefined;
660
+ } | undefined;
481
661
  } | {
482
662
  readonly type: "document";
483
663
  readonly source: {
484
664
  readonly type: "base64";
485
665
  readonly media_type: "application/pdf";
486
666
  readonly data: string;
667
+ } | {
668
+ readonly type: "text";
669
+ readonly media_type: "text/plain";
670
+ readonly data: string;
671
+ } | {
672
+ readonly type: "url";
673
+ readonly url: string;
674
+ } | {
675
+ readonly type: "file";
676
+ readonly file_id: string;
487
677
  };
678
+ readonly title?: string | undefined;
679
+ readonly context?: string | undefined;
488
680
  readonly cache_control?: {
489
681
  readonly type: "ephemeral";
490
682
  readonly ttl?: "1h" | "5m" | undefined;
491
683
  } | undefined;
684
+ readonly citations?: {
685
+ readonly enabled: boolean;
686
+ } | undefined;
492
687
  } | {
493
688
  readonly type: "tool_result";
494
689
  readonly content: string | readonly ({
@@ -504,22 +699,46 @@ export declare const route: Route<{
504
699
  readonly type: "base64";
505
700
  readonly media_type: string;
506
701
  readonly data: string;
702
+ } | {
703
+ readonly type: "url";
704
+ readonly url: string;
705
+ } | {
706
+ readonly type: "file";
707
+ readonly file_id: string;
507
708
  };
508
709
  readonly cache_control?: {
509
710
  readonly type: "ephemeral";
510
711
  readonly ttl?: "1h" | "5m" | undefined;
511
712
  } | undefined;
713
+ readonly transformations?: {
714
+ readonly oversized_image?: "error" | "downsize" | undefined;
715
+ } | undefined;
512
716
  } | {
513
717
  readonly type: "document";
514
718
  readonly source: {
515
719
  readonly type: "base64";
516
720
  readonly media_type: "application/pdf";
517
721
  readonly data: string;
722
+ } | {
723
+ readonly type: "text";
724
+ readonly media_type: "text/plain";
725
+ readonly data: string;
726
+ } | {
727
+ readonly type: "url";
728
+ readonly url: string;
729
+ } | {
730
+ readonly type: "file";
731
+ readonly file_id: string;
518
732
  };
733
+ readonly title?: string | undefined;
734
+ readonly context?: string | undefined;
519
735
  readonly cache_control?: {
520
736
  readonly type: "ephemeral";
521
737
  readonly ttl?: "1h" | "5m" | undefined;
522
738
  } | undefined;
739
+ readonly citations?: {
740
+ readonly enabled: boolean;
741
+ } | undefined;
523
742
  })[];
524
743
  readonly tool_use_id: string;
525
744
  readonly cache_control?: {
@@ -566,11 +785,11 @@ export declare const route: Route<{
566
785
  } | {
567
786
  readonly type: "thinking";
568
787
  readonly thinking: string;
788
+ readonly signature: string;
569
789
  readonly cache_control?: {
570
790
  readonly type: "ephemeral";
571
791
  readonly ttl?: "1h" | "5m" | undefined;
572
792
  } | undefined;
573
- readonly signature?: string | undefined;
574
793
  } | {
575
794
  readonly data: string;
576
795
  readonly type: "redacted_thinking";
@@ -591,6 +810,9 @@ export declare const route: Route<{
591
810
  }[];
592
811
  })[];
593
812
  readonly stream: true;
813
+ readonly metadata?: {
814
+ readonly user_id?: string | null | undefined;
815
+ } | undefined;
594
816
  readonly tools?: readonly {
595
817
  readonly description: string;
596
818
  readonly name: string;
@@ -621,17 +843,37 @@ export declare const route: Route<{
621
843
  } | {
622
844
  readonly type: "disabled";
623
845
  } | undefined;
846
+ readonly service_tier?: "auto" | "standard_only" | undefined;
847
+ readonly container?: string | {
848
+ readonly id?: string | null | undefined;
849
+ readonly skills?: readonly {
850
+ readonly [x: string]: unknown;
851
+ }[] | null | undefined;
852
+ } | null | undefined;
853
+ readonly inference_geo?: string | null | undefined;
854
+ readonly cache_control?: {
855
+ readonly type: "ephemeral";
856
+ readonly ttl?: "1h" | "5m" | undefined;
857
+ } | undefined;
858
+ readonly output_config?: {
859
+ readonly format?: {
860
+ readonly type: "json_schema";
861
+ readonly schema: {
862
+ readonly [x: string]: unknown;
863
+ };
864
+ } | null | undefined;
865
+ readonly effort?: string | undefined;
866
+ } | undefined;
624
867
  readonly tool_choice?: {
625
868
  readonly type: "auto" | "none" | "any";
869
+ readonly disable_parallel_tool_use?: boolean | undefined;
626
870
  } | {
627
871
  readonly type: "tool";
628
872
  readonly name: string;
873
+ readonly disable_parallel_tool_use?: boolean | undefined;
629
874
  } | undefined;
630
875
  readonly top_p?: number | undefined;
631
876
  readonly top_k?: number | undefined;
632
877
  readonly stop_sequences?: readonly string[] | undefined;
633
- readonly output_config?: {
634
- readonly effort?: string | undefined;
635
- } | undefined;
636
878
  }, import("../route/transport/http.js").HttpPrepared<string>>;
637
879
  export * as AnthropicMessages from "./anthropic-messages.js";