ai 5.0.260 → 5.0.262
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 +16 -0
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 5.0.262
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [d22c28b]
|
|
8
|
+
- Updated dependencies [d3e1726]
|
|
9
|
+
- Updated dependencies [450d168]
|
|
10
|
+
- Updated dependencies [82b6405]
|
|
11
|
+
- @ai-sdk/gateway@2.0.154
|
|
12
|
+
|
|
13
|
+
## 5.0.261
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 69879fe: fix(ai): prevent unhandled rejections when UI message stream reading stops early
|
|
18
|
+
|
|
3
19
|
## 5.0.260
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -816,7 +816,7 @@ function detectMediaType({
|
|
|
816
816
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
817
817
|
|
|
818
818
|
// src/version.ts
|
|
819
|
-
var VERSION = true ? "5.0.
|
|
819
|
+
var VERSION = true ? "5.0.262" : "0.0.0-test";
|
|
820
820
|
|
|
821
821
|
// src/util/download/download.ts
|
|
822
822
|
var download = async ({
|
|
@@ -10675,9 +10675,15 @@ function readUIMessageStream({
|
|
|
10675
10675
|
var _a16;
|
|
10676
10676
|
let controller;
|
|
10677
10677
|
let hasErrored = false;
|
|
10678
|
+
let isCancelled = false;
|
|
10679
|
+
const abortController = new AbortController();
|
|
10678
10680
|
const outputStream = new ReadableStream({
|
|
10679
10681
|
start(controllerParam) {
|
|
10680
10682
|
controller = controllerParam;
|
|
10683
|
+
},
|
|
10684
|
+
cancel() {
|
|
10685
|
+
isCancelled = true;
|
|
10686
|
+
abortController.abort();
|
|
10681
10687
|
}
|
|
10682
10688
|
});
|
|
10683
10689
|
const state = createStreamingUIMessageState({
|
|
@@ -10698,15 +10704,18 @@ function readUIMessageStream({
|
|
|
10698
10704
|
return job({
|
|
10699
10705
|
state,
|
|
10700
10706
|
write: () => {
|
|
10701
|
-
|
|
10707
|
+
if (!isCancelled) {
|
|
10708
|
+
controller == null ? void 0 : controller.enqueue(createUIMessageSnapshot(state.message));
|
|
10709
|
+
}
|
|
10702
10710
|
}
|
|
10703
10711
|
});
|
|
10704
10712
|
},
|
|
10705
10713
|
onError: handleError
|
|
10706
10714
|
}),
|
|
10707
|
-
onError: handleError
|
|
10715
|
+
onError: handleError,
|
|
10716
|
+
abortSignal: abortController.signal
|
|
10708
10717
|
}).finally(() => {
|
|
10709
|
-
if (!hasErrored) {
|
|
10718
|
+
if (!hasErrored && !isCancelled) {
|
|
10710
10719
|
controller == null ? void 0 : controller.close();
|
|
10711
10720
|
}
|
|
10712
10721
|
});
|