@opencode/ai 2.0.32 → 2.1.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 (149) hide show
  1. package/dist/ai-client.d.ts +2 -2
  2. package/dist/experimental/evaluation-client.d.ts +1 -1
  3. package/dist/experimental/evaluation.d.ts +20 -20
  4. package/dist/experimental/realtime.d.ts +6 -14
  5. package/dist/experimental/realtime.js +28 -3
  6. package/dist/experimental/system-one.d.ts +1 -1
  7. package/dist/image-client.d.ts +8 -8
  8. package/dist/image.d.ts +593 -437
  9. package/dist/llm.d.ts +51 -51
  10. package/dist/media-client.d.ts +1 -1
  11. package/dist/media.d.ts +4 -4
  12. package/dist/promise.d.ts +199 -198
  13. package/dist/protocols/alibaba-chat.d.ts +81 -82
  14. package/dist/protocols/alibaba-chat.js +0 -1
  15. package/dist/protocols/alibaba-messages.d.ts +99 -99
  16. package/dist/protocols/alibaba-responses.d.ts +120 -120
  17. package/dist/protocols/anthropic-messages.d.ts +187 -187
  18. package/dist/protocols/anthropic-messages.js +3 -2
  19. package/dist/protocols/assemblyai-transcription.d.ts +1 -1
  20. package/dist/protocols/bedrock-converse.d.ts +75 -79
  21. package/dist/protocols/bfl-images.d.ts +1 -1
  22. package/dist/protocols/cartesia-speech.d.ts +17 -17
  23. package/dist/protocols/cohere-chat.d.ts +26 -23
  24. package/dist/protocols/cohere-chat.js +22 -1
  25. package/dist/protocols/deepgram-speech.d.ts +17 -17
  26. package/dist/protocols/deepgram-transcription.d.ts +1 -1
  27. package/dist/protocols/elevenlabs-speech.d.ts +17 -17
  28. package/dist/protocols/elevenlabs-transcription.d.ts +1 -1
  29. package/dist/protocols/fal-images.d.ts +1 -1
  30. package/dist/protocols/fal-video.d.ts +1 -1
  31. package/dist/protocols/gemini.d.ts +55 -55
  32. package/dist/protocols/google-images.d.ts +1 -1
  33. package/dist/protocols/google-interactions.d.ts +64 -62
  34. package/dist/protocols/google-interactions.js +19 -1
  35. package/dist/protocols/google-speech.d.ts +17 -17
  36. package/dist/protocols/google-transcription.d.ts +47 -47
  37. package/dist/protocols/google-video.d.ts +1 -1
  38. package/dist/protocols/meta-messages.d.ts +121 -121
  39. package/dist/protocols/meta-responses.d.ts +201 -201
  40. package/dist/protocols/mistral-chat.d.ts +45 -45
  41. package/dist/protocols/open-responses-channel.d.ts +1 -1
  42. package/dist/protocols/open-responses.d.ts +584 -450
  43. package/dist/protocols/open-responses.js +27 -35
  44. package/dist/protocols/openai-chat.d.ts +248 -248
  45. package/dist/protocols/openai-chat.js +11 -42
  46. package/dist/protocols/openai-compatible-chat.d.ts +32 -32
  47. package/dist/protocols/openai-compatible-responses.d.ts +88 -88
  48. package/dist/protocols/openai-images.d.ts +17 -17
  49. package/dist/protocols/openai-responses.d.ts +567 -567
  50. package/dist/protocols/openai-responses.js +1 -1
  51. package/dist/protocols/openai-speech.d.ts +17 -17
  52. package/dist/protocols/openai-transcription.d.ts +47 -47
  53. package/dist/protocols/replicate-images.d.ts +1 -1
  54. package/dist/protocols/runway-video.d.ts +1 -1
  55. package/dist/protocols/shared.d.ts +12 -1
  56. package/dist/protocols/shared.js +17 -1
  57. package/dist/protocols/stability-images.d.ts +2 -2
  58. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  59. package/dist/protocols/utils/bedrock-media.d.ts +4 -4
  60. package/dist/protocols/utils/openai-options.d.ts +1 -1
  61. package/dist/protocols/utils/speech-stream.d.ts +1 -1
  62. package/dist/protocols/utils/tool-schema.d.ts +10 -5
  63. package/dist/protocols/utils/tool-stream.d.ts +152 -152
  64. package/dist/protocols/venice-chat.d.ts +109 -110
  65. package/dist/protocols/venice-chat.js +0 -1
  66. package/dist/protocols/xai-images.d.ts +1 -1
  67. package/dist/protocols/xai-responses.d.ts +79 -79
  68. package/dist/protocols/xai-video.d.ts +1 -1
  69. package/dist/protocols/zai-chat.d.ts +77 -78
  70. package/dist/protocols/zai-chat.js +0 -1
  71. package/dist/protocols/zai-images.d.ts +1 -1
  72. package/dist/protocols/zai-messages.d.ts +97 -97
  73. package/dist/providers/alibaba.d.ts +222 -283
  74. package/dist/providers/amazon-bedrock-mantle.d.ts +291 -298
  75. package/dist/providers/amazon-bedrock.d.ts +22 -28
  76. package/dist/providers/anthropic-compatible.d.ts +86 -90
  77. package/dist/providers/anthropic.d.ts +86 -90
  78. package/dist/providers/assemblyai.d.ts +2 -6
  79. package/dist/providers/azure.d.ts +228 -238
  80. package/dist/providers/baseten.d.ts +66 -70
  81. package/dist/providers/black-forest-labs.d.ts +2 -6
  82. package/dist/providers/cartesia.d.ts +2 -6
  83. package/dist/providers/cerebras.d.ts +66 -70
  84. package/dist/providers/cerebras.js +0 -1
  85. package/dist/providers/cloudflare-ai-gateway.d.ts +352 -356
  86. package/dist/providers/cloudflare-workers-ai.d.ts +66 -70
  87. package/dist/providers/cohere.d.ts +122 -132
  88. package/dist/providers/cohere.js +0 -2
  89. package/dist/providers/deepgram.d.ts +2 -7
  90. package/dist/providers/deepinfra.d.ts +66 -70
  91. package/dist/providers/deepinfra.js +0 -1
  92. package/dist/providers/deepseek.d.ts +66 -70
  93. package/dist/providers/deepseek.js +1 -1
  94. package/dist/providers/digitalocean.d.ts +137 -141
  95. package/dist/providers/elevenlabs.d.ts +2 -7
  96. package/dist/providers/fal.d.ts +2 -7
  97. package/dist/providers/fireworks.d.ts +66 -70
  98. package/dist/providers/google-vertex-chat.d.ts +34 -38
  99. package/dist/providers/google-vertex-interactions.d.ts +31 -41
  100. package/dist/providers/google-vertex-messages.d.ts +81 -85
  101. package/dist/providers/google-vertex-mistral.d.ts +23 -27
  102. package/dist/providers/google-vertex-responses.d.ts +90 -94
  103. package/dist/providers/google-vertex.d.ts +26 -30
  104. package/dist/providers/google.d.ts +94 -109
  105. package/dist/providers/groq.d.ts +111 -115
  106. package/dist/providers/groq.js +0 -1
  107. package/dist/providers/meta.d.ts +309 -317
  108. package/dist/providers/meta.js +1 -1
  109. package/dist/providers/minimax.d.ts +296 -303
  110. package/dist/providers/minimax.js +1 -1
  111. package/dist/providers/mistral.d.ts +22 -26
  112. package/dist/providers/moonshot.d.ts +296 -303
  113. package/dist/providers/moonshot.js +0 -1
  114. package/dist/providers/openai-compatible-responses.d.ts +90 -94
  115. package/dist/providers/openai-compatible.d.ts +34 -38
  116. package/dist/providers/openai.d.ts +93 -108
  117. package/dist/providers/opencode.d.ts +2 -8
  118. package/dist/providers/openrouter.d.ts +137 -144
  119. package/dist/providers/replicate.d.ts +2 -6
  120. package/dist/providers/runway.d.ts +2 -6
  121. package/dist/providers/stability.d.ts +2 -7
  122. package/dist/providers/togetherai.d.ts +66 -70
  123. package/dist/providers/togetherai.js +1 -1
  124. package/dist/providers/typesafe-ai.d.ts +2 -8
  125. package/dist/providers/venice.d.ts +58 -63
  126. package/dist/providers/vercel-ai-gateway.d.ts +2 -12
  127. package/dist/providers/xai.d.ts +38 -50
  128. package/dist/providers/zai-coding-plan.d.ts +206 -213
  129. package/dist/providers/zai.d.ts +40 -46
  130. package/dist/route/client.d.ts +51 -51
  131. package/dist/route/media-protocol.d.ts +1 -1
  132. package/dist/route/transport/http.d.ts +1 -1
  133. package/dist/route/transport/websocket.d.ts +8 -8
  134. package/dist/schema/errors.d.ts +19 -19
  135. package/dist/schema/events.d.ts +3090 -3288
  136. package/dist/schema/messages.d.ts +8 -7
  137. package/dist/schema/options.d.ts +2 -1
  138. package/dist/schema/options.js +2 -1
  139. package/dist/speech-client.d.ts +8 -8
  140. package/dist/speech.d.ts +434 -398
  141. package/dist/testing.d.ts +338 -338
  142. package/dist/tool-runtime.d.ts +1 -1
  143. package/dist/transcription-client.d.ts +23 -23
  144. package/dist/transcription.d.ts +562 -646
  145. package/dist/utils/sanitize.d.ts +4 -0
  146. package/dist/utils/sanitize.js +23 -6
  147. package/dist/video-client.d.ts +8 -8
  148. package/dist/video.d.ts +416 -372
  149. package/package.json +6 -6
