@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
@@ -22,10 +22,6 @@ export type Settings<Options = ChatOptionsInput> = ProviderPackage.Settings & Op
22
22
  export declare const routes: (Route<{
23
23
  readonly model: string;
24
24
  readonly input: readonly ({
25
- readonly type: "compaction";
26
- readonly id?: string | null | undefined;
27
- readonly encrypted_content: string;
28
- } | {
29
25
  readonly type: "configuration_update";
30
26
  readonly reasoning: {
31
27
  readonly effort: import("../schema/options.js").ReasoningEffort;
@@ -38,10 +34,45 @@ export declare const routes: (Route<{
38
34
  readonly type: "message";
39
35
  readonly role: "developer";
40
36
  readonly content: string;
37
+ } | {
38
+ readonly type: "function_call_output";
39
+ readonly call_id: string;
40
+ readonly output: string | readonly ({
41
+ readonly type: "input_text";
42
+ readonly text: string;
43
+ } | {
44
+ readonly type: "input_video";
45
+ readonly video_url: string;
46
+ } | {
47
+ readonly type: "input_image";
48
+ readonly image_url: string;
49
+ readonly detail?: string | undefined;
50
+ } | {
51
+ readonly type: "input_file";
52
+ readonly filename: string;
53
+ readonly detail?: string | undefined;
54
+ readonly file_data?: string | undefined;
55
+ readonly file_url?: string | undefined;
56
+ })[];
57
+ } | {
58
+ readonly type: "reasoning";
59
+ readonly id?: string | undefined;
60
+ readonly summary: readonly {
61
+ readonly type: "summary_text";
62
+ readonly text: string;
63
+ }[];
64
+ readonly encrypted_content?: string | null | undefined;
65
+ } | {
66
+ readonly type: "compaction";
67
+ readonly id?: string | null | undefined;
68
+ readonly encrypted_content: string;
41
69
  } | {
42
70
  readonly type: "message";
43
71
  readonly role: "user";
44
72
  readonly content: readonly ({
73
+ readonly type: "input_text";
74
+ readonly text: string;
75
+ } | {
45
76
  readonly type: "input_image";
46
77
  readonly image_url: string;
47
78
  readonly detail?: string | undefined;
@@ -51,9 +82,6 @@ export declare const routes: (Route<{
51
82
  readonly detail?: string | undefined;
52
83
  readonly file_data?: string | undefined;
53
84
  readonly file_url?: string | undefined;
54
- } | {
55
- readonly type: "input_text";
56
- readonly text: string;
57
85
  })[];
58
86
  readonly id?: string | undefined;
59
87
  readonly status?: string | undefined;
@@ -67,14 +95,6 @@ export declare const routes: (Route<{
67
95
  }[];
68
96
  readonly phase?: "commentary" | "final_answer" | null | undefined;
69
97
  readonly status?: string | undefined;
70
- } | {
71
- readonly type: "reasoning";
72
- readonly id?: string | undefined;
73
- readonly summary: readonly {
74
- readonly type: "summary_text";
75
- readonly text: string;
76
- }[];
77
- readonly encrypted_content?: string | null | undefined;
78
98
  } | {
79
99
  readonly type: "function_call";
80
100
  readonly id?: string | undefined;
@@ -82,26 +102,6 @@ export declare const routes: (Route<{
82
102
  readonly name: string;
83
103
  readonly namespace?: string | undefined;
84
104
  readonly arguments: string;
85
- } | {
86
- readonly type: "function_call_output";
87
- readonly call_id: string;
88
- readonly output: string | readonly ({
89
- readonly type: "input_image";
90
- readonly image_url: string;
91
- readonly detail?: string | undefined;
92
- } | {
93
- readonly type: "input_file";
94
- readonly filename: string;
95
- readonly detail?: string | undefined;
96
- readonly file_data?: string | undefined;
97
- readonly file_url?: string | undefined;
98
- } | {
99
- readonly type: "input_text";
100
- readonly text: string;
101
- } | {
102
- readonly type: "input_video";
103
- readonly video_url: string;
104
- })[];
105
105
  } | {
106
106
  readonly [x: string]: unknown;
107
107
  readonly type: "web_search_call";
@@ -178,15 +178,15 @@ export declare const routes: (Route<{
178
178
  } | undefined;
179
179
  readonly top_logprobs?: number | undefined;
180
180
  readonly truncation?: "auto" | "disabled" | undefined;
181
- readonly service_tier?: import("../protocols/utils/open-responses-options.js").ServiceTier | undefined;
181
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
182
182
  readonly prompt_cache_key?: string | undefined;
183
- readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
183
+ 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;
184
184
  readonly reasoning?: {
185
185
  readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
186
186
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
187
187
  } | undefined;
188
188
  readonly text?: {
189
- readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
189
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
190
190
  } | undefined;
191
191
  readonly max_output_tokens?: number | undefined;
192
192
  readonly max_tool_calls?: number | undefined;
@@ -201,13 +201,6 @@ export declare const routes: (Route<{
201
201
  readonly messages: readonly ({
202
202
  readonly role: "system";
203
203
  readonly content: string | readonly ({
204
- readonly type: "text";
205
- readonly text: string;
206
- readonly cache_control?: {
207
- readonly type: "ephemeral";
208
- readonly ttl?: string | undefined;
209
- } | undefined;
210
- } | {
211
204
  readonly type: "image_url";
212
205
  readonly image_url: {
213
206
  readonly url: string;
@@ -218,17 +211,17 @@ export declare const routes: (Route<{
218
211
  readonly filename: string;
219
212
  readonly file_data: string;
220
213
  };
221
- })[];
222
- } | {
223
- readonly role: "user";
224
- readonly content: string | readonly ({
214
+ } | {
225
215
  readonly type: "text";
226
216
  readonly text: string;
227
217
  readonly cache_control?: {
228
218
  readonly type: "ephemeral";
229
219
  readonly ttl?: string | undefined;
230
220
  } | undefined;
231
- } | {
221
+ })[];
222
+ } | {
223
+ readonly role: "user";
224
+ readonly content: string | readonly ({
232
225
  readonly type: "image_url";
233
226
  readonly image_url: {
234
227
  readonly url: string;
@@ -239,6 +232,13 @@ export declare const routes: (Route<{
239
232
  readonly filename: string;
240
233
  readonly file_data: string;
241
234
  };
235
+ } | {
236
+ readonly type: "text";
237
+ readonly text: string;
238
+ readonly cache_control?: {
239
+ readonly type: "ephemeral";
240
+ readonly ttl?: string | undefined;
241
+ } | undefined;
242
242
  })[];
243
243
  } | {
244
244
  readonly role: "tool";
@@ -318,12 +318,12 @@ export declare const routes: (Route<{
318
318
  readonly seed?: number | undefined;
319
319
  readonly stop?: readonly string[] | undefined;
320
320
  readonly thinking?: {
321
- readonly type?: string | undefined;
321
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
322
322
  readonly clear_thinking?: boolean | undefined;
323
323
  } | undefined;
324
324
  readonly do_sample?: boolean | undefined;
325
325
  readonly response_format?: {
326
- readonly type: string;
326
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
327
327
  } | undefined;
328
328
  readonly request_id?: string | undefined;
329
329
  readonly user_id?: string | undefined;
@@ -469,23 +469,15 @@ export declare const routes: (Route<{
469
469
  } | {
470
470
  readonly role: "assistant";
471
471
  readonly content: readonly ({
472
+ readonly type: "compaction";
473
+ readonly content: string | null;
474
+ } | {
472
475
  readonly type: "text";
473
476
  readonly text: string;
474
477
  readonly cache_control?: {
475
478
  readonly type: "ephemeral";
476
479
  readonly ttl?: "1h" | "5m" | undefined;
477
480
  } | undefined;
478
- } | {
479
- readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
480
- readonly tool_use_id: string;
481
- readonly content: unknown;
482
- readonly cache_control?: {
483
- readonly type: "ephemeral";
484
- readonly ttl?: "1h" | "5m" | undefined;
485
- } | undefined;
486
- } | {
487
- readonly type: "compaction";
488
- readonly content: string | null;
489
481
  } | {
490
482
  readonly type: "thinking";
491
483
  readonly thinking: string;
@@ -519,6 +511,14 @@ export declare const routes: (Route<{
519
511
  readonly type: "ephemeral";
520
512
  readonly ttl?: "1h" | "5m" | undefined;
521
513
  } | undefined;
514
+ } | {
515
+ readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
516
+ readonly tool_use_id: string;
517
+ readonly content: unknown;
518
+ readonly cache_control?: {
519
+ readonly type: "ephemeral";
520
+ readonly ttl?: "1h" | "5m" | undefined;
521
+ } | undefined;
522
522
  })[];
523
523
  } | {
524
524
  readonly role: "system";
@@ -584,27 +584,107 @@ export declare const routes: (Route<{
584
584
  } | undefined;
585
585
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
586
586
  readonly thinking?: {
587
- readonly type: string;
587
+ readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
588
588
  } | undefined;
589
589
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
590
590
  export declare const configure: (input?: Config) => {
591
591
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
592
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
593
- chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
594
- messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIMessages.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
592
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
593
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
594
+ readonly thinking?: {
595
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
596
+ readonly clear_thinking?: boolean | undefined;
597
+ } | undefined;
598
+ readonly toolStream?: boolean | undefined;
599
+ readonly doSample?: boolean | undefined;
600
+ readonly responseFormat?: {
601
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
602
+ } | undefined;
603
+ readonly requestID?: string | undefined;
604
+ readonly userID?: string | undefined;
605
+ }, import("../route/client.js").CompactionOperations | undefined>;
606
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
607
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
608
+ readonly thinking?: {
609
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
610
+ readonly clear_thinking?: boolean | undefined;
611
+ } | undefined;
612
+ readonly toolStream?: boolean | undefined;
613
+ readonly doSample?: boolean | undefined;
614
+ readonly responseFormat?: {
615
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
616
+ } | undefined;
617
+ readonly requestID?: string | undefined;
618
+ readonly userID?: string | undefined;
619
+ }, import("../route/client.js").CompactionOperations | undefined>;
620
+ messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
621
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
622
+ readonly thinking?: {
623
+ readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
624
+ } | undefined;
625
+ }, import("../route/client.js").CompactionOperations | undefined>;
595
626
  responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
596
627
  configure: typeof configure;
597
628
  };
598
629
  export declare const provider: {
599
630
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
600
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
601
- chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
602
- messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIMessages.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
631
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
632
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
633
+ readonly thinking?: {
634
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
635
+ readonly clear_thinking?: boolean | undefined;
636
+ } | undefined;
637
+ readonly toolStream?: boolean | undefined;
638
+ readonly doSample?: boolean | undefined;
639
+ readonly responseFormat?: {
640
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
641
+ } | undefined;
642
+ readonly requestID?: string | undefined;
643
+ readonly userID?: string | undefined;
644
+ }, import("../route/client.js").CompactionOperations | undefined>;
645
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
646
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
647
+ readonly thinking?: {
648
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
649
+ readonly clear_thinking?: boolean | undefined;
650
+ } | undefined;
651
+ readonly toolStream?: boolean | undefined;
652
+ readonly doSample?: boolean | undefined;
653
+ readonly responseFormat?: {
654
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
655
+ } | undefined;
656
+ readonly requestID?: string | undefined;
657
+ readonly userID?: string | undefined;
658
+ }, import("../route/client.js").CompactionOperations | undefined>;
659
+ messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
660
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
661
+ readonly thinking?: {
662
+ readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
663
+ } | undefined;
664
+ }, import("../route/client.js").CompactionOperations | undefined>;
603
665
  responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
604
666
  configure: typeof configure;
605
667
  };
606
- export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
607
- export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIMessages.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
668
+ export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
669
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
670
+ readonly thinking?: {
671
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
672
+ readonly clear_thinking?: boolean | undefined;
673
+ } | undefined;
674
+ readonly toolStream?: boolean | undefined;
675
+ readonly doSample?: boolean | undefined;
676
+ readonly responseFormat?: {
677
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
678
+ } | undefined;
679
+ readonly requestID?: string | undefined;
680
+ readonly userID?: string | undefined;
681
+ }, import("../route/client.js").CompactionOperations | undefined>;
682
+ export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
683
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
684
+ readonly thinking?: {
685
+ readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
686
+ } | undefined;
687
+ }, import("../route/client.js").CompactionOperations | undefined>;
608
688
  export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
609
689
  export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
610
690
  export * as ZAICodingPlan from "./zai-coding-plan.js";
@@ -19,13 +19,6 @@ export declare const routes: Route<{
19
19
  readonly messages: readonly ({
20
20
  readonly role: "system";
21
21
  readonly content: string | readonly ({
22
- readonly type: "text";
23
- readonly text: string;
24
- readonly cache_control?: {
25
- readonly type: "ephemeral";
26
- readonly ttl?: string | undefined;
27
- } | undefined;
28
- } | {
29
22
  readonly type: "image_url";
30
23
  readonly image_url: {
31
24
  readonly url: string;
@@ -36,17 +29,17 @@ export declare const routes: Route<{
36
29
  readonly filename: string;
37
30
  readonly file_data: string;
38
31
  };
39
- })[];
40
- } | {
41
- readonly role: "user";
42
- readonly content: string | readonly ({
32
+ } | {
43
33
  readonly type: "text";
44
34
  readonly text: string;
45
35
  readonly cache_control?: {
46
36
  readonly type: "ephemeral";
47
37
  readonly ttl?: string | undefined;
48
38
  } | undefined;
49
- } | {
39
+ })[];
40
+ } | {
41
+ readonly role: "user";
42
+ readonly content: string | readonly ({
50
43
  readonly type: "image_url";
51
44
  readonly image_url: {
52
45
  readonly url: string;
@@ -57,6 +50,13 @@ export declare const routes: Route<{
57
50
  readonly filename: string;
58
51
  readonly file_data: string;
59
52
  };
53
+ } | {
54
+ readonly type: "text";
55
+ readonly text: string;
56
+ readonly cache_control?: {
57
+ readonly type: "ephemeral";
58
+ readonly ttl?: string | undefined;
59
+ } | undefined;
60
60
  })[];
61
61
  } | {
62
62
  readonly role: "tool";
@@ -136,31 +136,96 @@ export declare const routes: Route<{
136
136
  readonly seed?: number | undefined;
137
137
  readonly stop?: readonly string[] | undefined;
138
138
  readonly thinking?: {
139
- readonly type?: string | undefined;
139
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
140
140
  readonly clear_thinking?: boolean | undefined;
141
141
  } | undefined;
142
142
  readonly do_sample?: boolean | undefined;
143
143
  readonly response_format?: {
144
- readonly type: string;
144
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
145
145
  } | undefined;
146
146
  readonly request_id?: string | undefined;
147
147
  readonly user_id?: string | undefined;
148
148
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
149
149
  export declare const configure: (input?: Config) => {
150
150
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
151
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
152
- chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
151
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
152
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
153
+ readonly thinking?: {
154
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
155
+ readonly clear_thinking?: boolean | undefined;
156
+ } | undefined;
157
+ readonly toolStream?: boolean | undefined;
158
+ readonly doSample?: boolean | undefined;
159
+ readonly responseFormat?: {
160
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
161
+ } | undefined;
162
+ readonly requestID?: string | undefined;
163
+ readonly userID?: string | undefined;
164
+ }, import("../route/client.js").CompactionOperations | undefined>;
165
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
166
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
167
+ readonly thinking?: {
168
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
169
+ readonly clear_thinking?: boolean | undefined;
170
+ } | undefined;
171
+ readonly toolStream?: boolean | undefined;
172
+ readonly doSample?: boolean | undefined;
173
+ readonly responseFormat?: {
174
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
175
+ } | undefined;
176
+ readonly requestID?: string | undefined;
177
+ readonly userID?: string | undefined;
178
+ }, import("../route/client.js").CompactionOperations | undefined>;
153
179
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("./zai.js").ZAIImageOptions>;
154
180
  configure: typeof configure;
155
181
  };
156
182
  export declare const provider: {
157
183
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
158
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
159
- chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
184
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
185
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
186
+ readonly thinking?: {
187
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
188
+ readonly clear_thinking?: boolean | undefined;
189
+ } | undefined;
190
+ readonly toolStream?: boolean | undefined;
191
+ readonly doSample?: boolean | undefined;
192
+ readonly responseFormat?: {
193
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
194
+ } | undefined;
195
+ readonly requestID?: string | undefined;
196
+ readonly userID?: string | undefined;
197
+ }, import("../route/client.js").CompactionOperations | undefined>;
198
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
199
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
200
+ readonly thinking?: {
201
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
202
+ readonly clear_thinking?: boolean | undefined;
203
+ } | undefined;
204
+ readonly toolStream?: boolean | undefined;
205
+ readonly doSample?: boolean | undefined;
206
+ readonly responseFormat?: {
207
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
208
+ } | undefined;
209
+ readonly requestID?: string | undefined;
210
+ readonly userID?: string | undefined;
211
+ }, import("../route/client.js").CompactionOperations | undefined>;
160
212
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("./zai.js").ZAIImageOptions>;
161
213
  configure: typeof configure;
162
214
  };
163
215
  export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("./zai.js").ZAIImageOptions>;
164
- export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ZAIChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
216
+ export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
217
+ readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
218
+ readonly thinking?: {
219
+ readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
220
+ readonly clear_thinking?: boolean | undefined;
221
+ } | undefined;
222
+ readonly toolStream?: boolean | undefined;
223
+ readonly doSample?: boolean | undefined;
224
+ readonly responseFormat?: {
225
+ readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
226
+ } | undefined;
227
+ readonly requestID?: string | undefined;
228
+ readonly userID?: string | undefined;
229
+ }, import("../route/client.js").CompactionOperations | undefined>;
165
230
  export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
166
231
  export * as ZAI from "./zai.js";
@@ -14,9 +14,6 @@ export type RequiredApiKeyAuth = {
14
14
  readonly auth?: never;
15
15
  };
16
16
  export type ProviderAuthOption<Mode extends ApiKeyMode> = AuthOverride | (Mode extends "optional" ? OptionalApiKeyAuth : RequiredApiKeyAuth);
17
- export type LanguageModelOptions<Base, Mode extends ApiKeyMode> = Omit<Base, "apiKey" | "auth"> & ProviderAuthOption<Mode>;
18
- export type LanguageModelArgs<Base, Mode extends ApiKeyMode> = Mode extends "optional" ? readonly [options?: LanguageModelOptions<Base, Mode>] : readonly [options: LanguageModelOptions<Base, Mode>];
19
- export type LanguageModelFactory<Base, Mode extends ApiKeyMode, LanguageModel> = (id: string, ...args: LanguageModelArgs<Base, Mode>) => LanguageModel;
20
17
  /**
21
18
  * Require at least one of the keys in `T`. Use for option shapes where any
22
19
  * subset of fields is acceptable but at least one must be present (e.g. Azure
@@ -31,7 +31,6 @@ export interface Definition {
31
31
  readonly orElse: (that: Definition) => Definition;
32
32
  readonly pipe: <A>(f: (self: Definition) => A) => A;
33
33
  }
34
- export declare const isAuth: (input: unknown) => input is Definition;
35
34
  export declare const value: (secret: string, source?: string) => Credential;
36
35
  export declare const optional: (secret: Secret | undefined, source?: string) => Credential;
37
36
  export declare const config: (name: string) => Credential;
@@ -42,7 +41,6 @@ export declare const remove: (name: string) => Definition;
42
41
  export declare const custom: (apply: (input: AuthInput) => Effect.Effect<Headers.Headers, AIError>) => Definition;
43
42
  export declare const passthrough: Definition;
44
43
  export declare function bearer(source: Secret | Credential): Definition;
45
- export declare const apiKey: typeof bearer;
46
44
  export declare function header(name: string): (source: Secret | Credential) => Definition;
47
45
  export declare function header(name: string, source: Secret | Credential): Definition;
48
46
  export declare function bearerHeader(name: string): (source: Secret | Credential) => Definition;
@@ -9,7 +9,6 @@ export class MissingCredentialError extends Error {
9
9
  this.source = source;
10
10
  }
11
11
  }
12
- export const isAuth = (input) => typeof input === "object" && input !== null && "apply" in input && typeof input.apply === "function";
13
12
  const credential = (load) => {
14
13
  const self = {
15
14
  load,
@@ -65,7 +64,6 @@ const credentialInput = (source) => typeof source === "string" || Redacted.isRed
65
64
  export function bearer(source) {
66
65
  return credentialInput(source).bearer();
67
66
  }
68
- export const apiKey = bearer;
69
67
  export function header(name, source) {
70
68
  if (source === undefined) {
71
69
  return (next) => credentialInput(next).header(name);