@opencode/ai 2.1.2 → 2.1.4

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 (140) hide show
  1. package/dist/cache-policy.js +6 -5
  2. package/dist/experimental/evaluation.d.ts +7 -6
  3. package/dist/experimental/evaluation.js +3 -11
  4. package/dist/experimental/realtime.d.ts +59 -0
  5. package/dist/experimental/realtime.js +21 -13
  6. package/dist/experimental.d.ts +1 -1
  7. package/dist/generation.js +1 -1
  8. package/dist/image-client.d.ts +11 -9
  9. package/dist/image.d.ts +158 -150
  10. package/dist/image.js +2 -2
  11. package/dist/llm.d.ts +2 -4
  12. package/dist/llm.js +2 -2
  13. package/dist/media-model.d.ts +2 -2
  14. package/dist/media-model.js +1 -1
  15. package/dist/promise.d.ts +121 -121
  16. package/dist/promise.js +3 -5
  17. package/dist/protocols/alibaba-chat.d.ts +18 -18
  18. package/dist/protocols/alibaba-chat.js +3 -3
  19. package/dist/protocols/alibaba-messages.d.ts +12 -12
  20. package/dist/protocols/alibaba-messages.js +1 -1
  21. package/dist/protocols/alibaba-responses.d.ts +38 -38
  22. package/dist/protocols/anthropic-messages.d.ts +40 -44
  23. package/dist/protocols/anthropic-messages.js +13 -15
  24. package/dist/protocols/bedrock-converse.d.ts +36 -85
  25. package/dist/protocols/bedrock-converse.js +6 -6
  26. package/dist/protocols/bedrock-event-stream.d.ts +6 -1
  27. package/dist/protocols/bedrock-event-stream.js +9 -8
  28. package/dist/protocols/cartesia-speech.d.ts +32 -32
  29. package/dist/protocols/cohere-chat.d.ts +13 -10
  30. package/dist/protocols/cohere-chat.js +2 -2
  31. package/dist/protocols/deepgram-speech.d.ts +32 -32
  32. package/dist/protocols/elevenlabs-speech.d.ts +32 -32
  33. package/dist/protocols/gemini.d.ts +46 -36
  34. package/dist/protocols/gemini.js +12 -15
  35. package/dist/protocols/google-interactions.d.ts +14 -13
  36. package/dist/protocols/google-interactions.js +16 -11
  37. package/dist/protocols/google-speech.d.ts +32 -32
  38. package/dist/protocols/google-transcription.d.ts +32 -32
  39. package/dist/protocols/meta-messages.d.ts +23 -23
  40. package/dist/protocols/meta-responses.d.ts +84 -84
  41. package/dist/protocols/mistral-chat.d.ts +81 -78
  42. package/dist/protocols/mistral-chat.js +3 -5
  43. package/dist/protocols/open-responses-channel.js +47 -46
  44. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  45. package/dist/protocols/open-responses-continuation.js +3 -1
  46. package/dist/protocols/open-responses.d.ts +419 -419
  47. package/dist/protocols/open-responses.js +11 -10
  48. package/dist/protocols/openai-chat.d.ts +68 -67
  49. package/dist/protocols/openai-chat.js +7 -8
  50. package/dist/protocols/openai-compatible-chat.d.ts +13 -14
  51. package/dist/protocols/openai-compatible-responses.d.ts +39 -40
  52. package/dist/protocols/openai-images.d.ts +32 -32
  53. package/dist/protocols/openai-responses.d.ts +253 -253
  54. package/dist/protocols/openai-responses.js +1 -1
  55. package/dist/protocols/openai-speech.d.ts +32 -32
  56. package/dist/protocols/openai-transcription.d.ts +32 -32
  57. package/dist/protocols/openai-transcription.js +12 -7
  58. package/dist/protocols/utils/open-responses-options.d.ts +8 -8
  59. package/dist/protocols/utils/open-responses-options.js +4 -6
  60. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  61. package/dist/protocols/utils/partial-json-options.js +0 -1
  62. package/dist/protocols/utils/partial-json.js +5 -4
  63. package/dist/protocols/utils/tool-schema.d.ts +0 -3
  64. package/dist/protocols/utils/tool-schema.js +0 -4
  65. package/dist/protocols/utils/tool-stream.d.ts +1 -1
  66. package/dist/protocols/venice-chat.d.ts +52 -53
  67. package/dist/protocols/venice-chat.js +6 -5
  68. package/dist/protocols/xai-images.js +3 -4
  69. package/dist/protocols/xai-responses.d.ts +81 -81
  70. package/dist/protocols/zai-chat.d.ts +33 -30
  71. package/dist/protocols/zai-chat.js +8 -3
  72. package/dist/protocols/zai-messages.d.ts +21 -19
  73. package/dist/protocols/zai-messages.js +3 -2
  74. package/dist/provider-error.js +8 -7
  75. package/dist/providers/alibaba.d.ts +74 -74
  76. package/dist/providers/amazon-bedrock-mantle.d.ts +202 -202
  77. package/dist/providers/amazon-bedrock.d.ts +16 -13
  78. package/dist/providers/anthropic-compatible.d.ts +13 -13
  79. package/dist/providers/anthropic.d.ts +13 -13
  80. package/dist/providers/azure.d.ts +112 -112
  81. package/dist/providers/baseten.d.ts +24 -24
  82. package/dist/providers/cerebras.d.ts +24 -24
  83. package/dist/providers/cloudflare-ai-gateway.d.ts +237 -234
  84. package/dist/providers/cloudflare-ai-gateway.js +3 -6
  85. package/dist/providers/cloudflare-workers-ai.d.ts +24 -24
  86. package/dist/providers/cohere.d.ts +78 -74
  87. package/dist/providers/deepinfra.d.ts +24 -24
  88. package/dist/providers/deepseek.d.ts +24 -24
  89. package/dist/providers/digitalocean.d.ts +36 -36
  90. package/dist/providers/fireworks.d.ts +24 -24
  91. package/dist/providers/google-vertex-chat.d.ts +12 -12
  92. package/dist/providers/google-vertex-interactions.d.ts +3 -3
  93. package/dist/providers/google-vertex-messages.d.ts +20 -20
  94. package/dist/providers/google-vertex-mistral.d.ts +14 -14
  95. package/dist/providers/google-vertex-responses.d.ts +38 -38
  96. package/dist/providers/google-vertex.d.ts +17 -17
  97. package/dist/providers/google-vertex.js +2 -2
  98. package/dist/providers/google.d.ts +79 -79
  99. package/dist/providers/groq.d.ts +24 -24
  100. package/dist/providers/meta.d.ts +189 -189
  101. package/dist/providers/minimax.d.ts +202 -202
  102. package/dist/providers/mistral.d.ts +28 -28
  103. package/dist/providers/moonshot.d.ts +202 -202
  104. package/dist/providers/open-responses-options.d.ts +0 -1
  105. package/dist/providers/open-responses-options.js +1 -1
  106. package/dist/providers/openai-compatible-responses.d.ts +38 -38
  107. package/dist/providers/openai-compatible.d.ts +12 -12
  108. package/dist/providers/openai-compatible.js +1 -1
  109. package/dist/providers/openai-options.d.ts +3 -4
  110. package/dist/providers/openai-options.js +0 -1
  111. package/dist/providers/openai.d.ts +103 -103
  112. package/dist/providers/openrouter.d.ts +171 -112
  113. package/dist/providers/openrouter.js +40 -33
  114. package/dist/providers/togetherai.d.ts +24 -24
  115. package/dist/providers/venice.d.ts +195 -20
  116. package/dist/providers/xai.d.ts +12 -12
  117. package/dist/providers/zai-coding-plan.d.ts +152 -72
  118. package/dist/providers/zai.d.ts +84 -19
  119. package/dist/route/auth-options.d.ts +0 -3
  120. package/dist/route/auth.d.ts +0 -2
  121. package/dist/route/auth.js +0 -2
  122. package/dist/route/client.d.ts +0 -218
  123. package/dist/route/client.js +3 -7
  124. package/dist/route/executor-service.js +1 -1
  125. package/dist/route/transport/http.js +5 -8
  126. package/dist/schema/errors.d.ts +1 -1
  127. package/dist/schema/errors.js +1 -1
  128. package/dist/schema/messages.js +4 -7
  129. package/dist/speech-client.d.ts +11 -9
  130. package/dist/speech.d.ts +158 -150
  131. package/dist/speech.js +2 -2
  132. package/dist/transcription-client.d.ts +11 -9
  133. package/dist/transcription.d.ts +158 -150
  134. package/dist/transcription.js +2 -2
  135. package/dist/video-client.d.ts +11 -9
  136. package/dist/video.d.ts +124 -116
  137. package/dist/video.js +2 -2
  138. package/package.json +7 -6
  139. package/dist/protocols/utils/openai-options.d.ts +0 -16
  140. package/dist/protocols/utils/openai-options.js +0 -15
