@mastra/core 1.0.0-beta.13 → 1.0.0-beta.14

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 (249) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/dist/agent/agent.d.ts +2 -2
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/agent.types.d.ts +6 -7
  5. package/dist/agent/agent.types.d.ts.map +1 -1
  6. package/dist/agent/index.cjs +17 -9
  7. package/dist/agent/index.d.ts +1 -1
  8. package/dist/agent/index.d.ts.map +1 -1
  9. package/dist/agent/index.js +2 -2
  10. package/dist/agent/message-list/index.cjs +3 -3
  11. package/dist/agent/message-list/index.js +1 -1
  12. package/dist/agent/trip-wire.d.ts +2 -2
  13. package/dist/agent/trip-wire.d.ts.map +1 -1
  14. package/dist/agent/utils.d.ts +4 -1
  15. package/dist/agent/utils.d.ts.map +1 -1
  16. package/dist/agent/workflows/prepare-stream/index.d.ts +3 -3
  17. package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
  18. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +3 -3
  19. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
  20. package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +3 -3
  21. package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
  22. package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +3 -3
  23. package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
  24. package/dist/bundler/types.d.ts +1 -0
  25. package/dist/bundler/types.d.ts.map +1 -1
  26. package/dist/chunk-2AU5ZHBL.js +79 -0
  27. package/dist/chunk-2AU5ZHBL.js.map +1 -0
  28. package/dist/{chunk-BQDZIQ3G.js → chunk-3IP3DZ7G.js} +85 -18
  29. package/dist/chunk-3IP3DZ7G.js.map +1 -0
  30. package/dist/{chunk-WYWRMIQC.js → chunk-4AT6YQKZ.js} +4 -103
  31. package/dist/chunk-4AT6YQKZ.js.map +1 -0
  32. package/dist/{chunk-62Q7K656.js → chunk-4CMIJQF6.js} +114 -110
  33. package/dist/chunk-4CMIJQF6.js.map +1 -0
  34. package/dist/{chunk-MXBVP7HX.cjs → chunk-53SZJCBX.cjs} +220 -174
  35. package/dist/chunk-53SZJCBX.cjs.map +1 -0
  36. package/dist/{chunk-2IU4RGU5.js → chunk-5UQ5TB6J.js} +5 -5
  37. package/dist/{chunk-2IU4RGU5.js.map → chunk-5UQ5TB6J.js.map} +1 -1
  38. package/dist/{chunk-WYGUWVTF.js → chunk-67LM2UCT.js} +8 -8
  39. package/dist/chunk-67LM2UCT.js.map +1 -0
  40. package/dist/{chunk-U4CSOY6T.cjs → chunk-6CG7IY57.cjs} +110 -43
  41. package/dist/chunk-6CG7IY57.cjs.map +1 -0
  42. package/dist/{chunk-X6IBA7FP.cjs → chunk-72E3YF6A.cjs} +9 -110
  43. package/dist/chunk-72E3YF6A.cjs.map +1 -0
  44. package/dist/{chunk-GIWC35YQ.js → chunk-AYBJ5GAD.js} +180 -4
  45. package/dist/chunk-AYBJ5GAD.js.map +1 -0
  46. package/dist/{chunk-VEPP75C4.cjs → chunk-DBW6S25C.cjs} +10 -10
  47. package/dist/{chunk-VEPP75C4.cjs.map → chunk-DBW6S25C.cjs.map} +1 -1
  48. package/dist/{chunk-Y7MZ5LJT.cjs → chunk-EGHGFLL3.cjs} +101 -102
  49. package/dist/chunk-EGHGFLL3.cjs.map +1 -0
  50. package/dist/{chunk-LGB4VNZI.cjs → chunk-ETWAR2YE.cjs} +5 -5
  51. package/dist/{chunk-LGB4VNZI.cjs.map → chunk-ETWAR2YE.cjs.map} +1 -1
  52. package/dist/{chunk-OWIEOL55.cjs → chunk-F75EQ574.cjs} +695 -254
  53. package/dist/chunk-F75EQ574.cjs.map +1 -0
  54. package/dist/{chunk-AGHLXC4I.cjs → chunk-FPDJ4XN6.cjs} +181 -5
  55. package/dist/chunk-FPDJ4XN6.cjs.map +1 -0
  56. package/dist/{chunk-VETAQUW3.js → chunk-GBQXIVL6.js} +3 -3
  57. package/dist/{chunk-VETAQUW3.js.map → chunk-GBQXIVL6.js.map} +1 -1
  58. package/dist/{chunk-4BC5FUAO.js → chunk-GELVUDUY.js} +5 -4
  59. package/dist/chunk-GELVUDUY.js.map +1 -0
  60. package/dist/chunk-GVAPYQRO.cjs +252 -0
  61. package/dist/chunk-GVAPYQRO.cjs.map +1 -0
  62. package/dist/{chunk-R5AJGM55.cjs → chunk-JAGQZZ43.cjs} +410 -265
  63. package/dist/chunk-JAGQZZ43.cjs.map +1 -0
  64. package/dist/{chunk-ARAQIW6E.js → chunk-K66U47VL.js} +617 -188
  65. package/dist/chunk-K66U47VL.js.map +1 -0
  66. package/dist/{chunk-RCJLMMTO.js → chunk-LDXKZYOV.js} +4 -4
  67. package/dist/{chunk-RCJLMMTO.js.map → chunk-LDXKZYOV.js.map} +1 -1
  68. package/dist/{chunk-MLKE7HRS.cjs → chunk-O3ULBGV6.cjs} +4 -4
  69. package/dist/{chunk-MLKE7HRS.cjs.map → chunk-O3ULBGV6.cjs.map} +1 -1
  70. package/dist/{chunk-PJAK4U6R.cjs → chunk-O5BQBZEF.cjs} +15 -15
  71. package/dist/chunk-O5BQBZEF.cjs.map +1 -0
  72. package/dist/{chunk-H4VUIOWU.cjs → chunk-OOUFPYSX.cjs} +5 -4
  73. package/dist/chunk-OOUFPYSX.cjs.map +1 -0
  74. package/dist/{chunk-5VZGJTPR.js → chunk-QDVYP2T7.js} +56 -10
  75. package/dist/chunk-QDVYP2T7.js.map +1 -0
  76. package/dist/{chunk-E5BQRAJK.js → chunk-QF4MHFSU.js} +364 -221
  77. package/dist/chunk-QF4MHFSU.js.map +1 -0
  78. package/dist/{chunk-WPTTKULS.js → chunk-SLBWA2F3.js} +3 -3
  79. package/dist/{chunk-WPTTKULS.js.map → chunk-SLBWA2F3.js.map} +1 -1
  80. package/dist/chunk-ST7NBF4H.cjs +84 -0
  81. package/dist/chunk-ST7NBF4H.cjs.map +1 -0
  82. package/dist/{chunk-7HEAVZRS.cjs → chunk-TDM43G4I.cjs} +8 -8
  83. package/dist/{chunk-7HEAVZRS.cjs.map → chunk-TDM43G4I.cjs.map} +1 -1
  84. package/dist/{chunk-SZYSDJTN.cjs → chunk-TRUNX3AX.cjs} +117 -112
  85. package/dist/chunk-TRUNX3AX.cjs.map +1 -0
  86. package/dist/chunk-VE6HQ7H6.js +250 -0
  87. package/dist/chunk-VE6HQ7H6.js.map +1 -0
  88. package/dist/{chunk-MRRFTNF4.js → chunk-VZJOEGQA.js} +3 -4
  89. package/dist/chunk-VZJOEGQA.js.map +1 -0
  90. package/dist/evals/index.cjs +4 -4
  91. package/dist/evals/index.js +1 -1
  92. package/dist/evals/run/index.d.ts.map +1 -1
  93. package/dist/evals/scoreTraces/index.cjs +3 -3
  94. package/dist/evals/scoreTraces/index.js +1 -1
  95. package/dist/index.cjs +2 -2
  96. package/dist/index.js +1 -1
  97. package/dist/llm/index.cjs +15 -15
  98. package/dist/llm/index.js +5 -5
  99. package/dist/llm/model/aisdk/generate-to-stream.d.ts +20 -0
  100. package/dist/llm/model/aisdk/generate-to-stream.d.ts.map +1 -0
  101. package/dist/llm/model/aisdk/v5/model.d.ts +4 -0
  102. package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -1
  103. package/dist/llm/model/aisdk/v6/model.d.ts +51 -0
  104. package/dist/llm/model/aisdk/v6/model.d.ts.map +1 -0
  105. package/dist/llm/model/model.loop.d.ts +1 -1
  106. package/dist/llm/model/provider-types.generated.d.ts +84 -0
  107. package/dist/llm/model/resolve-model.d.ts +2 -2
  108. package/dist/llm/model/resolve-model.d.ts.map +1 -1
  109. package/dist/llm/model/shared.types.d.ts +18 -7
  110. package/dist/llm/model/shared.types.d.ts.map +1 -1
  111. package/dist/loop/index.cjs +2 -2
  112. package/dist/loop/index.js +1 -1
  113. package/dist/loop/network/index.d.ts +2 -2
  114. package/dist/loop/network/index.d.ts.map +1 -1
  115. package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts +1 -1
  116. package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts.map +1 -1
  117. package/dist/loop/test-utils/MastraLanguageModelV3Mock.d.ts +37 -0
  118. package/dist/loop/test-utils/MastraLanguageModelV3Mock.d.ts.map +1 -0
  119. package/dist/loop/test-utils/fullStream.d.ts +2 -1
  120. package/dist/loop/test-utils/fullStream.d.ts.map +1 -1
  121. package/dist/loop/test-utils/resultObject.d.ts +2 -1
  122. package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
  123. package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
  124. package/dist/loop/test-utils/utils-v3.d.ts +55 -0
  125. package/dist/loop/test-utils/utils-v3.d.ts.map +1 -0
  126. package/dist/loop/types.d.ts +5 -6
  127. package/dist/loop/types.d.ts.map +1 -1
  128. package/dist/loop/workflows/agentic-execution/index.d.ts +36 -36
  129. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +25 -25
  130. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  131. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +12 -12
  132. package/dist/loop/workflows/agentic-loop/index.d.ts +36 -36
  133. package/dist/loop/workflows/run-state.d.ts +2 -2
  134. package/dist/loop/workflows/run-state.d.ts.map +1 -1
  135. package/dist/loop/workflows/schema.d.ts +12 -12
  136. package/dist/mastra/index.cjs +2 -2
  137. package/dist/mastra/index.js +1 -1
  138. package/dist/memory/index.cjs +6 -6
  139. package/dist/memory/index.js +1 -1
  140. package/dist/models-dev-E3WWI7VA.js +3 -0
  141. package/dist/{models-dev-EO22XOXQ.js.map → models-dev-E3WWI7VA.js.map} +1 -1
  142. package/dist/models-dev-PPS7X4JM.cjs +12 -0
  143. package/dist/{models-dev-D3EKFGAO.cjs.map → models-dev-PPS7X4JM.cjs.map} +1 -1
  144. package/dist/netlify-TY656UYF.js +3 -0
  145. package/dist/{netlify-AE4LNCAI.js.map → netlify-TY656UYF.js.map} +1 -1
  146. package/dist/netlify-VZFM5UH3.cjs +12 -0
  147. package/dist/{netlify-WE42TZIT.cjs.map → netlify-VZFM5UH3.cjs.map} +1 -1
  148. package/dist/processors/index.cjs +37 -37
  149. package/dist/processors/index.d.ts +7 -7
  150. package/dist/processors/index.d.ts.map +1 -1
  151. package/dist/processors/index.js +1 -1
  152. package/dist/processors/runner.d.ts.map +1 -1
  153. package/dist/processors/step-schema.d.ts +26 -26
  154. package/dist/processors/step-schema.d.ts.map +1 -1
  155. package/dist/provider-registry-NXVD764B.js +3 -0
  156. package/dist/{provider-registry-6LF3NGC5.js.map → provider-registry-NXVD764B.js.map} +1 -1
  157. package/dist/provider-registry-ZIWSEUQE.cjs +40 -0
  158. package/dist/{provider-registry-73FKMXJV.cjs.map → provider-registry-ZIWSEUQE.cjs.map} +1 -1
  159. package/dist/provider-registry.json +176 -0
  160. package/dist/relevance/index.cjs +3 -3
  161. package/dist/relevance/index.cjs.map +1 -1
  162. package/dist/relevance/index.js +2 -2
  163. package/dist/relevance/index.js.map +1 -1
  164. package/dist/storage/index.cjs +38 -38
  165. package/dist/storage/index.js +1 -1
  166. package/dist/stream/aisdk/v5/execute.d.ts +4 -4
  167. package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
  168. package/dist/stream/aisdk/v5/output.d.ts +2 -2
  169. package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
  170. package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
  171. package/dist/stream/base/output.d.ts +7 -5
  172. package/dist/stream/base/output.d.ts.map +1 -1
  173. package/dist/stream/index.cjs +12 -12
  174. package/dist/stream/index.js +2 -2
  175. package/dist/stream/types.d.ts +29 -21
  176. package/dist/stream/types.d.ts.map +1 -1
  177. package/dist/test-utils/llm-mock.cjs +4 -4
  178. package/dist/test-utils/llm-mock.cjs.map +1 -1
  179. package/dist/test-utils/llm-mock.js +1 -1
  180. package/dist/test-utils/llm-mock.js.map +1 -1
  181. package/dist/token-6GSAFR2W-LTZ7QQUP.js +61 -0
  182. package/dist/token-6GSAFR2W-LTZ7QQUP.js.map +1 -0
  183. package/dist/token-6GSAFR2W-UEEINYAN.cjs +63 -0
  184. package/dist/token-6GSAFR2W-UEEINYAN.cjs.map +1 -0
  185. package/dist/token-util-NEHG7TUY-QTFZ26EN.js +8 -0
  186. package/dist/token-util-NEHG7TUY-QTFZ26EN.js.map +1 -0
  187. package/dist/token-util-NEHG7TUY-WZL2DNCG.cjs +10 -0
  188. package/dist/token-util-NEHG7TUY-WZL2DNCG.cjs.map +1 -0
  189. package/dist/utils.cjs +22 -22
  190. package/dist/utils.d.ts +2 -2
  191. package/dist/utils.d.ts.map +1 -1
  192. package/dist/utils.js +1 -1
  193. package/dist/vector/embed.d.ts +1 -0
  194. package/dist/vector/embed.d.ts.map +1 -1
  195. package/dist/vector/index.cjs +5300 -0
  196. package/dist/vector/index.cjs.map +1 -1
  197. package/dist/vector/index.js +5279 -1
  198. package/dist/vector/index.js.map +1 -1
  199. package/dist/vector/vector.d.ts +14 -1
  200. package/dist/vector/vector.d.ts.map +1 -1
  201. package/dist/voice/composite-voice.d.ts.map +1 -1
  202. package/dist/voice/index.cjs +6 -6
  203. package/dist/voice/index.js +1 -1
  204. package/dist/workflows/evented/index.cjs +10 -10
  205. package/dist/workflows/evented/index.js +1 -1
  206. package/dist/workflows/evented/step-executor.d.ts +4 -0
  207. package/dist/workflows/evented/step-executor.d.ts.map +1 -1
  208. package/dist/workflows/evented/workflow-event-processor/index.d.ts +15 -0
  209. package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
  210. package/dist/workflows/evented/workflow.d.ts +5 -0
  211. package/dist/workflows/evented/workflow.d.ts.map +1 -1
  212. package/dist/workflows/index.cjs +23 -23
  213. package/dist/workflows/index.js +1 -1
  214. package/dist/workflows/workflow.d.ts +4 -1
  215. package/dist/workflows/workflow.d.ts.map +1 -1
  216. package/package.json +10 -12
  217. package/src/llm/model/provider-types.generated.d.ts +84 -0
  218. package/dist/chunk-4BC5FUAO.js.map +0 -1
  219. package/dist/chunk-5VZGJTPR.js.map +0 -1
  220. package/dist/chunk-62Q7K656.js.map +0 -1
  221. package/dist/chunk-AGHLXC4I.cjs.map +0 -1
  222. package/dist/chunk-ARAQIW6E.js.map +0 -1
  223. package/dist/chunk-BQDZIQ3G.js.map +0 -1
  224. package/dist/chunk-E5BQRAJK.js.map +0 -1
  225. package/dist/chunk-GIWC35YQ.js.map +0 -1
  226. package/dist/chunk-H4VUIOWU.cjs.map +0 -1
  227. package/dist/chunk-IXZ2T2QX.cjs +0 -448
  228. package/dist/chunk-IXZ2T2QX.cjs.map +0 -1
  229. package/dist/chunk-MRRFTNF4.js.map +0 -1
  230. package/dist/chunk-MXBVP7HX.cjs.map +0 -1
  231. package/dist/chunk-OWIEOL55.cjs.map +0 -1
  232. package/dist/chunk-PJAK4U6R.cjs.map +0 -1
  233. package/dist/chunk-R5AJGM55.cjs.map +0 -1
  234. package/dist/chunk-SZYSDJTN.cjs.map +0 -1
  235. package/dist/chunk-U4CSOY6T.cjs.map +0 -1
  236. package/dist/chunk-UBSPZTQX.js +0 -434
  237. package/dist/chunk-UBSPZTQX.js.map +0 -1
  238. package/dist/chunk-WYGUWVTF.js.map +0 -1
  239. package/dist/chunk-WYWRMIQC.js.map +0 -1
  240. package/dist/chunk-X6IBA7FP.cjs.map +0 -1
  241. package/dist/chunk-Y7MZ5LJT.cjs.map +0 -1
  242. package/dist/llm/model/is-v2-model.d.ts +0 -3
  243. package/dist/llm/model/is-v2-model.d.ts.map +0 -1
  244. package/dist/models-dev-D3EKFGAO.cjs +0 -12
  245. package/dist/models-dev-EO22XOXQ.js +0 -3
  246. package/dist/netlify-AE4LNCAI.js +0 -3
  247. package/dist/netlify-WE42TZIT.cjs +0 -12
  248. package/dist/provider-registry-6LF3NGC5.js +0 -3
  249. package/dist/provider-registry-73FKMXJV.cjs +0 -40
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkOWIEOL55_cjs = require('./chunk-OWIEOL55.cjs');
4
- var chunkIXZ2T2QX_cjs = require('./chunk-IXZ2T2QX.cjs');
3
+ var chunkF75EQ574_cjs = require('./chunk-F75EQ574.cjs');
5
4
  var z4 = require('zod/v4');
