ai 6.0.0-beta.121 → 6.0.0-beta.122

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
  # ai
2
2
 
3
+ ## 6.0.0-beta.122
4
+
5
+ ### Patch Changes
6
+
7
+ - 03849b0: move DelayedPromise into provider utils
8
+ - Updated dependencies [03849b0]
9
+ - @ai-sdk/provider-utils@4.0.0-beta.38
10
+ - @ai-sdk/gateway@2.0.0-beta.66
11
+
3
12
  ## 6.0.0-beta.121
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -876,7 +876,7 @@ function detectMediaType({
876
876
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
877
877
 
878
878
  // src/version.ts
879
- var VERSION = true ? "6.0.0-beta.121" : "0.0.0-test";
879
+ var VERSION = true ? "6.0.0-beta.122" : "0.0.0-test";
880
880
 
881
881
  // src/util/download/download.ts
882
882
  var download = async ({ url }) => {
@@ -5012,44 +5012,6 @@ function createStitchableStream() {
5012
5012
  };
5013
5013
  }
5014
5014
 
5015
- // src/util/delayed-promise.ts
5016
- var DelayedPromise = class {
5017
- constructor() {
5018
- this.status = { type: "pending" };
5019
- this._resolve = void 0;
5020
- this._reject = void 0;
5021
- }
5022
- get promise() {
5023
- if (this._promise) {
5024
- return this._promise;
5025
- }
5026
- this._promise = new Promise((resolve3, reject) => {
5027
- if (this.status.type === "resolved") {
5028
- resolve3(this.status.value);
5029
- } else if (this.status.type === "rejected") {
5030
- reject(this.status.error);
5031
- }
5032
- this._resolve = resolve3;
5033
- this._reject = reject;
5034
- });
5035
- return this._promise;
5036
- }
5037
- resolve(value) {
5038
- var _a15;
5039
- this.status = { type: "resolved", value };
5040
- if (this._promise) {
5041
- (_a15 = this._resolve) == null ? void 0 : _a15.call(this, value);
5042
- }
5043
- }
5044
- reject(error) {
5045
- var _a15;
5046
- this.status = { type: "rejected", error };
5047
- if (this._promise) {
5048
- (_a15 = this._reject) == null ? void 0 : _a15.call(this, error);
5049
- }
5050
- }
5051
- };
5052
-
5053
5015
  // src/util/now.ts
5054
5016
  function now() {
5055
5017
  var _a15, _b;
@@ -5433,9 +5395,9 @@ var DefaultStreamTextResult = class {
5433
5395
  experimental_context,
5434
5396
  download: download2
5435
5397
  }) {
5436
- this._totalUsage = new DelayedPromise();
5437
- this._finishReason = new DelayedPromise();
5438
- this._steps = new DelayedPromise();
5398
+ this._totalUsage = new import_provider_utils17.DelayedPromise();
5399
+ this._finishReason = new import_provider_utils17.DelayedPromise();
5400
+ this._steps = new import_provider_utils17.DelayedPromise();
5439
5401
  this.outputSpecification = output;
5440
5402
  this.includeRawChunks = includeRawChunks;
5441
5403
  this.tools = tools;
@@ -5828,7 +5790,7 @@ var DefaultStreamTextResult = class {
5828
5790
  }) {
5829
5791
  var _a15, _b, _c, _d, _e;
5830
5792
  const includeRawChunks2 = self.includeRawChunks;
5831
- stepFinish = new DelayedPromise();
5793
+ stepFinish = new import_provider_utils17.DelayedPromise();
5832
5794
  const stepInputMessages = [...initialMessages, ...responseMessages];
5833
5795
  const prepareStepResult = await (prepareStep == null ? void 0 : prepareStep({
5834
5796
  model,
@@ -8998,13 +8960,13 @@ var DefaultStreamObjectResult = class {
8998
8960
  currentDate,
8999
8961
  now: now2
9000
8962
  }) {
9001
- this._object = new DelayedPromise();
9002
- this._usage = new DelayedPromise();
9003
- this._providerMetadata = new DelayedPromise();
9004
- this._warnings = new DelayedPromise();
9005
- this._request = new DelayedPromise();
9006
- this._response = new DelayedPromise();
9007
- this._finishReason = new DelayedPromise();
8963
+ this._object = new import_provider_utils28.DelayedPromise();
8964
+ this._usage = new import_provider_utils28.DelayedPromise();
8965
+ this._providerMetadata = new import_provider_utils28.DelayedPromise();
8966
+ this._warnings = new import_provider_utils28.DelayedPromise();
8967
+ this._request = new import_provider_utils28.DelayedPromise();
8968
+ this._response = new import_provider_utils28.DelayedPromise();
8969
+ this._finishReason = new import_provider_utils28.DelayedPromise();
9008
8970
  const model = resolveLanguageModel(modelArg);
9009
8971
  const { maxRetries, retry } = prepareRetries({
9010
8972
  maxRetries: maxRetriesArg,