@@ -143,6 +143,7 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
143
143
  readonly document_url: string;
144
144
  })[];
145
145
  } | {
146
+ readonly role: "assistant";
146
147
  readonly content: string | readonly ({
147
148
  readonly [x: string]: unknown;
148
149
  readonly type: "thinking";
@@ -155,7 +156,6 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
155
156
  readonly type: "text";
156
157
  readonly text: string;
157
158
  })[];
158
- readonly role: "assistant";
159
159
  readonly tool_calls?: readonly {
160
160
  readonly id: string;
161
161
  readonly type: "function";
@@ -191,7 +191,7 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
191
191
  readonly strict: false;
192
192
  };
193
193
  }[] | undefined;
194
- tool_choice: "auto" | "none" | "any" | {
194
+ tool_choice: "any" | "auto" | "none" | {
195
195
  type: "function";
196
196
  function: {
197
197
  name: string;
@@ -260,6 +260,7 @@ export declare const protocol: Protocol<{
260
260
  readonly document_url: string;
261
261
  })[];
262
262
  } | {
263
+ readonly role: "assistant";
263
264
  readonly content: string | readonly ({
264
265
  readonly [x: string]: unknown;
265
266
  readonly type: "thinking";
@@ -272,7 +273,6 @@ export declare const protocol: Protocol<{
272
273
  readonly type: "text";
273
274
  readonly text: string;
274
275
  })[];
275
- readonly role: "assistant";
276
276
  readonly tool_calls?: readonly {
277
277
  readonly id: string;
278
278
  readonly type: "function";
@@ -297,9 +297,6 @@ export declare const protocol: Protocol<{
297
297
  readonly document_url: string;
298
298
  })[];
299
299
  })[];
300
- readonly stream: true;
301
- readonly max_tokens?: number | undefined;
302
- readonly temperature?: number | undefined;
303
300
  readonly tools?: readonly {
304
301
  readonly type: "function";
305
302
  readonly function: {
@@ -311,17 +308,20 @@ export declare const protocol: Protocol<{
311
308
  readonly strict: false;
312
309
  };
313
310
  }[] | undefined;
314
- readonly stop?: readonly string[] | undefined;
315
- readonly tool_choice?: "auto" | "none" | "any" | {
311
+ readonly tool_choice?: "any" | "auto" | "none" | {
316
312
  readonly type: "function";
317
313
  readonly function: {
318
314
  readonly name: string;
319
315
  };
320
316
  } | undefined;
317
+ readonly stream: true;
318
+ readonly max_tokens?: number | undefined;
319
+ readonly random_seed?: number | undefined;
320
+ readonly temperature?: number | undefined;
321
321
  readonly top_p?: number | undefined;
322
322
  readonly frequency_penalty?: number | undefined;
323
323
  readonly presence_penalty?: number | undefined;
324
- readonly random_seed?: number | undefined;
324
+ readonly stop?: readonly string[] | undefined;
325
325
  readonly prompt_cache_key?: string | undefined;
326
326
  readonly safe_prompt?: boolean | undefined;
327
327
  readonly document_image_limit?: number | undefined;
@@ -331,26 +331,6 @@ export declare const protocol: Protocol<{
331
331
  readonly prompt_mode?: "reasoning" | undefined;
332
332
  }, string, "[DONE]" | {
333
333
  readonly [x: string]: unknown;
334
- readonly error?: {
335
- readonly [x: string]: unknown;
336
- readonly message: string;
337
- readonly code?: string | number | null | undefined;
338
- } | null | undefined;
339
- readonly usage?: {
340
- readonly [x: string]: unknown;
341
- readonly total_tokens?: number | null | undefined;
342
- readonly prompt_tokens?: number | null | undefined;
343
- readonly completion_tokens?: number | null | undefined;
344
- readonly num_cached_tokens?: number | null | undefined;
345
- readonly prompt_token_details?: {
346
- readonly [x: string]: unknown;
347
- readonly cached_tokens?: number | null | undefined;
348
- } | null | undefined;
349
- readonly prompt_tokens_details?: {
350
- readonly [x: string]: unknown;
351
- readonly cached_tokens?: number | null | undefined;
352
- } | null | undefined;
353
- } | null | undefined;
354
334
  readonly choices?: readonly {
355
335
  readonly [x: string]: unknown;
356
336
  readonly delta?: {
@@ -362,18 +342,38 @@ export declare const protocol: Protocol<{
362
342
  readonly thinking?: unknown;
363
343
  }[] | null | undefined;
364
344
  readonly tool_calls?: readonly {
345
+ readonly index?: number | null | undefined;
346
+ readonly id?: string | null | undefined;
365
347
  readonly function?: {
366
348
  readonly name?: string | null | undefined;
367
349
  readonly arguments?: string | {
368
350
  readonly [x: string]: unknown;
369
351
  } | null | undefined;
370
352
  } | null | undefined;
371
- readonly id?: string | null | undefined;
372
- readonly index?: number | null | undefined;
373
353
  }[] | null | undefined;
374
354
  } | null | undefined;
375
355
  readonly finish_reason?: string | null | undefined;
376
356
  }[] | null | undefined;
357
+ readonly usage?: {
358
+ readonly [x: string]: unknown;
359
+ readonly prompt_tokens?: number | null | undefined;
360
+ readonly completion_tokens?: number | null | undefined;
361
+ readonly total_tokens?: number | null | undefined;
362
+ readonly num_cached_tokens?: number | null | undefined;
363
+ readonly prompt_token_details?: {
364
+ readonly [x: string]: unknown;
365
+ readonly cached_tokens?: number | null | undefined;
366
+ } | null | undefined;
367
+ readonly prompt_tokens_details?: {
368
+ readonly [x: string]: unknown;
369
+ readonly cached_tokens?: number | null | undefined;
370
+ } | null | undefined;
371
+ } | null | undefined;
372
+ readonly error?: {
373
+ readonly [x: string]: unknown;
374
+ readonly message: string;
375
+ readonly code?: string | number | null | undefined;
376
+ } | null | undefined;
377
377
  }, ParserState>;
378
378
  export declare const framing: Framing.Definition<string>;
379
379
  export declare const httpTransport: HttpTransport.HttpJsonTransport<{
@@ -397,6 +397,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
397
397
  readonly document_url: string;
398
398
  })[];
399
399
  } | {
400
+ readonly role: "assistant";
400
401
  readonly content: string | readonly ({
401
402
  readonly [x: string]: unknown;
402
403
  readonly type: "thinking";
@@ -409,7 +410,6 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
409
410
  readonly type: "text";
410
411
  readonly text: string;
411
412
  })[];
412
- readonly role: "assistant";
413
413
  readonly tool_calls?: readonly {
414
414
  readonly id: string;
415
415
  readonly type: "function";
@@ -434,9 +434,6 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
434
434
  readonly document_url: string;
435
435
  })[];
436
436
  })[];