6
5
  var v3 = require('zod/v3');
7
6
 
@@ -55,7 +54,7 @@ var createIdGenerator = ({
55
54
  return generator;
56
55
  }
57
56
  if (alphabet.includes(separator)) {
58
- throw new chunkIXZ2T2QX_cjs.InvalidArgumentError({
57
+ throw new chunkF75EQ574_cjs.InvalidArgumentError({
59
58
  argument: "separator",
60
59
  message: `The separator "${separator}" must not be part of the alphabet "${alphabet}".`
61
60
  });
@@ -79,7 +78,7 @@ function handleFetchError({
79
78
  if (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES.includes(error.message.toLowerCase())) {
80
79
  const cause = error.cause;
81
80
  if (cause != null) {
82
- return new chunkIXZ2T2QX_cjs.APICallError({
81
+ return new chunkF75EQ574_cjs.APICallError({
83
82
  message: `Cannot connect to API: ${cause.message}`,
84
83
  cause,
85
84
  url,
@@ -148,23 +147,23 @@ function loadApiKey2({
148
147
  return apiKey;
149
148
  }
150
149
  if (apiKey != null) {
151
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
150
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
152
151
  message: `${description} API key must be a string.`
153
152
  });
154
153
  }
155
154
  if (typeof process === "undefined") {
156
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
155
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
157
156
  message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables is not supported in this environment.`
158
157
  });
159
158
  }
160
159
  apiKey = process.env[environmentVariableName];
161
160
  if (apiKey == null) {
162
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
161
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
163
162
  message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.`
164
163
  });
165
164
  }
166
165
  if (typeof apiKey !== "string") {
167
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
166
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
168
167
  message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.`
169
168
  });
170
169
  }
@@ -232,7 +231,7 @@ function standardSchemaValidator(standardSchema) {
232
231
  const result = await standardSchema["~standard"].validate(value);
233
232
  return result.issues == null ? { success: true, value: result.value } : {
234
233
  success: false,
235
- error: new chunkIXZ2T2QX_cjs.TypeValidationError({
234
+ error: new chunkF75EQ574_cjs.TypeValidationError({
236
235
  value,
237
236
  cause: result.issues
238
237
  })
@@ -245,7 +244,7 @@ async function validateTypes({
245
244
  }) {
246
245
  const result = await safeValidateTypes({ value, schema });
247
246
  if (!result.success) {
248
- throw chunkIXZ2T2QX_cjs.TypeValidationError.wrap({ value, cause: result.error });
247
+ throw chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error });
249
248
  }
250
249
  return result.value;
251
250
  }
@@ -264,13 +263,13 @@ async function safeValidateTypes({
264
263
  }
265
264
  return {
266
265
  success: false,
267
- error: chunkIXZ2T2QX_cjs.TypeValidationError.wrap({ value, cause: result.error }),
266
+ error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error }),
268
267
  rawValue: value
269
268
  };
270
269
  } catch (error) {
271
270
  return {
272
271
  success: false,
273
- error: chunkIXZ2T2QX_cjs.TypeValidationError.wrap({ value, cause: error }),
272
+ error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: error }),
274
273
  rawValue: value
275
274
  };
276
275
  }
@@ -286,10 +285,10 @@ async function parseJSON({
286
285
  }
287
286
  return validateTypes({ value, schema });
288
287
  } catch (error) {
289
- if (chunkIXZ2T2QX_cjs.JSONParseError.isInstance(error) || chunkIXZ2T2QX_cjs.TypeValidationError.isInstance(error)) {
288
+ if (chunkF75EQ574_cjs.JSONParseError.isInstance(error) || chunkF75EQ574_cjs.TypeValidationError.isInstance(error)) {
290
289
  throw error;
291
290
  }
292
- throw new chunkIXZ2T2QX_cjs.JSONParseError({ text, cause: error });
291
+ throw new chunkF75EQ574_cjs.JSONParseError({ text, cause: error });
293
292
  }
294
293
  }
295
294
  async function safeParseJSON({
@@ -305,7 +304,7 @@ async function safeParseJSON({
305
304
  } catch (error) {
306
305
  return {
307
306
  success: false,
308
- error: chunkIXZ2T2QX_cjs.JSONParseError.isInstance(error) ? error : new chunkIXZ2T2QX_cjs.JSONParseError({ text, cause: error }),
307
+ error: chunkF75EQ574_cjs.JSONParseError.isInstance(error) ? error : new chunkF75EQ574_cjs.JSONParseError({ text, cause: error }),
309
308
  rawValue: void 0
310
309
  };
311
310
  }
@@ -322,7 +321,7 @@ function parseJsonEventStream({
322
321
  stream,
323
322
  schema
324
323
  }) {
325
- return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new chunkIXZ2T2QX_cjs.EventSourceParserStream()).pipeThrough(
324
+ return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new chunkF75EQ574_cjs.EventSourceParserStream()).pipeThrough(
326
325
  new TransformStream({
327
326
  async transform({ data }, controller) {
328
327
  if (data === "[DONE]") {
@@ -346,7 +345,7 @@ async function parseProviderOptions2({
346
345
  schema
347
346
  });
348
347
  if (!parsedProviderOptions.success) {
349
- throw new chunkIXZ2T2QX_cjs.InvalidArgumentError({
348
+ throw new chunkF75EQ574_cjs.InvalidArgumentError({
350
349
  argument: "providerOptions",
351
350
  message: `invalid ${provider} provider options`,
352
351
  cause: parsedProviderOptions.error
@@ -408,10 +407,10 @@ var postToApi = async ({
408
407
  requestBodyValues: body.values
409
408
  });
410
409
  } catch (error) {
411
- if (isAbortError(error) || chunkIXZ2T2QX_cjs.APICallError.isInstance(error)) {
410
+ if (isAbortError(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
412
411
  throw error;
413
412
  }
414
- throw new chunkIXZ2T2QX_cjs.APICallError({
413
+ throw new chunkF75EQ574_cjs.APICallError({
415
414
  message: "Failed to process error response",
416
415
  cause: error,
417
416
  statusCode: response.status,
@@ -430,11 +429,11 @@ var postToApi = async ({
430
429
  });
431
430
  } catch (error) {
432
431
  if (error instanceof Error) {
433
- if (isAbortError(error) || chunkIXZ2T2QX_cjs.APICallError.isInstance(error)) {
432
+ if (isAbortError(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
434
433
  throw error;
435
434
  }
436
435
  }
437
- throw new chunkIXZ2T2QX_cjs.APICallError({
436
+ throw new chunkF75EQ574_cjs.APICallError({
438
437
  message: "Failed to process successful response",
439
438
  cause: error,
440
439
  statusCode: response.status,
@@ -457,7 +456,7 @@ var createJsonErrorResponseHandler2 = ({
457
456
  if (responseBody.trim() === "") {
458
457
  return {
459
458
  responseHeaders,
460
- value: new chunkIXZ2T2QX_cjs.APICallError({
459
+ value: new chunkF75EQ574_cjs.APICallError({
461
460
  message: response.statusText,
462
461
  url,
463
462
  requestBodyValues,
@@ -475,7 +474,7 @@ var createJsonErrorResponseHandler2 = ({
475
474
  });
476
475
  return {
477
476
  responseHeaders,
478
- value: new chunkIXZ2T2QX_cjs.APICallError({
477
+ value: new chunkF75EQ574_cjs.APICallError({
479
478
  message: errorToMessage2(parsedError),
480
479
  url,
481
480
  requestBodyValues,
@@ -489,7 +488,7 @@ var createJsonErrorResponseHandler2 = ({
489
488
  } catch (parseError) {
490
489
  return {
491
490
  responseHeaders,
492
- value: new chunkIXZ2T2QX_cjs.APICallError({
491
+ value: new chunkF75EQ574_cjs.APICallError({
493
492
  message: response.statusText,
494
493
  url,
495
494
  requestBodyValues,
@@ -504,7 +503,7 @@ var createJsonErrorResponseHandler2 = ({
504
503
  var createEventSourceResponseHandler2 = (chunkSchema) => async ({ response }) => {
505
504
  const responseHeaders = extractResponseHeaders(response);
506
505
  if (response.body == null) {
507
- throw new chunkIXZ2T2QX_cjs.EmptyResponseBodyError({});
506
+ throw new chunkF75EQ574_cjs.EmptyResponseBodyError({});
508
507
  }
509
508
  return {
510
509
  responseHeaders,
@@ -522,7 +521,7 @@ var createJsonResponseHandler2 = (responseSchema) => async ({ response, url, req
522
521
  });
523
522
  const responseHeaders = extractResponseHeaders(response);
524
523
  if (!parsedResult.success) {
525
- throw new chunkIXZ2T2QX_cjs.APICallError({
524
+ throw new chunkF75EQ574_cjs.APICallError({
526
525
  message: "Invalid JSON response",
527
526
  cause: parsedResult.error,
528
527
  statusCode: response.status,
@@ -1954,7 +1953,7 @@ function prepareTools({
1954
1953
  };
1955
1954
  default: {
1956
1955
  const _exhaustiveCheck = type;
1957
- throw new chunkIXZ2T2QX_cjs.UnsupportedFunctionalityError({
1956
+ throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
1958
1957
  functionality: `tool choice type: ${_exhaustiveCheck}`
1959
1958
  });
1960
1959
  }
@@ -2243,13 +2242,13 @@ var DeepSeekChatLanguageModel = class {
2243
2242
  const index = toolCallDelta.index;
2244
2243
  if (toolCalls[index] == null) {
2245
2244
  if (toolCallDelta.id == null) {
2246
- throw new chunkIXZ2T2QX_cjs.InvalidResponseDataError({
2245
+ throw new chunkF75EQ574_cjs.InvalidResponseDataError({
2247
2246
  data: toolCallDelta,
2248
2247
  message: `Expected 'id' to be a string.`
2249
2248
  });
2250
2249
  }
2251
2250
  if (((_a15 = toolCallDelta.function) == null ? void 0 : _a15.name) == null) {
2252
- throw new chunkIXZ2T2QX_cjs.InvalidResponseDataError({
2251
+ throw new chunkF75EQ574_cjs.InvalidResponseDataError({
2253
2252
  data: toolCallDelta,
2254
2253
  message: `Expected 'function.name' to be a string.`
2255
2254
  });
@@ -2397,10 +2396,10 @@ function createDeepSeek(options = {}) {
2397
2396
  provider.languageModel = createLanguageModel;
2398
2397
  provider.chat = createLanguageModel;
2399
2398
  provider.textEmbeddingModel = (modelId) => {
2400
- throw new chunkIXZ2T2QX_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
2399
+ throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
2401
2400
  };
2402
2401
  provider.imageModel = (modelId) => {
2403
- throw new chunkIXZ2T2QX_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
2402
+ throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
2404
2403
  };
2405
2404
  return provider;
2406
2405
  }
@@ -2428,7 +2427,7 @@ function convertToMistralChatMessages(prompt) {
2428
2427
  const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
2429
2428
  return {
2430
2429
  type: "image_url",
2431
- image_url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${chunkOWIEOL55_cjs.convertToBase64(part.data)}`
2430
+ image_url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${chunkF75EQ574_cjs.convertToBase64(part.data)}`
2432
2431
  };
2433
2432
  } else if (part.mediaType === "application/pdf") {
2434
2433
  return {
@@ -2436,7 +2435,7 @@ function convertToMistralChatMessages(prompt) {
2436
2435
  document_url: part.data.toString()
2437
2436
  };
2438
2437
  } else {
2439
- throw new chunkIXZ2T2QX_cjs.UnsupportedFunctionalityError({
2438
+ throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
2440
2439
  functionality: "Only images and PDF file parts are supported"
2441
2440
  });
2442
2441
  }
@@ -2577,7 +2576,7 @@ var mistralErrorDataSchema = z4.z.object({
2577
2576
  param: z4.z.string().nullable(),
2578
2577
  code: z4.z.string().nullable()
2579
2578
  });
2580
- var mistralFailedResponseHandler = chunkOWIEOL55_cjs.createJsonErrorResponseHandler({
2579
+ var mistralFailedResponseHandler = chunkF75EQ574_cjs.createJsonErrorResponseHandler({
2581
2580
  errorSchema: mistralErrorDataSchema,
2582
2581
  errorToMessage: (data) => data.message
2583
2582
  });
@@ -2627,7 +2626,7 @@ function prepareTools2({
2627
2626
  };
2628
2627
  default: {
2629
2628
  const _exhaustiveCheck = type;
2630
- throw new chunkIXZ2T2QX_cjs.UnsupportedFunctionalityError({
2629
+ throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
2631
2630
  functionality: `tool choice type: ${_exhaustiveCheck}`
2632
2631
  });
2633
2632
  }
@@ -2642,7 +2641,7 @@ var MistralChatLanguageModel = class {
2642
2641
  var _a15;
2643
2642
  this.modelId = modelId;
2644
2643
  this.config = config;
2645
- this.generateId = (_a15 = config.generateId) != null ? _a15 : chunkOWIEOL55_cjs.generateId;
2644
+ this.generateId = (_a15 = config.generateId) != null ? _a15 : chunkF75EQ574_cjs.generateId;
2646
2645
  }
2647
2646
  get provider() {
2648
2647
  return this.config.provider;
@@ -2664,7 +2663,7 @@ var MistralChatLanguageModel = class {
2664
2663
  }) {
2665
2664
  var _a15, _b, _c, _d;
2666
2665
  const warnings = [];
2667
- const options = (_a15 = await chunkOWIEOL55_cjs.parseProviderOptions({
2666
+ const options = (_a15 = await chunkF75EQ574_cjs.parseProviderOptions({
2668
2667
  provider: "mistral",
2669
2668
  providerOptions,
2670
2669
  schema: mistralLanguageModelOptions
@@ -2696,7 +2695,7 @@ var MistralChatLanguageModel = class {
2696
2695
  const structuredOutputs = (_b = options.structuredOutputs) != null ? _b : true;
2697
2696
  const strictJsonSchema = (_c = options.strictJsonSchema) != null ? _c : false;
2698
2697
  if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && !(responseFormat == null ? void 0 : responseFormat.schema)) {
2699
- prompt = chunkOWIEOL55_cjs.injectJsonInstructionIntoMessages({
2698
+ prompt = chunkF75EQ574_cjs.injectJsonInstructionIntoMessages({
2700
2699
  messages: prompt,
2701
2700
  schema: responseFormat.schema
2702
2701
  });
@@ -2751,12 +2750,12 @@ var MistralChatLanguageModel = class {
2751
2750
  responseHeaders,
2752
2751
  value: response,
2753
2752
  rawValue: rawResponse
2754
- } = await chunkOWIEOL55_cjs.postJsonToApi({
2753
+ } = await chunkF75EQ574_cjs.postJsonToApi({
2755
2754
  url: `${this.config.baseURL}/chat/completions`,
2756
- headers: chunkOWIEOL55_cjs.combineHeaders(this.config.headers(), options.headers),
2755
+ headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
2757
2756
  body,
2758
2757
  failedResponseHandler: mistralFailedResponseHandler,
2759
- successfulResponseHandler: chunkOWIEOL55_cjs.createJsonResponseHandler(
2758
+ successfulResponseHandler: chunkF75EQ574_cjs.createJsonResponseHandler(
2760
2759
  mistralChatResponseSchema
2761
2760
  ),
2762
2761
  abortSignal: options.abortSignal,
@@ -2813,12 +2812,12 @@ var MistralChatLanguageModel = class {
2813
2812
  async doStream(options) {
2814
2813
  const { args, warnings } = await this.getArgs(options);
2815
2814
  const body = { ...args, stream: true };
2816
- const { responseHeaders, value: response } = await chunkOWIEOL55_cjs.postJsonToApi({
2815
+ const { responseHeaders, value: response } = await chunkF75EQ574_cjs.postJsonToApi({
2817
2816
  url: `${this.config.baseURL}/chat/completions`,
2818
- headers: chunkOWIEOL55_cjs.combineHeaders(this.config.headers(), options.headers),
2817
+ headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
2819
2818
  body,
2820
2819
  failedResponseHandler: mistralFailedResponseHandler,
2821
- successfulResponseHandler: chunkOWIEOL55_cjs.createEventSourceResponseHandler(
2820
+ successfulResponseHandler: chunkF75EQ574_cjs.createEventSourceResponseHandler(
2822
2821
  mistralChatChunkSchema
2823
2822
  ),
2824
2823
  abortSignal: options.abortSignal,
@@ -3091,7 +3090,7 @@ var MistralEmbeddingModel = class {
3091
3090
  headers
3092
3091
  }) {
3093
3092
  if (values.length > this.maxEmbeddingsPerCall) {
3094
- throw new chunkIXZ2T2QX_cjs.TooManyEmbeddingValuesForCallError({
3093
+ throw new chunkF75EQ574_cjs.TooManyEmbeddingValuesForCallError({
3095
3094
  provider: this.provider,
3096
3095
  modelId: this.modelId,
3097
3096
  maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,
@@ -3102,16 +3101,16 @@ var MistralEmbeddingModel = class {
3102
3101
  responseHeaders,
3103
3102
  value: response,
3104
3103
  rawValue
3105
- } = await chunkOWIEOL55_cjs.postJsonToApi({
3104
+ } = await chunkF75EQ574_cjs.postJsonToApi({
3106
3105
  url: `${this.config.baseURL}/embeddings`,
3107
- headers: chunkOWIEOL55_cjs.combineHeaders(this.config.headers(), headers),
3106
+ headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), headers),
3108
3107
  body: {
3109
3108
  model: this.modelId,
3110
3109
  input: values,
3111
3110
  encoding_format: "float"
3112
3111
  },
3113
3112
  failedResponseHandler: mistralFailedResponseHandler,
3114
- successfulResponseHandler: chunkOWIEOL55_cjs.createJsonResponseHandler(
3113
+ successfulResponseHandler: chunkF75EQ574_cjs.createJsonResponseHandler(
3115
3114
  MistralTextEmbeddingResponseSchema
3116
3115
  ),
3117
3116
  abortSignal,
@@ -3131,10 +3130,10 @@ var MistralTextEmbeddingResponseSchema = z4.z.object({
3131
3130
  var VERSION3 = "2.0.24" ;
3132
3131
  function createMistral(options = {}) {
3133
3132
  var _a15;
3134
- const baseURL = (_a15 = chunkOWIEOL55_cjs.withoutTrailingSlash(options.baseURL)) != null ? _a15 : "https://api.mistral.ai/v1";
3135
- const getHeaders = () => chunkOWIEOL55_cjs.withUserAgentSuffix(
3133
+ const baseURL = (_a15 = chunkF75EQ574_cjs.withoutTrailingSlash(options.baseURL)) != null ? _a15 : "https://api.mistral.ai/v1";
3134
+ const getHeaders = () => chunkF75EQ574_cjs.withUserAgentSuffix(
3136
3135
  {
3137
- Authorization: `Bearer ${chunkOWIEOL55_cjs.loadApiKey({
3136
+ Authorization: `Bearer ${chunkF75EQ574_cjs.loadApiKey({
3138
3137
  apiKey: options.apiKey,
3139
3138
  environmentVariableName: "MISTRAL_API_KEY",
3140
3139
  description: "Mistral"
@@ -3170,7 +3169,7 @@ function createMistral(options = {}) {
3170
3169
  provider.textEmbedding = createEmbeddingModel;
3171
3170
  provider.textEmbeddingModel = createEmbeddingModel;
3172
3171
  provider.imageModel = (modelId) => {
3173
- throw new chunkIXZ2T2QX_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
3172
+ throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
3174
3173
  };
3175
3174
  return provider;
3176
3175
  }
@@ -3210,7 +3209,7 @@ var createIdGenerator2 = ({
3210
3209
  return generator;
3211
3210
  }
3212
3211
  if (alphabet.includes(separator)) {
3213
- throw new chunkIXZ2T2QX_cjs.InvalidArgumentError({
3212
+ throw new chunkF75EQ574_cjs.InvalidArgumentError({
3214
3213
  argument: "separator",
3215
3214
  message: `The separator "${separator}" must not be part of the alphabet "${alphabet}".`
3216
3215
  });
@@ -3234,7 +3233,7 @@ function handleFetchError2({
3234
3233
  if (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES2.includes(error.message.toLowerCase())) {
3235
3234
  const cause = error.cause;
3236
3235
  if (cause != null) {
3237
- return new chunkIXZ2T2QX_cjs.APICallError({
3236
+ return new chunkF75EQ574_cjs.APICallError({
3238
3237
  message: `Cannot connect to API: ${cause.message}`,
3239
3238
  cause,
3240
3239
  url,
@@ -3261,23 +3260,23 @@ function loadApiKey3({
3261
3260
  return apiKey;
3262
3261
  }
3263
3262
  if (apiKey != null) {
3264
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
3263
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
3265
3264
  message: `${description} API key must be a string.`
3266
3265
  });
3267
3266
  }
3268
3267
  if (typeof process === "undefined") {
3269
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
3268
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
3270
3269
  message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables is not supported in this environment.`
3271
3270
  });
3272
3271
  }
3273
3272
  apiKey = process.env[environmentVariableName];
3274
3273
  if (apiKey == null) {
3275
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
3274
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
3276
3275
  message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.`
3277
3276
  });
3278
3277
  }
3279
3278
  if (typeof apiKey !== "string") {
3280
- throw new chunkIXZ2T2QX_cjs.LoadAPIKeyError({
3279
+ throw new chunkF75EQ574_cjs.LoadAPIKeyError({
3281
3280
  message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.`
3282
3281
  });
3283
3282
  }
@@ -3341,7 +3340,7 @@ function standardSchemaValidator2(standardSchema) {
3341
3340
  const result = await standardSchema["~standard"].validate(value);
3342
3341
  return result.issues == null ? { success: true, value: result.value } : {
3343
3342
  success: false,
3344
- error: new chunkIXZ2T2QX_cjs.TypeValidationError({
3343
+ error: new chunkF75EQ574_cjs.TypeValidationError({
3345
3344
  value,
3346
3345
  cause: result.issues
3347
3346
  })
@@ -3354,7 +3353,7 @@ async function validateTypes2({
3354
3353
  }) {
3355
3354
  const result = await safeValidateTypes2({ value, schema });
3356
3355
  if (!result.success) {
3357
- throw chunkIXZ2T2QX_cjs.TypeValidationError.wrap({ value, cause: result.error });
3356
+ throw chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error });
3358
3357
  }
3359
3358
  return result.value;
3360
3359
  }
@@ -3373,13 +3372,13 @@ async function safeValidateTypes2({
3373
3372
  }
3374
3373
  return {
3375
3374
  success: false,
3376
- error: chunkIXZ2T2QX_cjs.TypeValidationError.wrap({ value, cause: result.error }),
3375
+ error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error }),
3377
3376
  rawValue: value
3378
3377
  };
3379
3378
  } catch (error) {
3380
3379
  return {
3381
3380
  success: false,
3382
- error: chunkIXZ2T2QX_cjs.TypeValidationError.wrap({ value, cause: error }),
3381
+ error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: error }),
3383
3382
  rawValue: value
3384
3383
  };
3385
3384
  }
@@ -3395,10 +3394,10 @@ async function parseJSON2({
3395
3394
  }
3396
3395
  return validateTypes2({ value, schema });
3397
3396
  } catch (error) {
3398
- if (chunkIXZ2T2QX_cjs.JSONParseError.isInstance(error) || chunkIXZ2T2QX_cjs.TypeValidationError.isInstance(error)) {
3397
+ if (chunkF75EQ574_cjs.JSONParseError.isInstance(error) || chunkF75EQ574_cjs.TypeValidationError.isInstance(error)) {
3399
3398
  throw error;
3400
3399
  }
3401
- throw new chunkIXZ2T2QX_cjs.JSONParseError({ text, cause: error });
3400
+ throw new chunkF75EQ574_cjs.JSONParseError({ text, cause: error });
3402
3401
  }
3403
3402
  }
3404
3403
  async function safeParseJSON2({
@@ -3414,7 +3413,7 @@ async function safeParseJSON2({
3414
3413
  } catch (error) {
3415
3414
  return {
3416
3415
  success: false,
3417
- error: chunkIXZ2T2QX_cjs.JSONParseError.isInstance(error) ? error : new chunkIXZ2T2QX_cjs.JSONParseError({ text, cause: error }),
3416
+ error: chunkF75EQ574_cjs.JSONParseError.isInstance(error) ? error : new chunkF75EQ574_cjs.JSONParseError({ text, cause: error }),
3418
3417
  rawValue: void 0
3419
3418
  };
3420
3419
  }
@@ -3423,7 +3422,7 @@ function parseJsonEventStream2({
3423
3422
  stream,
3424
3423
  schema
3425
3424
  }) {
3426
- return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new chunkIXZ2T2QX_cjs.EventSourceParserStream()).pipeThrough(
3425
+ return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new chunkF75EQ574_cjs.EventSourceParserStream()).pipeThrough(
3427
3426
  new TransformStream({
3428
3427
  async transform({ data }, controller) {
3429
3428
  if (data === "[DONE]") {
@@ -3484,10 +3483,10 @@ var postToApi2 = async ({
3484
3483
  requestBodyValues: body.values
3485
3484
  });
3486
3485
  } catch (error) {
3487
- if (isAbortError2(error) || chunkIXZ2T2QX_cjs.APICallError.isInstance(error)) {
3486
+ if (isAbortError2(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
3488
3487
  throw error;
3489
3488
  }
3490
- throw new chunkIXZ2T2QX_cjs.APICallError({
3489
+ throw new chunkF75EQ574_cjs.APICallError({
3491
3490
  message: "Failed to process error response",
3492
3491
  cause: error,
3493
3492
  statusCode: response.status,
@@ -3506,11 +3505,11 @@ var postToApi2 = async ({
3506
3505
  });
3507
3506
  } catch (error) {
3508
3507
  if (error instanceof Error) {
3509
- if (isAbortError2(error) || chunkIXZ2T2QX_cjs.APICallError.isInstance(error)) {
3508
+ if (isAbortError2(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
3510
3509
  throw error;
3511
3510
  }
3512
3511
  }
3513
- throw new chunkIXZ2T2QX_cjs.APICallError({
3512
+ throw new chunkF75EQ574_cjs.APICallError({
3514
3513
  message: "Failed to process successful response",
3515
3514
  cause: error,
3516
3515
  statusCode: response.status,
@@ -3533,7 +3532,7 @@ var createJsonErrorResponseHandler3 = ({
3533
3532
  if (responseBody.trim() === "") {
3534
3533
  return {
3535
3534
  responseHeaders,
3536
- value: new chunkIXZ2T2QX_cjs.APICallError({
3535
+ value: new chunkF75EQ574_cjs.APICallError({
3537
3536
  message: response.statusText,
3538
3537
  url,
3539
3538
  requestBodyValues,
@@ -3551,7 +3550,7 @@ var createJsonErrorResponseHandler3 = ({
3551
3550
  });
3552
3551
  return {
3553
3552
  responseHeaders,
3554
- value: new chunkIXZ2T2QX_cjs.APICallError({
3553
+ value: new chunkF75EQ574_cjs.APICallError({
3555
3554
  message: errorToMessage2(parsedError),
3556
3555
  url,
3557
3556
  requestBodyValues,
@@ -3565,7 +3564,7 @@ var createJsonErrorResponseHandler3 = ({
3565
3564
  } catch (parseError) {
3566
3565
  return {
3567
3566
  responseHeaders,
3568
- value: new chunkIXZ2T2QX_cjs.APICallError({
3567
+ value: new chunkF75EQ574_cjs.APICallError({
3569
3568
  message: response.statusText,
3570
3569
  url,
3571
3570
  requestBodyValues,
@@ -3580,7 +3579,7 @@ var createJsonErrorResponseHandler3 = ({
3580
3579
  var createEventSourceResponseHandler3 = (chunkSchema) => async ({ response }) => {
3581
3580
  const responseHeaders = extractResponseHeaders2(response);
3582
3581
  if (response.body == null) {
3583
- throw new chunkIXZ2T2QX_cjs.EmptyResponseBodyError({});
3582
+ throw new chunkF75EQ574_cjs.EmptyResponseBodyError({});
3584
3583
  }
3585
3584
  return {
3586
3585
  responseHeaders,
@@ -3598,7 +3597,7 @@ var createJsonResponseHandler3 = (responseSchema) => async ({ response, url, req
3598
3597
  });
3599
3598
  const responseHeaders = extractResponseHeaders2(response);
3600
3599
  if (!parsedResult.success) {
3601
- throw new chunkIXZ2T2QX_cjs.APICallError({
3600
+ throw new chunkF75EQ574_cjs.APICallError({
3602
3601
  message: "Invalid JSON response",
3603
3602
  cause: parsedResult.error,
3604
3603
  statusCode: response.status,
@@ -3669,7 +3668,7 @@ function convertToPerplexityMessages(prompt) {
3669
3668
  break;
3670
3669
  }
3671
3670
  case "tool": {
3672
- throw new chunkIXZ2T2QX_cjs.UnsupportedFunctionalityError({
3671
+ throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
3673
3672
  functionality: "Tool messages"
3674
3673
  });
3675
3674
  }
@@ -4038,10 +4037,10 @@ function createPerplexity(options = {}) {
4038
4037
  const provider = (modelId) => createLanguageModel(modelId);
4039
4038
  provider.languageModel = createLanguageModel;
4040
4039
  provider.textEmbeddingModel = (modelId) => {
4041
- throw new chunkIXZ2T2QX_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
4040
+ throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
4042
4041
  };
4043
4042
  provider.imageModel = (modelId) => {
4044
- throw new chunkIXZ2T2QX_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
4043
+ throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
4045
4044
  };
4046
4045
  return provider;
4047
4046
  }
@@ -4073,11 +4072,11 @@ function convertToXaiChatMessages(prompt) {
4073
4072
  return {
4074
4073
  type: "image_url",
4075
4074
  image_url: {
4076
- url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${chunkOWIEOL55_cjs.convertToBase64(part.data)}`
4075
+ url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${chunkF75EQ574_cjs.convertToBase64(part.data)}`
4077
4076
  }
4078
4077
  };
4079
4078
  } else {
4080
- throw new chunkIXZ2T2QX_cjs.UnsupportedFunctionalityError({
4079
+ throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
4081
4080
  functionality: `file part media type ${part.mediaType}`
4082
4081
  });
4083
4082
  }
@@ -4258,7 +4257,7 @@ var xaiErrorDataSchema = z4.z.object({
4258
4257
  code: z4.z.union([z4.z.string(), z4.z.number()]).nullish()
4259
4258
  })
4260
4259
  });
4261
- var xaiFailedResponseHandler = chunkOWIEOL55_cjs.createJsonErrorResponseHandler({
4260
+ var xaiFailedResponseHandler = chunkF75EQ574_cjs.createJsonErrorResponseHandler({
4262
4261
  errorSchema: xaiErrorDataSchema,
4263
4262
  errorToMessage: (data) => data.error.message
4264
4263
  });
@@ -4307,7 +4306,7 @@ function prepareTools3({
4307
4306
  };
4308
4307
  default: {
4309
4308
  const _exhaustiveCheck = type;
4310
- throw new chunkIXZ2T2QX_cjs.UnsupportedFunctionalityError({
4309
+ throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
4311
4310
  functionality: `tool choice type: ${_exhaustiveCheck}`
4312
4311
  });
4313
4312
  }
@@ -4342,7 +4341,7 @@ var XaiChatLanguageModel = class {
4342
4341
  }) {
4343
4342
  var _a15, _b, _c;
4344
4343
  const warnings = [];
4345
- const options = (_a15 = await chunkOWIEOL55_cjs.parseProviderOptions({
4344
+ const options = (_a15 = await chunkF75EQ574_cjs.parseProviderOptions({
4346
4345
  provider: "xai",
4347
4346
  providerOptions,
4348
4347
  schema: xaiProviderOptions
@@ -4454,12 +4453,12 @@ var XaiChatLanguageModel = class {
4454
4453
  responseHeaders,
4455
4454
  value: response,
4456
4455
  rawValue: rawResponse
4457
- } = await chunkOWIEOL55_cjs.postJsonToApi({
4456
+ } = await chunkF75EQ574_cjs.postJsonToApi({
4458
4457
  url: `${(_a15 = this.config.baseURL) != null ? _a15 : "https://api.x.ai/v1"}/chat/completions`,
4459
- headers: chunkOWIEOL55_cjs.combineHeaders(this.config.headers(), options.headers),
4458
+ headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
4460
4459
  body,
4461
4460
  failedResponseHandler: xaiFailedResponseHandler,
4462
- successfulResponseHandler: chunkOWIEOL55_cjs.createJsonResponseHandler(
4461
+ successfulResponseHandler: chunkF75EQ574_cjs.createJsonResponseHandler(
4463
4462
  xaiChatResponseSchema
4464
4463
  ),
4465
4464
  abortSignal: options.abortSignal,
@@ -4531,12 +4530,12 @@ var XaiChatLanguageModel = class {
4531
4530
  include_usage: true
4532
4531
  }
4533
4532
  };
4534
- const { responseHeaders, value: response } = await chunkOWIEOL55_cjs.postJsonToApi({
4533
+ const { responseHeaders, value: response } = await chunkF75EQ574_cjs.postJsonToApi({
4535
4534
  url: `${(_a15 = this.config.baseURL) != null ? _a15 : "https://api.x.ai/v1"}/chat/completions`,
4536
- headers: chunkOWIEOL55_cjs.combineHeaders(this.config.headers(), options.headers),
4535
+ headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
4537
4536
  body,
4538
4537
  failedResponseHandler: xaiFailedResponseHandler,
4539
- successfulResponseHandler: chunkOWIEOL55_cjs.createEventSourceResponseHandler(xaiChatChunkSchema),
4538
+ successfulResponseHandler: chunkF75EQ574_cjs.createEventSourceResponseHandler(xaiChatChunkSchema),
4540
4539
  abortSignal: options.abortSignal,
4541
4540
  fetch: this.config.fetch
4542
4541
  });
@@ -4751,12 +4750,12 @@ var xaiErrorStructure = {
4751
4750
  };
4752
4751
  function createXai(options = {}) {
4753
4752
  var _a15;
4754
- const baseURL = chunkOWIEOL55_cjs.withoutTrailingSlash(
4753
+ const baseURL = chunkF75EQ574_cjs.withoutTrailingSlash(
4755
4754
  (_a15 = options.baseURL) != null ? _a15 : "https://api.x.ai/v1"
4756
4755
  );
4757
- const getHeaders = () => chunkOWIEOL55_cjs.withUserAgentSuffix(
4756
+ const getHeaders = () => chunkF75EQ574_cjs.withUserAgentSuffix(
4758
4757
  {
4759
- Authorization: `Bearer ${chunkOWIEOL55_cjs.loadApiKey({
4758
+ Authorization: `Bearer ${chunkF75EQ574_cjs.loadApiKey({
4760
4759
  apiKey: options.apiKey,
4761
4760
  environmentVariableName: "XAI_API_KEY",
4762
4761
  description: "xAI API key"
@@ -4770,12 +4769,12 @@ function createXai(options = {}) {
4770
4769
  provider: "xai.chat",
4771
4770
  baseURL,
4772
4771
  headers: getHeaders,
4773
- generateId: chunkOWIEOL55_cjs.generateId,
4772
+ generateId: chunkF75EQ574_cjs.generateId,
4774
4773
  fetch: options.fetch
4775
4774
  });
4776
4775
  };
4777
4776
  const createImageModel = (modelId) => {
4778
- return new chunkOWIEOL55_cjs.OpenAICompatibleImageModel(modelId, {
4777
+ return new chunkF75EQ574_cjs.OpenAICompatibleImageModel(modelId, {
4779
4778
  provider: "xai.image",
4780
4779
  url: ({ path }) => `${baseURL}${path}`,
4781
4780
  headers: getHeaders,
@@ -4787,7 +4786,7 @@ function createXai(options = {}) {
4787
4786
  provider.languageModel = createLanguageModel;
4788
4787
  provider.chat = createLanguageModel;
4789
4788
  provider.textEmbeddingModel = (modelId) => {
4790
- throw new chunkIXZ2T2QX_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
4789
+ throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
4791
4790
  };
4792
4791
  provider.imageModel = createImageModel;
4793
4792
  provider.image = createImageModel;
@@ -7317,7 +7316,7 @@ var OPENAI_COMPATIBLE_OVERRIDES = {
7317
7316
  apiKeyEnvVar: "AI_GATEWAY_API_KEY"
7318
7317
  }
7319
7318
  };
7320
- var ModelsDevGateway = class extends chunkOWIEOL55_cjs.MastraModelGateway {
7319
+ var ModelsDevGateway = class extends chunkF75EQ574_cjs.MastraModelGateway {
7321
7320
  id = "models.dev";
7322
7321
  name = "models.dev";
7323
7322
  providerConfigs = {};
@@ -7397,14 +7396,14 @@ var ModelsDevGateway = class extends chunkOWIEOL55_cjs.MastraModelGateway {
7397
7396
  const baseURL = this.buildUrl(`${providerId}/${modelId}`);
7398
7397
  switch (providerId) {
7399
7398
  case "openai":
7400
- return chunkOWIEOL55_cjs.createOpenAI({ apiKey }).responses(modelId);
7399
+ return chunkF75EQ574_cjs.createOpenAI({ apiKey }).responses(modelId);
7401
7400
  case "gemini":
7402
7401
  case "google":
7403
- return chunkOWIEOL55_cjs.createGoogleGenerativeAI({
7402
+ return chunkF75EQ574_cjs.createGoogleGenerativeAI({
7404
7403
  apiKey
7405
7404
  }).chat(modelId);
7406
7405
  case "anthropic":
7407
- return chunkOWIEOL55_cjs.createAnthropic({ apiKey })(modelId);
7406
+ return chunkF75EQ574_cjs.createAnthropic({ apiKey })(modelId);
7408
7407
  case "mistral":
7409
7408
  return createMistral({ apiKey })(modelId);
7410
7409
  case "openrouter":
@@ -7421,7 +7420,7 @@ var ModelsDevGateway = class extends chunkOWIEOL55_cjs.MastraModelGateway {
7421
7420
  return createPerplexity({ apiKey })(modelId);
7422
7421
  default:
7423
7422
  if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);
7424
- return chunkOWIEOL55_cjs.createOpenAICompatible({ name: providerId, apiKey, baseURL, supportsStructuredOutputs: true }).chatModel(
7423
+ return chunkF75EQ574_cjs.createOpenAICompatible({ name: providerId, apiKey, baseURL, supportsStructuredOutputs: true }).chatModel(
7425
7424
  modelId
7426
7425
  );
7427
7426
  }
@@ -7430,5 +7429,5 @@ var ModelsDevGateway = class extends chunkOWIEOL55_cjs.MastraModelGateway {
7430
7429
 
7431
7430
  exports.ModelsDevGateway = ModelsDevGateway;
7432
7431
  exports.parseModelRouterId = parseModelRouterId;
7433
- //# sourceMappingURL=chunk-Y7MZ5LJT.cjs.map
7434
- //# sourceMappingURL=chunk-Y7MZ5LJT.cjs.map
7432
+ //# sourceMappingURL=chunk-EGHGFLL3.cjs.map
7433
+ //# sourceMappingURL=chunk-EGHGFLL3.cjs.map