ai 5.0.102 → 5.0.104

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,21 @@
1
1
  # ai
2
2
 
3
+ ## 5.0.104
4
+
5
+ ### Patch Changes
6
+
7
+ - d1dbe5d: move DelayedPromise into provider utils
8
+ - Updated dependencies [d1dbe5d]
9
+ - @ai-sdk/provider-utils@3.0.18
10
+ - @ai-sdk/gateway@2.0.17
11
+
12
+ ## 5.0.103
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [e609736]
17
+ - @ai-sdk/gateway@2.0.16
18
+
3
19
  ## 5.0.102
4
20
 
5
21
  ### Patch Changes
package/dist/index.js CHANGED
@@ -777,7 +777,7 @@ function detectMediaType({
777
777
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
778
778
 
779
779
  // src/version.ts
780
- var VERSION = true ? "5.0.102" : "0.0.0-test";
780
+ var VERSION = true ? "5.0.104" : "0.0.0-test";
781
781
 
782
782
  // src/util/download/download.ts
783
783
  var download = async ({ url }) => {
@@ -4235,44 +4235,6 @@ function createStitchableStream() {
4235
4235
  };
4236
4236
  }
4237
4237
 
4238
- // src/util/delayed-promise.ts
4239
- var DelayedPromise = class {
4240
- constructor() {
4241
- this.status = { type: "pending" };
4242
- this._resolve = void 0;
4243
- this._reject = void 0;
4244
- }
4245
- get promise() {
4246
- if (this._promise) {
4247
- return this._promise;
4248
- }
4249
- this._promise = new Promise((resolve2, reject) => {
4250
- if (this.status.type === "resolved") {
4251
- resolve2(this.status.value);
4252
- } else if (this.status.type === "rejected") {
4253
- reject(this.status.error);
4254
- }
4255
- this._resolve = resolve2;
4256
- this._reject = reject;
4257
- });
4258
- return this._promise;
4259
- }
4260
- resolve(value) {
4261
- var _a16;
4262
- this.status = { type: "resolved", value };
4263
- if (this._promise) {
4264
- (_a16 = this._resolve) == null ? void 0 : _a16.call(this, value);
4265
- }
4266
- }
4267
- reject(error) {
4268
- var _a16;
4269
- this.status = { type: "rejected", error };
4270
- if (this._promise) {
4271
- (_a16 = this._reject) == null ? void 0 : _a16.call(this, error);
4272
- }
4273
- }
4274
- };
4275
-
4276
4238
  // src/util/now.ts
4277
4239
  function now() {
4278
4240
  var _a16, _b;
@@ -4693,9 +4655,9 @@ var DefaultStreamTextResult = class {
4693
4655
  experimental_context,
4694
4656
  download: download2
4695
4657
  }) {
4696
- this._totalUsage = new DelayedPromise();
4697
- this._finishReason = new DelayedPromise();
4698
- this._steps = new DelayedPromise();
4658
+ this._totalUsage = new import_provider_utils15.DelayedPromise();
4659
+ this._finishReason = new import_provider_utils15.DelayedPromise();
4660
+ this._steps = new import_provider_utils15.DelayedPromise();
4699
4661
  this.output = output;
4700
4662
  this.includeRawChunks = includeRawChunks;
4701
4663
  this.tools = tools;
@@ -5005,7 +4967,7 @@ var DefaultStreamTextResult = class {
5005
4967
  }) {
5006
4968
  var _a16, _b, _c, _d, _e;
5007
4969
  const includeRawChunks2 = self.includeRawChunks;
5008
- stepFinish = new DelayedPromise();
4970
+ stepFinish = new import_provider_utils15.DelayedPromise();
5009
4971
  const initialPrompt = await standardizePrompt({
5010
4972
  system,
5011
4973
  prompt,
@@ -7507,13 +7469,13 @@ var DefaultStreamObjectResult = class {
7507
7469
  currentDate,
7508
7470
  now: now2
7509
7471
  }) {
7510
- this._object = new DelayedPromise();
7511
- this._usage = new DelayedPromise();
7512
- this._providerMetadata = new DelayedPromise();
7513
- this._warnings = new DelayedPromise();
7514
- this._request = new DelayedPromise();
7515
- this._response = new DelayedPromise();
7516
- this._finishReason = new DelayedPromise();
7472
+ this._object = new import_provider_utils23.DelayedPromise();
7473
+ this._usage = new import_provider_utils23.DelayedPromise();
7474
+ this._providerMetadata = new import_provider_utils23.DelayedPromise();
7475
+ this._warnings = new import_provider_utils23.DelayedPromise();
7476
+ this._request = new import_provider_utils23.DelayedPromise();
7477
+ this._response = new import_provider_utils23.DelayedPromise();
7478
+ this._finishReason = new import_provider_utils23.DelayedPromise();
7517
7479
  const model = resolveLanguageModel(modelArg);
7518
7480
  const { maxRetries, retry } = prepareRetries({
7519
7481
  maxRetries: maxRetriesArg,