437
- readonly stream: true;
438
- readonly max_tokens?: number | undefined;
439
- readonly temperature?: number | undefined;
440
437
  readonly tools?: readonly {
441
438
  readonly type: "function";
442
439
  readonly function: {
@@ -448,17 +445,20 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
448
445
  readonly strict: false;
449
446
  };
450
447
  }[] | undefined;
451
- readonly stop?: readonly string[] | undefined;
452
- readonly tool_choice?: "auto" | "none" | "any" | {
448
+ readonly tool_choice?: "any" | "auto" | "none" | {
453
449
  readonly type: "function";
454
450
  readonly function: {
455
451
  readonly name: string;
456
452
  };
457
453
  } | undefined;
454
+ readonly stream: true;
455
+ readonly max_tokens?: number | undefined;
456
+ readonly random_seed?: number | undefined;
457
+ readonly temperature?: number | undefined;
458
458
  readonly top_p?: number | undefined;
459
459
  readonly frequency_penalty?: number | undefined;
460
460
  readonly presence_penalty?: number | undefined;
461
- readonly random_seed?: number | undefined;
461
+ readonly stop?: readonly string[] | undefined;
462
462
  readonly prompt_cache_key?: string | undefined;
463
463
  readonly safe_prompt?: boolean | undefined;
464
464
  readonly document_image_limit?: number | undefined;
@@ -488,6 +488,7 @@ export declare const route: Route<{
488
488
  readonly document_url: string;
489
489
  })[];