@@ -13,92 +13,14 @@ export type GeminiProviderOptionsInput = Gemini.ProviderOptionsInput;
13
13
  export type GoogleInteractionsOptionsInput = GoogleInteractions.OptionsInput;
14
14
  export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
15
15
  export declare const routes: (import("../route/client.js").Route<{
16
- readonly model: string;
17
- readonly input: readonly ({
18
- readonly type: "model_output" | "user_input";
19
- readonly content: readonly ({
20
- readonly type: "audio" | "document" | "image" | "video";
21
- readonly data?: string | undefined;
22
- readonly uri?: string | undefined;
23
- readonly mime_type: string;
24
- } | {
25
- readonly type: "text";
26
- readonly text: string;
27
- })[];
28
- } | {
29
- readonly type: "thought";
30
- readonly signature?: string | undefined;
31
- readonly summary?: readonly {
32
- readonly type: "text";
33
- readonly text: string;
34
- }[] | undefined;
35
- } | {
36
- readonly type: "function_call";
37
- readonly id: string;
38
- readonly name: string;
39
- readonly arguments: unknown;
40
- readonly signature?: string | undefined;
41
- } | {
42
- readonly type: "function_result";
43
- readonly call_id: string;
44
- readonly name: string;
45
- readonly result: unknown;
46
- readonly is_error?: boolean | undefined;
47
- })[];
48
- readonly stream: true;
49
- readonly store: boolean;
50
- readonly previous_interaction_id?: string | undefined;
51
- readonly system_instruction?: string | undefined;
52
- readonly service_tier?: string | undefined;
53
- readonly tools?: readonly {
54
- readonly type: "function";
55
- readonly name: string;
56
- readonly description: string;
57
- readonly parameters: {
58
- readonly [x: string]: unknown;
59
- };
60
- }[] | undefined;
61
- readonly generation_config: {
62
- readonly max_output_tokens?: number | undefined;
63
- readonly temperature?: number | undefined;
64
- readonly top_p?: number | undefined;
65
- readonly seed?: number | undefined;
66
- readonly stop_sequences?: readonly string[] | undefined;
67
- readonly thinking_level?: import("../schema/options.js").OpenString<"high" | "low" | "medium" | "minimal"> | undefined;
68
- readonly thinking_summaries?: string | undefined;
69
- readonly tool_choice?: "any" | "auto" | "none" | {
70
- readonly allowed_tools: {
71
- readonly mode: "any";
72
- readonly tools: readonly string[];
73
- };
74
- } | undefined;
75
- };
76
- }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | import("../route/client.js").Route<{
77
16
  readonly cachedContent?: string | undefined;
78
17
  readonly contents: readonly {
79
18
  readonly role?: "model" | "user" | null | undefined;
80
19
  readonly parts?: readonly ({
81
- readonly text: string;
82
- readonly thought?: boolean | null | undefined;
83
- readonly thoughtSignature?: string | null | undefined;
84
- } | {
85
- readonly inlineData: {
86
- readonly mimeType: string;
87
- readonly data: string;
88
- };
89
- readonly thoughtSignature?: string | null | undefined;
90
- } | {
91
20
  readonly fileData: {
92
21
  readonly mimeType: string;
93
22
  readonly fileUri: string;
94
23
  };
95
- } | {
96
- readonly functionCall: {
97
- readonly id?: string | null | undefined;
98
- readonly name: string;
99
- readonly args?: unknown;
100
- };
101
- readonly thoughtSignature?: string | null | undefined;
102
24
  } | {
103
25
  readonly functionResponse: {
104
26
  readonly id?: string | undefined;
@@ -112,6 +34,23 @@ export declare const routes: (import("../route/client.js").Route<{
112
34
  readonly thoughtSignature?: string | null | undefined;
113
35
  }[] | undefined;
114
36
  };
37
+ } | {
38
+ readonly text: string;
39
+ readonly thought?: boolean | null | undefined;
40
+ readonly thoughtSignature?: string | null | undefined;
41
+ } | {
42
+ readonly inlineData: {
43
+ readonly mimeType: string;
44
+ readonly data: string;
45
+ };
46
+ readonly thoughtSignature?: string | null | undefined;
47
+ } | {
48
+ readonly functionCall: {
49
+ readonly id?: string | null | undefined;
50
+ readonly name: string;
51
+ readonly args?: unknown;
52
+ };
53
+ readonly thoughtSignature?: string | null | undefined;
115
54
  })[] | null | undefined;
116
55
  }[];
117
56
  readonly labels?: {
@@ -158,7 +97,68 @@ export declare const routes: (import("../route/client.js").Route<{
158
97
  } | undefined;
159
98
  } | undefined;
160
99
  readonly continuationToken?: string | undefined;
161
- }, Gemini.Prepared, import("../route/client.js").CompactionOperations | undefined>)[];
100
+ }, Gemini.Prepared, import("../route/client.js").CompactionOperations | undefined> | import("../route/client.js").Route<{
101
+ readonly model: string;
102
+ readonly input: readonly ({
103
+ readonly type: "model_output" | "user_input";
104
+ readonly content: readonly ({
105
+ readonly type: "text";
106
+ readonly text: string;
107
+ } | {
108
+ readonly type: "audio" | "document" | "image" | "video";
109
+ readonly data?: string | undefined;
110
+ readonly uri?: string | undefined;
111
+ readonly mime_type: string;
112
+ })[];
113
+ } | {
114
+ readonly type: "thought";
115
+ readonly signature?: string | undefined;
116
+ readonly summary?: readonly {
117
+ readonly type: "text";
118
+ readonly text: string;
119
+ }[] | undefined;
120
+ } | {
121
+ readonly type: "function_call";
122
+ readonly id: string;
123
+ readonly name: string;
124
+ readonly arguments: unknown;
125
+ readonly signature?: string | undefined;
126
+ } | {
127
+ readonly type: "function_result";
128
+ readonly call_id: string;
129
+ readonly name: string;
130
+ readonly result: unknown;
131
+ readonly is_error?: boolean | undefined;
132
+ })[];
133
+ readonly stream: true;
134
+ readonly store: boolean;
135
+ readonly previous_interaction_id?: string | undefined;
136
+ readonly system_instruction?: string | undefined;
137
+ readonly service_tier?: string | undefined;
138
+ readonly tools?: readonly {
139
+ readonly type: "function";
140
+ readonly name: string;
141
+ readonly description: string;
142
+ readonly parameters: {
143
+ readonly [x: string]: unknown;
144
+ };
145
+ }[] | undefined;
146
+ readonly generation_config: {
147
+ readonly max_output_tokens?: number | undefined;
148
+ readonly temperature?: number | undefined;
149
+ readonly top_p?: number | undefined;
150
+ readonly seed?: number | undefined;
151
+ readonly stop_sequences?: readonly string[] | undefined;
152
+ readonly thinking_level?: import("../schema/options.js").OpenString<"high" | "low" | "medium" | "minimal"> | undefined;
153
+ readonly thinking_summaries?: string | undefined;
154
+ readonly tool_choice?: "any" | "auto" | "none" | {
155
+ readonly allowed_tools: {
156
+ readonly mode: "any";
157
+ readonly tools: readonly string[];
158
+ };
159
+ } | undefined;
160
+ };
161
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
162
162
  export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
163
163
  readonly baseURL?: string;
164
164
  readonly providerOptions?: Gemini.ProviderOptionsInput & GoogleInteractions.ProviderOptionsInput;
@@ -26,13 +26,6 @@ export declare const protocol: Protocol<{
26
26
  readonly messages: readonly ({
27
27
  readonly role: "system";
28
28
  readonly content: string | readonly ({
29
- readonly type: "text";
30
- readonly text: string;
31
- readonly cache_control?: {
32
- readonly type: "ephemeral";
33
- readonly ttl?: string | undefined;
34
- } | undefined;
35
- } | {
36
29
  readonly type: "image_url";
37
30
  readonly image_url: {
38
31
  readonly url: string;
@@ -43,17 +36,17 @@ export declare const protocol: Protocol<{
43
36
  readonly filename: string;
44
37
  readonly file_data: string;
45
38
  };
46
- })[];
47
- } | {
48
- readonly role: "user";
49
- readonly content: string | readonly ({
39
+ } | {
50
40
  readonly type: "text";
51
41
  readonly text: string;
52
42
  readonly cache_control?: {
53
43
  readonly type: "ephemeral";
54
44
  readonly ttl?: string | undefined;
55
45
  } | undefined;
56
- } | {
46
+ })[];
47
+ } | {
48
+ readonly role: "user";
49
+ readonly content: string | readonly ({
57
50
  readonly type: "image_url";
58
51
  readonly image_url: {
59
52
  readonly url: string;
@@ -64,6 +57,13 @@ export declare const protocol: Protocol<{
64
57
  readonly filename: string;
65
58
  readonly file_data: string;
66
59
  };
60
+ } | {
61
+ readonly type: "text";
62
+ readonly text: string;
63
+ readonly cache_control?: {
64
+ readonly type: "ephemeral";
65
+ readonly ttl?: string | undefined;
66
+ } | undefined;
67
67
  })[];
68
68
  } | {
69
69
  readonly role: "tool";
@@ -225,13 +225,6 @@ export declare const route: Route<{
225
225
  readonly messages: readonly ({
226
226
  readonly role: "system";
227
227
  readonly content: string | readonly ({
228
- readonly type: "text";
229
- readonly text: string;
230
- readonly cache_control?: {
231
- readonly type: "ephemeral";
232
- readonly ttl?: string | undefined;
233
- } | undefined;
234
- } | {
235
228
  readonly type: "image_url";
236
229
  readonly image_url: {
237
230
  readonly url: string;
@@ -242,17 +235,17 @@ export declare const route: Route<{
242
235
  readonly filename: string;
243
236
  readonly file_data: string;
244
237
  };
245
- })[];
246
- } | {
247
- readonly role: "user";
248
- readonly content: string | readonly ({
238
+ } | {
249
239
  readonly type: "text";
250
240
  readonly text: string;
251
241
  readonly cache_control?: {
252
242
  readonly type: "ephemeral";
253
243
  readonly ttl?: string | undefined;
254
244
  } | undefined;
255
- } | {
245
+ })[];
246
+ } | {
247
+ readonly role: "user";
248
+ readonly content: string | readonly ({
256
249
  readonly type: "image_url";
257
250
  readonly image_url: {
258
251
  readonly url: string;
@@ -263,6 +256,13 @@ export declare const route: Route<{
263
256
  readonly filename: string;
264
257
  readonly file_data: string;
265
258
  };
259
+ } | {
260
+ readonly type: "text";
261
+ readonly text: string;
262
+ readonly cache_control?: {
263
+ readonly type: "ephemeral";
264
+ readonly ttl?: string | undefined;
265
+ } | undefined;
266
266
  })[];
267
267
  } | {
268
268
  readonly role: "tool";