ai 5.0.221 → 5.0.222

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.mjs CHANGED
@@ -72,6 +72,16 @@ function formatWarning(warning) {
72
72
  }
73
73
  var FIRST_WARNING_INFO_MESSAGE = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.";
74
74
  var hasLoggedBefore = false;
75
+ function emitWarning({
76
+ message,
77
+ type
78
+ }) {
79
+ if (typeof process !== "undefined" && typeof process.emitWarning === "function") {
80
+ process.emitWarning(message, { type });
81
+ } else {
82
+ console.warn(message);
83
+ }
84
+ }
75
85
  var logWarnings = (warnings) => {
76
86
  if (warnings.length === 0) {
77
87
  return;
@@ -86,10 +96,16 @@ var logWarnings = (warnings) => {
86
96
  }
87
97
  if (!hasLoggedBefore) {
88
98
  hasLoggedBefore = true;
89
- console.info(FIRST_WARNING_INFO_MESSAGE);
99
+ emitWarning({
100
+ message: FIRST_WARNING_INFO_MESSAGE,
101
+ type: "Warning"
102
+ });
90
103
  }
91
104
  for (const warning of warnings) {
92
- console.warn(formatWarning(warning));
105
+ emitWarning({
106
+ message: formatWarning(warning),
107
+ type: "Warning"
108
+ });
93
109
  }
94
110
  };
95
111
 
@@ -711,7 +727,7 @@ import {
711
727
  } from "@ai-sdk/provider-utils";
712
728
 
713
729
  // src/version.ts
714
- var VERSION = true ? "5.0.221" : "0.0.0-test";
730
+ var VERSION = true ? "5.0.222" : "0.0.0-test";
715
731
 
716
732
  // src/util/download/download.ts
717
733
  var download = async ({