490
490
  } | {
491
+ readonly role: "assistant";
491
492
  readonly content: string | readonly ({
492
493
  readonly [x: string]: unknown;
493
494
  readonly type: "thinking";
@@ -500,7 +501,6 @@ export declare const route: Route<{
500
501
  readonly type: "text";
501
502
  readonly text: string;
502
503
  })[];
503
- readonly role: "assistant";
504
504
  readonly tool_calls?: readonly {
505
505
  readonly id: string;
506
506
  readonly type: "function";
@@ -525,9 +525,6 @@ export declare const route: Route<{
525
525
  readonly document_url: string;
526
526
  })[];
527
527
  })[];
528
- readonly stream: true;
529
- readonly max_tokens?: number | undefined;
530
- readonly temperature?: number | undefined;
531
528
  readonly tools?: readonly {
532
529
  readonly type: "function";
533
530
  readonly function: {
@@ -539,17 +536,20 @@ export declare const route: Route<{
539
536
  readonly strict: false;
540
537
  };
541
538
  }[] | undefined;
542
- readonly stop?: readonly string[] | undefined;
543
- readonly tool_choice?: "auto" | "none" | "any" | {
539
+ readonly tool_choice?: "any" | "auto" | "none" | {
544
540
  readonly type: "function";
545
541
  readonly function: {
546
542
  readonly name: string;
547
543
  };
548
544
  } | undefined;
545
+ readonly stream: true;
546
+ readonly max_tokens?: number | undefined;
547
+ readonly random_seed?: number | undefined;
548
+ readonly temperature?: number | undefined;
549
549
  readonly top_p?: number | undefined;
550
550
  readonly frequency_penalty?: number | undefined;
551
551
  readonly presence_penalty?: number | undefined;
552
- readonly random_seed?: number | undefined;
552
+ readonly stop?: readonly string[] | undefined;
553
553
  readonly prompt_cache_key?: string | undefined;
554
554
  readonly safe_prompt?: boolean | undefined;
555
555
  readonly document_image_limit?: number | undefined;
@@ -21,5 +21,5 @@ export interface Prepared {
21
21
  }
22
22
  export declare const transport: <Body>(options: Options) => Transport<Body, Prepared, string>;
23
23
  export declare const OpenResponsesChannel: {
24
- readonly transport: <Body>(options: Options) => Transport<Body, Prepared, string>;
24
+ readonly transport: typeof transport;
25
25
  };