ai 5.0.0-canary.14 → 5.0.0-canary.15

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/dist/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name17 in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // index.ts
@@ -61,7 +51,7 @@ __export(ai_exports, {
61
51
  UnsupportedFunctionalityError: () => import_provider21.UnsupportedFunctionalityError,
62
52
  appendClientMessage: () => appendClientMessage,
63
53
  appendResponseMessages: () => appendResponseMessages,
64
- asSchema: () => asSchema,
54
+ asSchema: () => import_provider_utils4.asSchema,
65
55
  callChatApi: () => callChatApi,
66
56
  callCompletionApi: () => callCompletionApi,
67
57
  convertToCoreMessages: () => convertToCoreMessages,
@@ -73,7 +63,7 @@ __export(ai_exports, {
73
63
  cosineSimilarity: () => cosineSimilarity,
74
64
  createDataStream: () => createDataStream,
75
65
  createDataStreamResponse: () => createDataStreamResponse,
76
- createIdGenerator: () => import_provider_utils22.createIdGenerator,
66
+ createIdGenerator: () => import_provider_utils21.createIdGenerator,
77
67
  createProviderRegistry: () => createProviderRegistry,
78
68
  customProvider: () => customProvider,
79
69
  defaultSettingsMiddleware: () => defaultSettingsMiddleware,
@@ -89,14 +79,14 @@ __export(ai_exports, {
89
79
  extractReasoningMiddleware: () => extractReasoningMiddleware,
90
80
  fillMessageParts: () => fillMessageParts,
91
81
  formatDataStreamPart: () => formatDataStreamPart,
92
- generateId: () => import_provider_utils22.generateId,
82
+ generateId: () => import_provider_utils21.generateId,
93
83
  generateObject: () => generateObject,
94
84
  generateText: () => generateText,
95
85
  getMessageParts: () => getMessageParts,
96
86
  getTextFromDataUrl: () => getTextFromDataUrl,
97
87
  isAssistantMessageWithCompletedToolCalls: () => isAssistantMessageWithCompletedToolCalls,
98
88
  isDeepEqualData: () => isDeepEqualData,
99
- jsonSchema: () => jsonSchema,
89
+ jsonSchema: () => import_provider_utils4.jsonSchema,
100
90
  parseDataStreamPart: () => parseDataStreamPart,
101
91
  parsePartialJson: () => parsePartialJson,
102
92
  pipeDataStreamToResponse: () => pipeDataStreamToResponse,
@@ -111,16 +101,15 @@ __export(ai_exports, {
111
101
  streamText: () => streamText,
112
102
  tool: () => tool,
113
103
  updateToolCallResult: () => updateToolCallResult,
114
- wrapLanguageModel: () => wrapLanguageModel,
115
- zodSchema: () => zodSchema
104
+ wrapLanguageModel: () => wrapLanguageModel
116
105
  });
117
106
  module.exports = __toCommonJS(ai_exports);
118
107
 
119
108
  // core/index.ts
120
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
109
+ var import_provider_utils21 = require("@ai-sdk/provider-utils");
121
110
 
122
111
  // core/util/index.ts
123
- var import_provider_utils5 = require("@ai-sdk/provider-utils");
112
+ var import_provider_utils4 = require("@ai-sdk/provider-utils");
124
113
 
125
114
  // core/util/process-chat-response.ts
126
115
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
@@ -935,7 +924,6 @@ async function processChatResponse({
935
924
  execUpdate();
936
925
  },
937
926
  onReasoningPart(value) {
938
- var _a18;
939
927
  if (currentReasoningPart == null) {
940
928
  currentReasoningPart = {
941
929
  type: "reasoning",
@@ -947,7 +935,6 @@ async function processChatResponse({
947
935
  currentReasoningPart.reasoning += value.text;
948
936
  currentReasoningPart.providerMetadata = value.providerMetadata;
949
937
  }
950
- message.reasoning = ((_a18 = message.reasoning) != null ? _a18 : "") + value.text;
951
938
  execUpdate();
952
939
  },
953
940
  onReasoningPartFinish(value) {
@@ -1370,12 +1357,6 @@ function getMessageParts(message) {
1370
1357
  type: "tool-invocation",
1371
1358
  toolInvocation
1372
1359
  })) : [],
1373
- ...message.reasoning ? [
1374
- {
1375
- type: "reasoning",
1376
- reasoning: message.reasoning
1377
- }
1378
- ] : [],
1379
1360
  ...message.content ? [{ type: "text", text: message.content }] : []
1380
1361
  ];
1381
1362
  }
@@ -1455,51 +1436,29 @@ async function prepareAttachmentsForRequest(attachmentsFromOptions) {
1455
1436
  throw new Error("Invalid attachments type");
1456
1437
  }
1457
1438
 
1458
- // core/util/schema.ts
1459
- var import_provider_utils4 = require("@ai-sdk/provider-utils");
1460
-
1461
- // core/util/zod-schema.ts
1462
- var import_zod_to_json_schema = __toESM(require("zod-to-json-schema"));
1463
- function zodSchema(zodSchema2, options) {
1439
+ // core/util/update-tool-call-result.ts
1440
+ function updateToolCallResult({
1441
+ messages,
1442
+ toolCallId,
1443
+ toolResult: result
1444
+ }) {
1464
1445
  var _a17;
1465
- const useReferences = (_a17 = options == null ? void 0 : options.useReferences) != null ? _a17 : false;
1466
- return jsonSchema(
1467
- (0, import_zod_to_json_schema.default)(zodSchema2, {
1468
- $refStrategy: useReferences ? "root" : "none",
1469
- target: "jsonSchema7"
1470
- // note: openai mode breaks various gemini conversions
1471
- }),
1472
- {
1473
- validate: (value) => {
1474
- const result = zodSchema2.safeParse(value);
1475
- return result.success ? { success: true, value: result.data } : { success: false, error: result.error };
1476
- }
1477
- }
1446
+ const lastMessage = messages[messages.length - 1];
1447
+ const invocationPart = lastMessage.parts.find(
1448
+ (part) => part.type === "tool-invocation" && part.toolInvocation.toolCallId === toolCallId
1478
1449
  );
1479
- }
1480
-
1481
- // core/util/schema.ts
1482
- var schemaSymbol = Symbol.for("vercel.ai.schema");
1483
- function jsonSchema(jsonSchema2, {
1484
- validate
1485
- } = {}) {
1486
- return {
1487
- [schemaSymbol]: true,
1488
- _type: void 0,
1489
- // should never be used directly
1490
- [import_provider_utils4.validatorSymbol]: true,
1491
- jsonSchema: jsonSchema2,
1492
- validate
1450
+ if (invocationPart == null) {
1451
+ return;
1452
+ }
1453
+ const toolResult = {
1454
+ ...invocationPart.toolInvocation,
1455
+ state: "result",
1456
+ result
1493
1457
  };
1494
- }
1495
- function isSchema(value) {
1496
- return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value;
1497
- }
1498
- function asSchema(schema) {
1499
- return schema == null ? jsonSchema({
1500
- properties: {},
1501
- additionalProperties: false
1502
- }) : isSchema(schema) ? schema : zodSchema(schema);
1458
+ invocationPart.toolInvocation = toolResult;
1459
+ lastMessage.toolInvocations = (_a17 = lastMessage.toolInvocations) == null ? void 0 : _a17.map(
1460
+ (toolInvocation) => toolInvocation.toolCallId === toolCallId ? toolResult : toolInvocation
1461
+ );
1503
1462
  }
1504
1463
 
1505
1464
  // core/util/should-resubmit-messages.ts
@@ -1531,31 +1490,6 @@ function isAssistantMessageWithCompletedToolCalls(message) {
1531
1490
  return lastStepToolInvocations.length > 0 && lastStepToolInvocations.every((part) => "result" in part.toolInvocation);
1532
1491
  }
1533
1492
 
1534
- // core/util/update-tool-call-result.ts
1535
- function updateToolCallResult({
1536
- messages,
1537
- toolCallId,
1538
- toolResult: result
1539
- }) {
1540
- var _a17;
1541
- const lastMessage = messages[messages.length - 1];
1542
- const invocationPart = lastMessage.parts.find(
1543
- (part) => part.type === "tool-invocation" && part.toolInvocation.toolCallId === toolCallId
1544
- );
1545
- if (invocationPart == null) {
1546
- return;
1547
- }
1548
- const toolResult = {
1549
- ...invocationPart.toolInvocation,
1550
- state: "result",
1551
- result
1552
- };
1553
- invocationPart.toolInvocation = toolResult;
1554
- lastMessage.toolInvocations = (_a17 = lastMessage.toolInvocations) == null ? void 0 : _a17.map(
1555
- (toolInvocation) => toolInvocation.toolCallId === toolCallId ? toolResult : toolInvocation
1556
- );
1557
- }
1558
-
1559
1493
  // core/data-stream/create-data-stream.ts
1560
1494
  function createDataStream({
1561
1495
  execute,
@@ -1764,7 +1698,7 @@ _a = symbol;
1764
1698
 
1765
1699
  // util/retry-with-exponential-backoff.ts
1766
1700
  var import_provider3 = require("@ai-sdk/provider");
1767
- var import_provider_utils6 = require("@ai-sdk/provider-utils");
1701
+ var import_provider_utils5 = require("@ai-sdk/provider-utils");
1768
1702
 
1769
1703
  // util/retry-error.ts
1770
1704
  var import_provider2 = require("@ai-sdk/provider");
@@ -1808,13 +1742,13 @@ async function _retryWithExponentialBackoff(f, {
1808
1742
  try {
1809
1743
  return await f();
1810
1744
  } catch (error) {
1811
- if ((0, import_provider_utils6.isAbortError)(error)) {
1745
+ if ((0, import_provider_utils5.isAbortError)(error)) {
1812
1746
  throw error;
1813
1747
  }
1814
1748
  if (maxRetries === 0) {
1815
1749
  throw error;
1816
1750
  }
1817
- const errorMessage = (0, import_provider_utils6.getErrorMessage)(error);
1751
+ const errorMessage = (0, import_provider_utils5.getErrorMessage)(error);
1818
1752
  const newErrors = [...errors, error];
1819
1753
  const tryNumber = newErrors.length;
1820
1754
  if (tryNumber > maxRetries) {
@@ -1825,7 +1759,7 @@ async function _retryWithExponentialBackoff(f, {
1825
1759
  });
1826
1760
  }
1827
1761
  if (error instanceof Error && import_provider3.APICallError.isInstance(error) && error.isRetryable === true && tryNumber <= maxRetries) {
1828
- await (0, import_provider_utils6.delay)(delayInMs);
1762
+ await (0, import_provider_utils5.delay)(delayInMs);
1829
1763
  return _retryWithExponentialBackoff(
1830
1764
  f,
1831
1765
  { maxRetries, delayInMs: backoffFactor * delayInMs, backoffFactor },
@@ -2394,7 +2328,7 @@ var NoImageGeneratedError = class extends import_provider4.AISDKError {
2394
2328
  _a3 = symbol3;
2395
2329
 
2396
2330
  // core/generate-text/generated-file.ts
2397
- var import_provider_utils7 = require("@ai-sdk/provider-utils");
2331
+ var import_provider_utils6 = require("@ai-sdk/provider-utils");
2398
2332
  var DefaultGeneratedFile = class {
2399
2333
  constructor({
2400
2334
  data,
@@ -2408,14 +2342,14 @@ var DefaultGeneratedFile = class {
2408
2342
  // lazy conversion with caching to avoid unnecessary conversion overhead:
2409
2343
  get base64() {
2410
2344
  if (this.base64Data == null) {
2411
- this.base64Data = (0, import_provider_utils7.convertUint8ArrayToBase64)(this.uint8ArrayData);
2345
+ this.base64Data = (0, import_provider_utils6.convertUint8ArrayToBase64)(this.uint8ArrayData);
2412
2346
  }
2413
2347
  return this.base64Data;
2414
2348
  }
2415
2349
  // lazy conversion with caching to avoid unnecessary conversion overhead:
2416
2350
  get uint8Array() {
2417
2351
  if (this.uint8ArrayData == null) {
2418
- this.uint8ArrayData = (0, import_provider_utils7.convertBase64ToUint8Array)(this.base64Data);
2352
+ this.uint8ArrayData = (0, import_provider_utils6.convertBase64ToUint8Array)(this.base64Data);
2419
2353
  }
2420
2354
  return this.uint8ArrayData;
2421
2355
  }
@@ -2428,7 +2362,7 @@ var DefaultGeneratedFileWithType = class extends DefaultGeneratedFile {
2428
2362
  };
2429
2363
 
2430
2364
  // core/util/detect-media-type.ts
2431
- var import_provider_utils8 = require("@ai-sdk/provider-utils");
2365
+ var import_provider_utils7 = require("@ai-sdk/provider-utils");
2432
2366
  var imageMediaTypeSignatures = [
2433
2367
  {
2434
2368
  mediaType: "image/gif",
@@ -2535,7 +2469,7 @@ var audioMediaTypeSignatures = [
2535
2469
  }
2536
2470
  ];
2537
2471
  var stripID3 = (data) => {
2538
- const bytes = typeof data === "string" ? (0, import_provider_utils8.convertBase64ToUint8Array)(data) : data;
2472
+ const bytes = typeof data === "string" ? (0, import_provider_utils7.convertBase64ToUint8Array)(data) : data;
2539
2473
  const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;
2540
2474
  return bytes.slice(id3Size + 10);
2541
2475
  };
@@ -2639,7 +2573,7 @@ var DefaultGenerateImageResult = class {
2639
2573
 
2640
2574
  // core/generate-object/generate-object.ts
2641
2575
  var import_provider13 = require("@ai-sdk/provider");
2642
- var import_provider_utils13 = require("@ai-sdk/provider-utils");
2576
+ var import_provider_utils12 = require("@ai-sdk/provider-utils");
2643
2577
 
2644
2578
  // errors/no-object-generated-error.ts
2645
2579
  var import_provider5 = require("@ai-sdk/provider");
@@ -2733,7 +2667,7 @@ async function download({ url }) {
2733
2667
 
2734
2668
  // core/prompt/data-content.ts
2735
2669
  var import_provider8 = require("@ai-sdk/provider");
2736
- var import_provider_utils9 = require("@ai-sdk/provider-utils");
2670
+ var import_provider_utils8 = require("@ai-sdk/provider-utils");
2737
2671
  var import_zod = require("zod");
2738
2672
 
2739
2673
  // core/prompt/invalid-data-content-error.ts
@@ -2820,9 +2754,9 @@ function convertDataContentToBase64String(content) {
2820
2754
  return content;
2821
2755
  }
2822
2756
  if (content instanceof ArrayBuffer) {
2823
- return (0, import_provider_utils9.convertUint8ArrayToBase64)(new Uint8Array(content));
2757
+ return (0, import_provider_utils8.convertUint8ArrayToBase64)(new Uint8Array(content));
2824
2758
  }
2825
- return (0, import_provider_utils9.convertUint8ArrayToBase64)(content);
2759
+ return (0, import_provider_utils8.convertUint8ArrayToBase64)(content);
2826
2760
  }
2827
2761
  function convertDataContentToUint8Array(content) {
2828
2762
  if (content instanceof Uint8Array) {
@@ -2830,7 +2764,7 @@ function convertDataContentToUint8Array(content) {
2830
2764
  }
2831
2765
  if (typeof content === "string") {
2832
2766
  try {
2833
- return (0, import_provider_utils9.convertBase64ToUint8Array)(content);
2767
+ return (0, import_provider_utils8.convertBase64ToUint8Array)(content);
2834
2768
  } catch (error) {
2835
2769
  throw new InvalidDataContentError({
2836
2770
  message: "Invalid data content. Content string is not a base64-encoded media.",
@@ -2874,7 +2808,7 @@ var InvalidMessageRoleError = class extends import_provider9.AISDKError {
2874
2808
  _a7 = symbol7;
2875
2809
 
2876
2810
  // core/prompt/convert-to-language-model-prompt.ts
2877
- var import_provider_utils10 = require("@ai-sdk/provider-utils");
2811
+ var import_provider_utils9 = require("@ai-sdk/provider-utils");
2878
2812
  async function convertToLanguageModelPrompt({
2879
2813
  prompt,
2880
2814
  supportedUrls,
@@ -3011,7 +2945,7 @@ async function downloadAssets(messages, downloadImplementation, supportedUrls) {
3011
2945
  }
3012
2946
  return { mediaType, data };
3013
2947
  }).filter(
3014
- (part) => part.data instanceof URL && part.mediaType != null && !(0, import_provider_utils10.isUrlSupported)({
2948
+ (part) => part.data instanceof URL && part.mediaType != null && !(0, import_provider_utils9.isUrlSupported)({
3015
2949
  url: part.data.toString(),
3016
2950
  mediaType: part.mediaType,
3017
2951
  supportedUrls
@@ -3182,7 +3116,7 @@ function prepareCallSettings({
3182
3116
 
3183
3117
  // core/prompt/standardize-prompt.ts
3184
3118
  var import_provider11 = require("@ai-sdk/provider");
3185
- var import_provider_utils11 = require("@ai-sdk/provider-utils");
3119
+ var import_provider_utils10 = require("@ai-sdk/provider-utils");
3186
3120
  var import_zod7 = require("zod");
3187
3121
 
3188
3122
  // core/prompt/attachments-to-parts.ts
@@ -3731,7 +3665,7 @@ async function standardizePrompt({
3731
3665
  message: "messages must not be empty"
3732
3666
  });
3733
3667
  }
3734
- const validationResult = await (0, import_provider_utils11.safeValidateTypes)({
3668
+ const validationResult = await (0, import_provider_utils10.safeValidateTypes)({
3735
3669
  value: messages,
3736
3670
  schema: import_zod7.z.array(coreMessageSchema)
3737
3671
  });
@@ -3771,7 +3705,7 @@ function addLanguageModelUsage(usage1, usage2) {
3771
3705
 
3772
3706
  // core/generate-object/output-strategy.ts
3773
3707
  var import_provider12 = require("@ai-sdk/provider");
3774
- var import_provider_utils12 = require("@ai-sdk/provider-utils");
3708
+ var import_provider_utils11 = require("@ai-sdk/provider-utils");
3775
3709
 
3776
3710
  // core/util/async-iterable-stream.ts
3777
3711
  function createAsyncIterableStream(source) {
@@ -3827,7 +3761,7 @@ var objectOutputStrategy = (schema) => ({
3827
3761
  };
3828
3762
  },
3829
3763
  async validateFinalResult(value) {
3830
- return (0, import_provider_utils12.safeValidateTypes)({ value, schema });
3764
+ return (0, import_provider_utils11.safeValidateTypes)({ value, schema });
3831
3765
  },
3832
3766
  createElementStream() {
3833
3767
  throw new import_provider12.UnsupportedFunctionalityError({
@@ -3871,7 +3805,7 @@ var arrayOutputStrategy = (schema) => {
3871
3805
  const resultArray = [];
3872
3806
  for (let i = 0; i < inputArray.length; i++) {
3873
3807
  const element = inputArray[i];
3874
- const result = await (0, import_provider_utils12.safeValidateTypes)({ value: element, schema });
3808
+ const result = await (0, import_provider_utils11.safeValidateTypes)({ value: element, schema });
3875
3809
  if (i === inputArray.length - 1 && !isFinalDelta) {
3876
3810
  continue;
3877
3811
  }
@@ -3912,7 +3846,7 @@ var arrayOutputStrategy = (schema) => {
3912
3846
  }
3913
3847
  const inputArray = value.elements;
3914
3848
  for (const element of inputArray) {
3915
- const result = await (0, import_provider_utils12.safeValidateTypes)({ value: element, schema });
3849
+ const result = await (0, import_provider_utils11.safeValidateTypes)({ value: element, schema });
3916
3850
  if (!result.success) {
3917
3851
  return result;
3918
3852
  }
@@ -4004,9 +3938,9 @@ function getOutputStrategy({
4004
3938
  }) {
4005
3939
  switch (output) {
4006
3940
  case "object":
4007
- return objectOutputStrategy(asSchema(schema));
3941
+ return objectOutputStrategy((0, import_provider_utils4.asSchema)(schema));
4008
3942
  case "array":
4009
- return arrayOutputStrategy(asSchema(schema));
3943
+ return arrayOutputStrategy((0, import_provider_utils4.asSchema)(schema));
4010
3944
  case "enum":
4011
3945
  return enumOutputStrategy(enumValues);
4012
3946
  case "no-schema":
@@ -4137,7 +4071,7 @@ function validateObjectGenerationInput({
4137
4071
  }
4138
4072
 
4139
4073
  // core/generate-object/generate-object.ts
4140
- var originalGenerateId = (0, import_provider_utils13.createIdGenerator)({ prefix: "aiobj", size: 24 });
4074
+ var originalGenerateId = (0, import_provider_utils12.createIdGenerator)({ prefix: "aiobj", size: 24 });
4141
4075
  async function generateObject(options) {
4142
4076
  const {
4143
4077
  model,
@@ -4220,7 +4154,7 @@ async function generateObject(options) {
4220
4154
  });
4221
4155
  const promptMessages = await convertToLanguageModelPrompt({
4222
4156
  prompt: standardizedPrompt,
4223
- supportedUrls: await model.getSupportedUrls()
4157
+ supportedUrls: await model.supportedUrls
4224
4158
  });
4225
4159
  const generateResult = await retry(
4226
4160
  () => recordSpan({
@@ -4312,7 +4246,7 @@ async function generateObject(options) {
4312
4246
  request = (_a17 = generateResult.request) != null ? _a17 : {};
4313
4247
  response = generateResult.responseData;
4314
4248
  async function processResult(result2) {
4315
- const parseResult = await (0, import_provider_utils13.safeParseJSON)({ text: result2 });
4249
+ const parseResult = await (0, import_provider_utils12.safeParseJSON)({ text: result2 });
4316
4250
  if (!parseResult.success) {
4317
4251
  throw new NoObjectGeneratedError({
4318
4252
  message: "No object generated: could not parse the response.",
@@ -4408,7 +4342,7 @@ var DefaultGenerateObjectResult = class {
4408
4342
  };
4409
4343
 
4410
4344
  // core/generate-object/stream-object.ts
4411
- var import_provider_utils14 = require("@ai-sdk/provider-utils");
4345
+ var import_provider_utils13 = require("@ai-sdk/provider-utils");
4412
4346
 
4413
4347
  // util/delayed-promise.ts
4414
4348
  var DelayedPromise = class {
@@ -4552,7 +4486,7 @@ function now() {
4552
4486
  }
4553
4487
 
4554
4488
  // core/generate-object/stream-object.ts
4555
- var originalGenerateId2 = (0, import_provider_utils14.createIdGenerator)({ prefix: "aiobj", size: 24 });
4489
+ var originalGenerateId2 = (0, import_provider_utils13.createIdGenerator)({ prefix: "aiobj", size: 24 });
4556
4490
  function streamObject(options) {
4557
4491
  const {
4558
4492
  model,
@@ -4693,7 +4627,7 @@ var DefaultStreamObjectResult = class {
4693
4627
  ...prepareCallSettings(settings),
4694
4628
  prompt: await convertToLanguageModelPrompt({
4695
4629
  prompt: standardizedPrompt,
4696
- supportedUrls: await model.getSupportedUrls()
4630
+ supportedUrls: await model.supportedUrls
4697
4631
  }),
4698
4632
  providerOptions,
4699
4633
  abortSignal,
@@ -5047,7 +4981,7 @@ var DefaultStreamObjectResult = class {
5047
4981
  };
5048
4982
 
5049
4983
  // core/generate-text/generate-text.ts
5050
- var import_provider_utils16 = require("@ai-sdk/provider-utils");
4984
+ var import_provider_utils15 = require("@ai-sdk/provider-utils");
5051
4985
 
5052
4986
  // errors/no-output-specified-error.ts
5053
4987
  var import_provider14 = require("@ai-sdk/provider");
@@ -5123,7 +5057,7 @@ function prepareToolsAndToolChoice({
5123
5057
  type: "function",
5124
5058
  name: name17,
5125
5059
  description: tool2.description,
5126
- parameters: asSchema(tool2.parameters).jsonSchema
5060
+ parameters: (0, import_provider_utils4.asSchema)(tool2.parameters).jsonSchema
5127
5061
  };
5128
5062
  case "provider-defined":
5129
5063
  return {
@@ -5156,7 +5090,7 @@ function removeTextAfterLastWhitespace(text2) {
5156
5090
  }
5157
5091
 
5158
5092
  // core/generate-text/parse-tool-call.ts
5159
- var import_provider_utils15 = require("@ai-sdk/provider-utils");
5093
+ var import_provider_utils14 = require("@ai-sdk/provider-utils");
5160
5094
 
5161
5095
  // errors/invalid-tool-arguments-error.ts
5162
5096
  var import_provider16 = require("@ai-sdk/provider");
@@ -5253,7 +5187,7 @@ async function parseToolCall({
5253
5187
  tools,
5254
5188
  parameterSchema: ({ toolName }) => {
5255
5189
  const { parameters } = tools[toolName];
5256
- return asSchema(parameters).jsonSchema;
5190
+ return (0, import_provider_utils4.asSchema)(parameters).jsonSchema;
5257
5191
  },
5258
5192
  system,
5259
5193
  messages,
@@ -5283,8 +5217,8 @@ async function doParseToolCall({
5283
5217
  availableTools: Object.keys(tools)
5284
5218
  });
5285
5219
  }
5286
- const schema = asSchema(tool2.parameters);
5287
- const parseResult = toolCall.args.trim() === "" ? await (0, import_provider_utils15.safeValidateTypes)({ value: {}, schema }) : await (0, import_provider_utils15.safeParseJSON)({ text: toolCall.args, schema });
5220
+ const schema = (0, import_provider_utils4.asSchema)(tool2.parameters);
5221
+ const parseResult = toolCall.args.trim() === "" ? await (0, import_provider_utils14.safeValidateTypes)({ value: {}, schema }) : await (0, import_provider_utils14.safeParseJSON)({ text: toolCall.args, schema });
5288
5222
  if (parseResult.success === false) {
5289
5223
  throw new InvalidToolArgumentsError({
5290
5224
  toolName,
@@ -5378,11 +5312,11 @@ function toResponseMessages({
5378
5312
  }
5379
5313
 
5380
5314
  // core/generate-text/generate-text.ts
5381
- var originalGenerateId3 = (0, import_provider_utils16.createIdGenerator)({
5315
+ var originalGenerateId3 = (0, import_provider_utils15.createIdGenerator)({
5382
5316
  prefix: "aitxt",
5383
5317
  size: 24
5384
5318
  });
5385
- var originalGenerateMessageId = (0, import_provider_utils16.createIdGenerator)({
5319
+ var originalGenerateMessageId = (0, import_provider_utils15.createIdGenerator)({
5386
5320
  prefix: "msg",
5387
5321
  size: 24
5388
5322
  });
@@ -5487,7 +5421,7 @@ async function generateText({
5487
5421
  system: initialPrompt.system,
5488
5422
  messages: stepInputMessages
5489
5423
  },
5490
- supportedUrls: await model.getSupportedUrls()
5424
+ supportedUrls: await model.supportedUrls
5491
5425
  });
5492
5426
  const stepModel = (_a17 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a17 : model;
5493
5427
  const { toolChoice: stepToolChoice, tools: stepTools } = prepareToolsAndToolChoice({
@@ -5867,7 +5801,7 @@ __export(output_exports, {
5867
5801
  object: () => object,
5868
5802
  text: () => text
5869
5803
  });
5870
- var import_provider_utils17 = require("@ai-sdk/provider-utils");
5804
+ var import_provider_utils16 = require("@ai-sdk/provider-utils");
5871
5805
 
5872
5806
  // errors/index.ts
5873
5807
  var import_provider21 = require("@ai-sdk/provider");
@@ -5928,7 +5862,7 @@ var text = () => ({
5928
5862
  var object = ({
5929
5863
  schema: inputSchema
5930
5864
  }) => {
5931
- const schema = asSchema(inputSchema);
5865
+ const schema = (0, import_provider_utils4.asSchema)(inputSchema);
5932
5866
  return {
5933
5867
  type: "object",
5934
5868
  responseFormat: {
@@ -5954,7 +5888,7 @@ var object = ({
5954
5888
  }
5955
5889
  },
5956
5890
  async parseOutput({ text: text2 }, context) {
5957
- const parseResult = await (0, import_provider_utils17.safeParseJSON)({ text: text2 });
5891
+ const parseResult = await (0, import_provider_utils16.safeParseJSON)({ text: text2 });
5958
5892
  if (!parseResult.success) {
5959
5893
  throw new NoObjectGeneratedError({
5960
5894
  message: "No object generated: could not parse the response.",
@@ -5965,7 +5899,7 @@ var object = ({
5965
5899
  finishReason: context.finishReason
5966
5900
  });
5967
5901
  }
5968
- const validationResult = await (0, import_provider_utils17.safeValidateTypes)({
5902
+ const validationResult = await (0, import_provider_utils16.safeValidateTypes)({
5969
5903
  value: parseResult.value,
5970
5904
  schema
5971
5905
  });
@@ -5985,7 +5919,7 @@ var object = ({
5985
5919
  };
5986
5920
 
5987
5921
  // core/generate-text/smooth-stream.ts
5988
- var import_provider_utils18 = require("@ai-sdk/provider-utils");
5922
+ var import_provider_utils17 = require("@ai-sdk/provider-utils");
5989
5923
  var import_provider22 = require("@ai-sdk/provider");
5990
5924
  var CHUNKING_REGEXPS = {
5991
5925
  word: /\S+\s+/m,
@@ -5994,7 +5928,7 @@ var CHUNKING_REGEXPS = {
5994
5928
  function smoothStream({
5995
5929
  delayInMs = 10,
5996
5930
  chunking = "word",
5997
- _internal: { delay: delay2 = import_provider_utils18.delay } = {}
5931
+ _internal: { delay: delay2 = import_provider_utils17.delay } = {}
5998
5932
  } = {}) {
5999
5933
  let detectChunk;
6000
5934
  if (typeof chunking === "function") {
@@ -6054,7 +5988,7 @@ function smoothStream({
6054
5988
  }
6055
5989
 
6056
5990
  // core/generate-text/stream-text.ts
6057
- var import_provider_utils19 = require("@ai-sdk/provider-utils");
5991
+ var import_provider_utils18 = require("@ai-sdk/provider-utils");
6058
5992
 
6059
5993
  // util/as-array.ts
6060
5994
  function asArray(value) {
@@ -6253,7 +6187,7 @@ function runToolsTransformation({
6253
6187
  controller.enqueue(toolCall);
6254
6188
  const tool2 = tools[toolCall.toolName];
6255
6189
  if (tool2.execute != null) {
6256
- const toolExecutionId = (0, import_provider_utils5.generateId)();
6190
+ const toolExecutionId = (0, import_provider_utils4.generateId)();
6257
6191
  outstandingToolResults.add(toolExecutionId);
6258
6192
  recordSpan({
6259
6193
  name: "ai.toolCall",
@@ -6371,11 +6305,11 @@ function runToolsTransformation({
6371
6305
  }
6372
6306
 
6373
6307
  // core/generate-text/stream-text.ts
6374
- var originalGenerateId4 = (0, import_provider_utils19.createIdGenerator)({
6308
+ var originalGenerateId4 = (0, import_provider_utils18.createIdGenerator)({
6375
6309
  prefix: "aitxt",
6376
6310
  size: 24
6377
6311
  });
6378
- var originalGenerateMessageId2 = (0, import_provider_utils19.createIdGenerator)({
6312
+ var originalGenerateMessageId2 = (0, import_provider_utils18.createIdGenerator)({
6379
6313
  prefix: "msg",
6380
6314
  size: 24
6381
6315
  });
@@ -6811,7 +6745,7 @@ var DefaultStreamTextResult = class {
6811
6745
  system: initialPrompt.system,
6812
6746
  messages: stepInputMessages
6813
6747
  },
6814
- supportedUrls: await model.getSupportedUrls()
6748
+ supportedUrls: await model.supportedUrls
6815
6749
  });
6816
6750
  const toolsAndToolChoice = {
6817
6751
  ...prepareToolsAndToolChoice({ tools, toolChoice, activeTools })
@@ -7960,8 +7894,8 @@ var doWrap = ({
7960
7894
  provider: providerId != null ? providerId : model.provider,
7961
7895
  modelId: modelId != null ? modelId : model.modelId,
7962
7896
  // TODO middleware should be able to modify the supported urls
7963
- async getSupportedUrls() {
7964
- return model.getSupportedUrls();
7897
+ get supportedUrls() {
7898
+ return model.supportedUrls;
7965
7899
  },
7966
7900
  async doGenerate(params) {
7967
7901
  const transformedParams = await doTransform({ params, type: "generate" });
@@ -8078,7 +8012,6 @@ function appendResponseMessages({
8078
8012
  );
8079
8013
  (_b = lastMessage.parts) != null ? _b : lastMessage.parts = [];
8080
8014
  lastMessage.content = textContent;
8081
- lastMessage.reasoning = reasoningTextContent;
8082
8015
  lastMessage.parts.push(...parts);
8083
8016
  lastMessage.toolInvocations = [
8084
8017
  ...(_c = lastMessage.toolInvocations) != null ? _c : [],
@@ -8097,7 +8030,6 @@ function appendResponseMessages({
8097
8030
  createdAt: currentDate(),
8098
8031
  // generate a createdAt date for the message, will be overridden by the client
8099
8032
  content: textContent,
8100
- reasoning: reasoningTextContent,
8101
8033
  toolInvocations: getToolInvocations2(0),
8102
8034
  parts: [
8103
8035
  ...parts,
@@ -8304,7 +8236,7 @@ function tool(tool2) {
8304
8236
  }
8305
8237
 
8306
8238
  // core/tool/mcp/mcp-sse-transport.ts
8307
- var import_provider_utils20 = require("@ai-sdk/provider-utils");
8239
+ var import_provider_utils19 = require("@ai-sdk/provider-utils");
8308
8240
 
8309
8241
  // core/tool/mcp/json-rpc-message.ts
8310
8242
  var import_zod9 = require("zod");
@@ -8475,7 +8407,7 @@ var SseMCPTransport = class {
8475
8407
  (_b = this.onerror) == null ? void 0 : _b.call(this, error);
8476
8408
  return reject(error);
8477
8409
  }
8478
- const stream = response.body.pipeThrough(new TextDecoderStream()).pipeThrough((0, import_provider_utils20.createEventSourceParserStream)());
8410
+ const stream = response.body.pipeThrough(new TextDecoderStream()).pipeThrough((0, import_provider_utils19.createEventSourceParserStream)());
8479
8411
  const reader = stream.getReader();
8480
8412
  const processEvents = async () => {
8481
8413
  var _a18, _b2, _c2;
@@ -8790,7 +8722,7 @@ var MCPClient = class {
8790
8722
  if (schemas !== "automatic" && !(name17 in schemas)) {
8791
8723
  continue;
8792
8724
  }
8793
- const parameters = schemas === "automatic" ? jsonSchema({
8725
+ const parameters = schemas === "automatic" ? (0, import_provider_utils4.jsonSchema)({
8794
8726
  ...inputSchema,
8795
8727
  properties: (_a17 = inputSchema.properties) != null ? _a17 : {},
8796
8728
  additionalProperties: false
@@ -8880,7 +8812,7 @@ function cosineSimilarity(vector1, vector2) {
8880
8812
  }
8881
8813
 
8882
8814
  // core/util/simulate-readable-stream.ts
8883
- var import_provider_utils21 = require("@ai-sdk/provider-utils");
8815
+ var import_provider_utils20 = require("@ai-sdk/provider-utils");
8884
8816
  function simulateReadableStream({
8885
8817
  chunks,
8886
8818
  initialDelayInMs = 0,
@@ -8888,7 +8820,7 @@ function simulateReadableStream({
8888
8820
  _internal
8889
8821
  }) {
8890
8822
  var _a17;
8891
- const delay2 = (_a17 = _internal == null ? void 0 : _internal.delay) != null ? _a17 : import_provider_utils21.delay;
8823
+ const delay2 = (_a17 = _internal == null ? void 0 : _internal.delay) != null ? _a17 : import_provider_utils20.delay;
8892
8824
  let index = 0;
8893
8825
  return new ReadableStream({
8894
8826
  async pull(controller) {
@@ -9050,7 +8982,6 @@ var StreamData = class {
9050
8982
  streamText,
9051
8983
  tool,
9052
8984
  updateToolCallResult,
9053
- wrapLanguageModel,
9054
- zodSchema
8985
+ wrapLanguageModel
9055
8986
  });
9056
8987
  //# sourceMappingURL=index.js.map