ai 5.0.54 → 5.0.56
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 +12 -0
- package/dist/index.d.mts +12 -31
- package/dist/index.d.ts +12 -31
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -679,7 +679,7 @@ import {
|
|
|
679
679
|
} from "@ai-sdk/provider-utils";
|
|
680
680
|
|
|
681
681
|
// src/version.ts
|
|
682
|
-
var VERSION = true ? "5.0.
|
|
682
|
+
var VERSION = true ? "5.0.56" : "0.0.0-test";
|
|
683
683
|
|
|
684
684
|
// src/util/download/download.ts
|
|
685
685
|
var download = async ({ url }) => {
|
|
@@ -4593,7 +4593,7 @@ var DefaultStreamTextResult = class {
|
|
|
4593
4593
|
let activeReasoningContent = {};
|
|
4594
4594
|
const eventProcessor = new TransformStream({
|
|
4595
4595
|
async transform(chunk, controller) {
|
|
4596
|
-
var _a17, _b, _c;
|
|
4596
|
+
var _a17, _b, _c, _d;
|
|
4597
4597
|
controller.enqueue(chunk);
|
|
4598
4598
|
const { part } = chunk;
|
|
4599
4599
|
if (part.type === "text-delta" || part.type === "reasoning-delta" || part.type === "source" || part.type === "tool-call" || part.type === "tool-result" || part.type === "tool-input-start" || part.type === "tool-input-delta" || part.type === "raw") {
|
|
@@ -4626,6 +4626,18 @@ var DefaultStreamTextResult = class {
|
|
|
4626
4626
|
activeText.providerMetadata = (_a17 = part.providerMetadata) != null ? _a17 : activeText.providerMetadata;
|
|
4627
4627
|
}
|
|
4628
4628
|
if (part.type === "text-end") {
|
|
4629
|
+
const activeText = activeTextContent[part.id];
|
|
4630
|
+
if (activeText == null) {
|
|
4631
|
+
controller.enqueue({
|
|
4632
|
+
part: {
|
|
4633
|
+
type: "error",
|
|
4634
|
+
error: `text part ${part.id} not found`
|
|
4635
|
+
},
|
|
4636
|
+
partialOutput: void 0
|
|
4637
|
+
});
|
|
4638
|
+
return;
|
|
4639
|
+
}
|
|
4640
|
+
activeText.providerMetadata = (_b = part.providerMetadata) != null ? _b : activeText.providerMetadata;
|
|
4629
4641
|
delete activeTextContent[part.id];
|
|
4630
4642
|
}
|
|
4631
4643
|
if (part.type === "reasoning-start") {
|
|
@@ -4649,7 +4661,7 @@ var DefaultStreamTextResult = class {
|
|
|
4649
4661
|
return;
|
|
4650
4662
|
}
|
|
4651
4663
|
activeReasoning.text += part.text;
|
|
4652
|
-
activeReasoning.providerMetadata = (
|
|
4664
|
+
activeReasoning.providerMetadata = (_c = part.providerMetadata) != null ? _c : activeReasoning.providerMetadata;
|
|
4653
4665
|
}
|
|
4654
4666
|
if (part.type === "reasoning-end") {
|
|
4655
4667
|
const activeReasoning = activeReasoningContent[part.id];
|
|
@@ -4663,7 +4675,7 @@ var DefaultStreamTextResult = class {
|
|
|
4663
4675
|
});
|
|
4664
4676
|
return;
|
|
4665
4677
|
}
|
|
4666
|
-
activeReasoning.providerMetadata = (
|
|
4678
|
+
activeReasoning.providerMetadata = (_d = part.providerMetadata) != null ? _d : activeReasoning.providerMetadata;
|
|
4667
4679
|
delete activeReasoningContent[part.id];
|
|
4668
4680
|
}
|
|
4669
4681
|
if (part.type === "file") {
|