@mastra/ai-sdk 1.7.1 → 1.7.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mastra/ai-sdk
2
2
 
3
+ ## 1.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Browser applications can now import `toAISdkMessages` from `@mastra/ai-sdk/ui` without crashing with `TypeError: createRequire is not a function`. ([#20760](https://github.com/mastra-ai/mastra/pull/20760))
8
+
9
+ - Updated dependencies [[`8d2399b`](https://github.com/mastra-ai/mastra/commit/8d2399b638f8e0945cf2cda0187dbea8dcf0b784), [`c8002da`](https://github.com/mastra-ai/mastra/commit/c8002da7775c468e2965b6ff5f82045450fa8cb9), [`92be47f`](https://github.com/mastra-ai/mastra/commit/92be47fbd26ffccec0e2131ef7c1d9e70dd5ef4a), [`89200ba`](https://github.com/mastra-ai/mastra/commit/89200bafa05444bb7949b363ce7b743e29867561), [`c950138`](https://github.com/mastra-ai/mastra/commit/c950138e72e4f317a40187e3800588731ab790ce), [`810c7e7`](https://github.com/mastra-ai/mastra/commit/810c7e74929989d8b8b5db52cd3af22cd0998af4), [`063c8b2`](https://github.com/mastra-ai/mastra/commit/063c8b2eb14e4e5ca021779bc33e8c3c031c8604), [`f9f9884`](https://github.com/mastra-ai/mastra/commit/f9f98848ee194dc71a787a709ec430b065cdc41b), [`e0904dc`](https://github.com/mastra-ai/mastra/commit/e0904dc538792e54e1806b70172e5900ac49bff4), [`9672fab`](https://github.com/mastra-ai/mastra/commit/9672fabfbcadb961a35c22a2d6722e077f7b24b9), [`f4e964c`](https://github.com/mastra-ai/mastra/commit/f4e964cad57057301d6bed5c55bcdd730175b941), [`1f7bbd7`](https://github.com/mastra-ai/mastra/commit/1f7bbd7785a8d230aad02454ecabeb4a0b2cc96f), [`e47ff36`](https://github.com/mastra-ai/mastra/commit/e47ff36945720f4ee4caa09f6e83514d7d188608), [`64d6781`](https://github.com/mastra-ai/mastra/commit/64d67814bccddd314f7e09643243821e57cb87b6), [`fb9a6ac`](https://github.com/mastra-ai/mastra/commit/fb9a6ac11c9560518742ece60b49d6b062845fd3), [`aa2cec8`](https://github.com/mastra-ai/mastra/commit/aa2cec8501f634d51c2f3ebfb3dd3aa7af8d2ca2), [`c848e65`](https://github.com/mastra-ai/mastra/commit/c848e655a64ff10331a8ceafafe7f18e70a0f092), [`2adf8eb`](https://github.com/mastra-ai/mastra/commit/2adf8eb4a70ed2b6cff2dd39281496ea0e025fac), [`0494489`](https://github.com/mastra-ai/mastra/commit/049448906e4c3d2d615bbe865b073a0d890ddb7c), [`8d1aeb8`](https://github.com/mastra-ai/mastra/commit/8d1aeb8acf7c20c4bb8e4d8e4bdc6569c83ac561), [`8264611`](https://github.com/mastra-ai/mastra/commit/8264611510e421b818bc7395dc2ae4d9c2d518b2), [`d8fa243`](https://github.com/mastra-ai/mastra/commit/d8fa2430d21113e330c4e676ac65e1235cf44f81), [`44fc98b`](https://github.com/mastra-ai/mastra/commit/44fc98b9d1242aa87a3ab44bdce9e9f12c44d8c9), [`f933ba3`](https://github.com/mastra-ai/mastra/commit/f933ba32700e1d0bf143311c1a08f88300b840b6), [`83065bf`](https://github.com/mastra-ai/mastra/commit/83065bfee9e47c3c6f09132a9034501f6cfb69cf), [`0f2ef41`](https://github.com/mastra-ai/mastra/commit/0f2ef4118da022e4f30dac4e9856cc3a8c97671c), [`01b162f`](https://github.com/mastra-ai/mastra/commit/01b162fe435295881aa7ea55f1759407ad5175ad)]:
10
+ - @mastra/core@1.57.0
11
+
3
12
  ## 1.7.1
4
13
 
5
14
  ### Patch Changes
@@ -1,5 +1,4 @@
1
1
  import { JSONSchema7 } from '../../@types_json-schema/index.d.ts';
2
- import { JSONSchema7Definition } from '../../@types_json-schema/index.d.ts';
3
2
  import { ServerResponse } from 'node:http';
4
3
  import { ServerResponse as ServerResponse_2 } from 'http';
5
4
  import { z } from 'zod/v4';
@@ -112,76 +111,6 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
112
111
  private makeRequest;
113
112
  }
114
113
 
115
- declare namespace _ai_sdk_provider {
116
- export {
117
- JSONSchema7,
118
- JSONSchema7Definition,
119
- AISDKError,
120
- APICallError,
121
- EmbeddingModelV2,
122
- EmbeddingModelV2Embedding,
123
- EmptyResponseBodyError,
124
- ImageModelV2,
125
- ImageModelV2CallOptions,
126
- ImageModelV2CallWarning,
127
- ImageModelV2ProviderMetadata,
128
- InvalidArgumentError_2 as InvalidArgumentError,
129
- InvalidPromptError,
130
- InvalidResponseDataError,
131
- JSONArray,
132
- JSONObject,
133
- JSONParseError,
134
- JSONValue_2 as JSONValue,
135
- LanguageModelV2,
136
- LanguageModelV2CallOptions,
137
- LanguageModelV2CallWarning,
138
- LanguageModelV2Content,
139
- LanguageModelV2DataContent,
140
- LanguageModelV2File,
141
- LanguageModelV2FilePart,
142
- LanguageModelV2FinishReason,
143
- LanguageModelV2FunctionTool,
144
- LanguageModelV2Message,
145
- LanguageModelV2Middleware,
146
- LanguageModelV2Prompt,
147
- LanguageModelV2ProviderDefinedTool,
148
- LanguageModelV2Reasoning,
149
- LanguageModelV2ReasoningPart,
150
- LanguageModelV2ResponseMetadata,
151
- LanguageModelV2Source,
152
- LanguageModelV2StreamPart,
153
- LanguageModelV2Text,
154
- LanguageModelV2TextPart,
155
- LanguageModelV2ToolCall,
156
- LanguageModelV2ToolCallPart,
157
- LanguageModelV2ToolChoice,
158
- LanguageModelV2ToolResultOutput,
159
- LanguageModelV2ToolResultPart,
160
- LanguageModelV2Usage,
161
- LoadAPIKeyError,
162
- LoadSettingError,
163
- NoContentGeneratedError,
164
- NoSuchModelError,
165
- ProviderV2,
166
- SharedV2Headers,
167
- SharedV2ProviderMetadata,
168
- SharedV2ProviderOptions,
169
- SpeechModelV2,
170
- SpeechModelV2CallOptions,
171
- SpeechModelV2CallWarning,
172
- TooManyEmbeddingValuesForCallError,
173
- TranscriptionModelV2,
174
- TranscriptionModelV2CallOptions,
175
- TranscriptionModelV2CallWarning,
176
- TypeValidationError,
177
- UnsupportedFunctionalityError,
178
- getErrorMessage_2 as getErrorMessage,
179
- isJSONArray,
180
- isJSONObject,
181
- isJSONValue
182
- }
183
- }
184
-
185
114
  declare namespace _ai_sdk_provider_utils {
186
115
  export {
187
116
  EventSourceMessage,
@@ -2374,7 +2303,7 @@ declare interface GatewayLanguageModelEntry {
2374
2303
 
2375
2304
  declare type GatewayLanguageModelSpecification = Pick<LanguageModelV2, 'specificationVersion' | 'provider' | 'modelId'>;
2376
2305
 
2377
- export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-fable-5' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.7-fast' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-5' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3-pro-preview' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'interfaze/interfaze-beta' | 'kwaipilot/kat-coder-air-v2.5' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'kwaipilot/kat-coder-pro-v2.5' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'meta/muse-spark-1.1' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'minimax/minimax-m3' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'moonshotai/kimi-k2.7-code' | 'moonshotai/kimi-k2.7-code-highspeed' | 'moonshotai/kimi-k3' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-chat' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-instant' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.2' | 'openai/gpt-5.2-chat' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-chat' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-terra' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'sakana/fugu-ultra' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | 'thinkingmachines/inkling' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-4.3' | 'xai/grok-4.5' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5.2' | 'zai/glm-5.2-fast' | 'zai/glm-5v-turbo' | (string & {});
2306
+ export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-fable-5' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-5' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3-pro-preview' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.6-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash-free' | 'interfaze/interfaze-beta' | 'kwaipilot/kat-coder-air-v2.5' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'kwaipilot/kat-coder-pro-v2.5' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'meta/muse-spark-1.1' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'minimax/minimax-m3' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'moonshotai/kimi-k2.7-code' | 'moonshotai/kimi-k2.7-code-highspeed' | 'moonshotai/kimi-k3' | 'moonshotai/kimi-k3-fast' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-instant' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.2' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-chat' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-terra' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'sakana/fugu-ultra' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | 'tencent/hy3' | 'thinkingmachines/inkling' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-4.3' | 'xai/grok-4.5' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5.2' | 'zai/glm-5.2-fast' | 'zai/glm-5v-turbo' | (string & {});
2378
2307
 
2379
2308
  declare interface GatewayProvider extends ProviderV2 {
2380
2309
  (modelId: GatewayModelId): LanguageModelV2;
@@ -2876,7 +2805,9 @@ export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT> {
2876
2805
  */
2877
2806
  readonly content: Array<ContentPart<TOOLS>>;
2878
2807
  /**
2879
- The text that was generated in the last step.
2808
+ The concatenation of all text parts generated in the last step.
2809
+ It is an empty string if the last step contains no text parts.
2810
+ Inspect `content` to distinguish that case.
2880
2811
  */
2881
2812
  readonly text: string;
2882
2813
  /**
@@ -2980,8 +2911,6 @@ export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT> {
2980
2911
 
2981
2912
  declare function getErrorMessage(error: unknown | undefined): string;
2982
2913
 
2983
- declare function getErrorMessage_2(error: unknown | undefined): string;
2984
-
2985
2914
  declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, }: {
2986
2915
  url: string;
2987
2916
  headers?: Record<string, string | undefined>;
@@ -3397,20 +3326,6 @@ export declare class InvalidArgumentError extends AISDKError {
3397
3326
  static isInstance(error: unknown): error is InvalidArgumentError;
3398
3327
  }
3399
3328
 
3400
- /**
3401
- * A function argument is invalid.
3402
- */
3403
- declare class InvalidArgumentError_2 extends AISDKError {
3404
- private readonly [symbol$a_2];
3405
- readonly argument: string;
3406
- constructor({ message, cause, argument, }: {
3407
- argument: string;
3408
- message: string;
3409
- cause?: unknown;
3410
- });
3411
- static isInstance(error: unknown): error is InvalidArgumentError_2;
3412
- }
3413
-
3414
3329
  export declare class InvalidDataContentError extends AISDKError {
3415
3330
  private readonly [symbol$5_2];
3416
3331
  readonly content: unknown;
@@ -3515,12 +3430,6 @@ export declare function isDeepEqualData(obj1: any, obj2: any): boolean;
3515
3430
  */
3516
3431
  export declare function isFileUIPart(part: UIMessagePart<UIDataTypes, UITools>): part is FileUIPart;
3517
3432
 
3518
- declare function isJSONArray(value: unknown): value is JSONArray;
3519
-
3520
- declare function isJSONObject(value: unknown): value is JSONObject;
3521
-
3522
- declare function isJSONValue(value: unknown): value is JSONValue_2;
3523
-
3524
3433
  declare function isParsableJson(input: string): boolean;
3525
3434
 
3526
3435
  /**
@@ -5178,12 +5087,12 @@ declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderDefine
5178
5087
  export declare function pipeTextStreamToResponse({ response, status, statusText, headers, textStream, }: {
5179
5088
  response: ServerResponse;
5180
5089
  textStream: ReadableStream<string>;
5181
- } & ResponseInit): void;
5090
+ } & ResponseInit): Promise<void>;
5182
5091
 
5183
5092
  export declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, consumeSseStream, }: {
5184
5093
  response: ServerResponse;
5185
5094
  stream: ReadableStream<UIMessageChunk>;
5186
- } & UIMessageStreamResponseInit): void;
5095
+ } & UIMessageStreamResponseInit): Promise<void>;
5187
5096
 
5188
5097
  declare const postFormDataToApi: <T>({ url, headers, formData, failedResponseHandler, successfulResponseHandler, abortSignal, fetch, }: {
5189
5098
  url: string;
@@ -6560,7 +6469,8 @@ export declare type StepResult<TOOLS extends ToolSet> = {
6560
6469
  */
6561
6470
  readonly content: Array<ContentPart<TOOLS>>;
6562
6471
  /**
6563
- The generated text.
6472
+ The concatenation of all text parts generated in this step.
6473
+ It is an empty string if the step contains no text parts.
6564
6474
  */
6565
6475
  readonly text: string;
6566
6476
  /**
@@ -6892,7 +6802,7 @@ export declare interface StreamObjectResult<PARTIAL, RESULT, ELEMENT_STREAM> {
6892
6802
  @param response A Node.js response-like object (ServerResponse).
6893
6803
  @param init Optional headers, status code, and status text.
6894
6804
  */
6895
- pipeTextStreamToResponse(response: ServerResponse_2, init?: ResponseInit): void;
6805
+ pipeTextStreamToResponse(response: ServerResponse_2, init?: ResponseInit): Promise<void>;
6896
6806
  /**
6897
6807
  Creates a simple text stream response.
6898
6808
  The response has a `Content-Type` header set to `text/plain; charset=utf-8`.
@@ -7295,8 +7205,8 @@ export declare interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT>
7295
7205
  readonly providerMetadata: Promise<ProviderMetadata | undefined>;
7296
7206
  /**
7297
7207
  A text stream that returns only the generated text deltas. You can use it
7298
- as either an AsyncIterable or a ReadableStream. When an error occurs, the
7299
- stream will throw the error.
7208
+ as either an AsyncIterable or a ReadableStream. Error parts are not surfaced
7209
+ in this stream. Use the `onError` callback or `fullStream` to observe them.
7300
7210
  */
7301
7211
  readonly textStream: AsyncIterableStream<string>;
7302
7212
  /**
@@ -7328,7 +7238,7 @@ export declare interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT>
7328
7238
  /**
7329
7239
  *Writes UI message stream output to a Node.js response-like object.
7330
7240
  */
7331
- pipeUIMessageStreamToResponse<UI_MESSAGE extends UIMessage>(response: ServerResponse, options?: UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): void;
7241
+ pipeUIMessageStreamToResponse<UI_MESSAGE extends UIMessage>(response: ServerResponse, options?: UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): Promise<void>;
7332
7242
  /**
7333
7243
  Writes text delta output to a Node.js response-like object.
7334
7244
  It sets a `Content-Type` header to `text/plain; charset=utf-8` and
@@ -7337,7 +7247,7 @@ export declare interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT>
7337
7247
  @param response A Node.js response-like object (ServerResponse).
7338
7248
  @param init Optional headers, status code, and status text.
7339
7249
  */
7340
- pipeTextStreamToResponse(response: ServerResponse, init?: ResponseInit): void;
7250
+ pipeTextStreamToResponse(response: ServerResponse, init?: ResponseInit): Promise<void>;
7341
7251
  /**
7342
7252
  Converts the result to a streamed response object with a stream data part stream.
7343
7253
 
@@ -7402,8 +7312,6 @@ declare const symbol$9_2: unique symbol;
7402
7312
 
7403
7313
  declare const symbol$a: unique symbol;
7404
7314
 
7405
- declare const symbol$a_2: unique symbol;
7406
-
7407
7315
  declare const symbol$b: unique symbol;
7408
7316
 
7409
7317
  declare const symbol$b_2: unique symbol;
@@ -8422,116 +8330,7 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
8422
8330
  messageMetadata: METADATA;
8423
8331
  };
8424
8332
 
8425
- export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazyValidator<{
8426
- type: "text-start";
8427
- id: string;
8428
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8429
- } | {
8430
- type: "text-delta";
8431
- id: string;
8432
- delta: string;
8433
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8434
- } | {
8435
- type: "text-end";
8436
- id: string;
8437
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8438
- } | {
8439
- type: "error";
8440
- errorText: string;
8441
- } | {
8442
- type: "tool-input-start";
8443
- toolCallId: string;
8444
- toolName: string;
8445
- providerExecuted?: boolean | undefined;
8446
- dynamic?: boolean | undefined;
8447
- } | {
8448
- type: "tool-input-delta";
8449
- toolCallId: string;
8450
- inputTextDelta: string;
8451
- } | {
8452
- type: "tool-input-available";
8453
- toolCallId: string;
8454
- toolName: string;
8455
- input: unknown;
8456
- providerExecuted?: boolean | undefined;
8457
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8458
- dynamic?: boolean | undefined;
8459
- } | {
8460
- type: "tool-input-error";
8461
- toolCallId: string;
8462
- toolName: string;
8463
- input: unknown;
8464
- errorText: string;
8465
- providerExecuted?: boolean | undefined;
8466
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8467
- dynamic?: boolean | undefined;
8468
- } | {
8469
- type: "tool-output-available";
8470
- toolCallId: string;
8471
- output: unknown;
8472
- providerExecuted?: boolean | undefined;
8473
- dynamic?: boolean | undefined;
8474
- preliminary?: boolean | undefined;
8475
- } | {
8476
- type: "tool-output-error";
8477
- toolCallId: string;
8478
- errorText: string;
8479
- providerExecuted?: boolean | undefined;
8480
- dynamic?: boolean | undefined;
8481
- } | {
8482
- type: "reasoning-start";
8483
- id: string;
8484
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8485
- } | {
8486
- type: "reasoning-delta";
8487
- id: string;
8488
- delta: string;
8489
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8490
- } | {
8491
- type: "reasoning-end";
8492
- id: string;
8493
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8494
- } | {
8495
- type: "source-url";
8496
- sourceId: string;
8497
- url: string;
8498
- title?: string | undefined;
8499
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8500
- } | {
8501
- type: "source-document";
8502
- sourceId: string;
8503
- mediaType: string;
8504
- title: string;
8505
- filename?: string | undefined;
8506
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8507
- } | {
8508
- type: "file";
8509
- url: string;
8510
- mediaType: string;
8511
- providerMetadata?: _ai_sdk_provider.SharedV2ProviderMetadata | undefined;
8512
- } | {
8513
- type: `data-${string}`;
8514
- data: unknown;
8515
- id?: string | undefined;
8516
- transient?: boolean | undefined;
8517
- } | {
8518
- type: "start-step";
8519
- } | {
8520
- type: "finish-step";
8521
- } | {
8522
- type: "start";
8523
- messageId?: string | undefined;
8524
- messageMetadata?: unknown;
8525
- } | {
8526
- type: "finish";
8527
- finishReason?: "other" | "length" | "unknown" | "error" | "stop" | "content-filter" | "tool-calls" | undefined;
8528
- messageMetadata?: unknown;
8529
- } | {
8530
- type: "abort";
8531
- } | {
8532
- type: "message-metadata";
8533
- messageMetadata: unknown;
8534
- }>;
8333
+ export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazyValidator<UIMessageChunk<unknown, UIDataTypes>>;
8535
8334
 
8536
8335
  export declare type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
8537
8336
 
@@ -8977,5 +8776,5 @@ export declare function zodSchema<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, an
8977
8776
  }): Schema<OBJECT>;
8978
8777
 
8979
8778
  export { }
8980
- export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, ParseResult as ParseResult, FlexibleValidator as FlexibleValidator, ValidationResult as ValidationResult, LanguageModelV2ToolResultOutput as LanguageModelV2ToolResultOutput, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, LanguageModelV2ToolResultPart as LanguageModelV2ToolResultPart, FlexibleSchema as FlexibleSchema, ImageModelV2CallWarning as ImageModelV2CallWarning, SpeechModelV2CallWarning as SpeechModelV2CallWarning, TranscriptionModelV2CallWarning as TranscriptionModelV2CallWarning, AttributeValue as AttributeValue, Tracer as Tracer, EmbeddingModelV2Embedding as EmbeddingModelV2Embedding, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2FinishReason as LanguageModelV2FinishReason, LanguageModelV2CallWarning as LanguageModelV2CallWarning, LanguageModelV2Middleware as LanguageModelV2Middleware, SharedV2ProviderMetadata as SharedV2ProviderMetadata, LanguageModelV2Usage as LanguageModelV2Usage, Source as Source, ResponseMessage as ResponseMessage, DeepPartialInternal as DeepPartialInternal, LanguageModelV2ToolCall as LanguageModelV2ToolCall, StreamTextOnAbortCallback as StreamTextOnAbortCallback, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, _ai_sdk_provider as _ai_sdk_provider, DataUIMessageChunk as DataUIMessageChunk, ConsumeStreamOptions as ConsumeStreamOptions, Output_2 as Output_2, InferAgentTools as InferAgentTools, SingleRequestTextStreamPart as SingleRequestTextStreamPart, RetryErrorReason as RetryErrorReason, InferSchema as InferSchema, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, JSONValue_2 as JSONValue_2, LanguageModelV2CallOptions as LanguageModelV2CallOptions, LanguageModelV2 as LanguageModelV2, EmbeddingModelV2 as EmbeddingModelV2, ImageModelV2 as ImageModelV2, TranscriptionModelV2 as TranscriptionModelV2, SpeechModelV2 as SpeechModelV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV2 as ProviderV2, getOriginalFetch as getOriginalFetch, UIMessageStreamResponseInit as UIMessageStreamResponseInit, InferUIMessageToolCall as InferUIMessageToolCall, Validator as Validator, StandardSchemaV1 as StandardSchemaV1, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, InferUIMessageTools as InferUIMessageTools, Resolvable as Resolvable, FetchFunction as FetchFunction };
8981
- export { schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$a_2, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol, symbol_2, symbol_3, validatorSymbol };
8779
+ export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, ParseResult as ParseResult, FlexibleValidator as FlexibleValidator, ValidationResult as ValidationResult, LanguageModelV2ToolResultOutput as LanguageModelV2ToolResultOutput, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, LanguageModelV2ToolResultPart as LanguageModelV2ToolResultPart, FlexibleSchema as FlexibleSchema, ImageModelV2CallWarning as ImageModelV2CallWarning, SpeechModelV2CallWarning as SpeechModelV2CallWarning, TranscriptionModelV2CallWarning as TranscriptionModelV2CallWarning, AttributeValue as AttributeValue, Tracer as Tracer, EmbeddingModelV2Embedding as EmbeddingModelV2Embedding, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2FinishReason as LanguageModelV2FinishReason, LanguageModelV2CallWarning as LanguageModelV2CallWarning, LanguageModelV2Middleware as LanguageModelV2Middleware, SharedV2ProviderMetadata as SharedV2ProviderMetadata, LanguageModelV2Usage as LanguageModelV2Usage, Source as Source, ResponseMessage as ResponseMessage, DeepPartialInternal as DeepPartialInternal, LanguageModelV2ToolCall as LanguageModelV2ToolCall, StreamTextOnAbortCallback as StreamTextOnAbortCallback, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, DataUIMessageChunk as DataUIMessageChunk, ConsumeStreamOptions as ConsumeStreamOptions, Output_2 as Output_2, InferAgentTools as InferAgentTools, SingleRequestTextStreamPart as SingleRequestTextStreamPart, RetryErrorReason as RetryErrorReason, InferSchema as InferSchema, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, JSONValue_2 as JSONValue_2, LanguageModelV2CallOptions as LanguageModelV2CallOptions, LanguageModelV2 as LanguageModelV2, EmbeddingModelV2 as EmbeddingModelV2, ImageModelV2 as ImageModelV2, TranscriptionModelV2 as TranscriptionModelV2, SpeechModelV2 as SpeechModelV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV2 as ProviderV2, getOriginalFetch as getOriginalFetch, UIMessageStreamResponseInit as UIMessageStreamResponseInit, InferUIMessageToolCall as InferUIMessageToolCall, Validator as Validator, StandardSchemaV1 as StandardSchemaV1, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, InferUIMessageTools as InferUIMessageTools, Resolvable as Resolvable, FetchFunction as FetchFunction };
8780
+ export { schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol, symbol_2, symbol_3, validatorSymbol };