ai 6.0.207 → 6.0.208
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 +7 -0
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/03-ai-sdk-core/36-transcription.mdx +28 -25
- package/package.json +1 -1
- package/src/generate-text/stream-text.ts +3 -1
- package/src/util/fix-json.ts +30 -1
package/dist/index.mjs
CHANGED
|
@@ -1171,7 +1171,7 @@ import {
|
|
|
1171
1171
|
} from "@ai-sdk/provider-utils";
|
|
1172
1172
|
|
|
1173
1173
|
// src/version.ts
|
|
1174
|
-
var VERSION = true ? "6.0.
|
|
1174
|
+
var VERSION = true ? "6.0.208" : "0.0.0-test";
|
|
1175
1175
|
|
|
1176
1176
|
// src/util/download/download.ts
|
|
1177
1177
|
var download = async ({
|
|
@@ -3263,6 +3263,10 @@ function fixJson(input) {
|
|
|
3263
3263
|
const stack = ["ROOT"];
|
|
3264
3264
|
let lastValidIndex = -1;
|
|
3265
3265
|
let literalStart = null;
|
|
3266
|
+
let unicodeEscapeDigits = 0;
|
|
3267
|
+
function isHexDigit(char) {
|
|
3268
|
+
return char >= "0" && char <= "9" || char >= "A" && char <= "F" || char >= "a" && char <= "f";
|
|
3269
|
+
}
|
|
3266
3270
|
function processValueStart(char, i, swapState) {
|
|
3267
3271
|
{
|
|
3268
3272
|
switch (char) {
|
|
@@ -3467,7 +3471,22 @@ function fixJson(input) {
|
|
|
3467
3471
|
}
|
|
3468
3472
|
case "INSIDE_STRING_ESCAPE": {
|
|
3469
3473
|
stack.pop();
|
|
3470
|
-
|
|
3474
|
+
if (char === "u") {
|
|
3475
|
+
unicodeEscapeDigits = 0;
|
|
3476
|
+
stack.push("INSIDE_STRING_UNICODE_ESCAPE");
|
|
3477
|
+
} else {
|
|
3478
|
+
lastValidIndex = i;
|
|
3479
|
+
}
|
|
3480
|
+
break;
|
|
3481
|
+
}
|
|
3482
|
+
case "INSIDE_STRING_UNICODE_ESCAPE": {
|
|
3483
|
+
if (isHexDigit(char)) {
|
|
3484
|
+
unicodeEscapeDigits++;
|
|
3485
|
+
if (unicodeEscapeDigits === 4) {
|
|
3486
|
+
stack.pop();
|
|
3487
|
+
lastValidIndex = i;
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3471
3490
|
break;
|
|
3472
3491
|
}
|
|
3473
3492
|
case "INSIDE_NUMBER": {
|
|
@@ -8363,7 +8382,9 @@ var DefaultStreamTextResult = class {
|
|
|
8363
8382
|
controller.enqueue({
|
|
8364
8383
|
type: "tool-output-available",
|
|
8365
8384
|
toolCallId: part.toolCallId,
|
|
8366
|
-
|
|
8385
|
+
// UI stream chunks are serialized as JSON, which drops undefined
|
|
8386
|
+
// properties. Use null so tool outputs always keep the output field.
|
|
8387
|
+
output: part.output === void 0 ? null : part.output,
|
|
8367
8388
|
...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
|
|
8368
8389
|
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {},
|
|
8369
8390
|
...part.toolMetadata != null ? { toolMetadata: part.toolMetadata } : {},
|