ai 6.0.0-beta.32 → 6.0.0-beta.34
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 +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/dist/mcp-stdio/index.js +5 -1
- package/dist/mcp-stdio/index.js.map +1 -1
- package/dist/mcp-stdio/index.mjs +5 -1
- package/dist/mcp-stdio/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.0-beta.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bb10a89: fix(ai): mcp errors to be jsonrpc 2.0 compliant
|
|
8
|
+
|
|
9
|
+
## 6.0.0-beta.33
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f733285: fix(ai): only parse experimental_output in generateText when finishReason is stop
|
|
14
|
+
|
|
3
15
|
## 6.0.0-beta.32
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2728,10 +2728,14 @@ declare const symbol$b: unique symbol;
|
|
|
2728
2728
|
*/
|
|
2729
2729
|
declare class MCPClientError extends AISDKError {
|
|
2730
2730
|
private readonly [symbol$b];
|
|
2731
|
-
|
|
2731
|
+
readonly data?: unknown;
|
|
2732
|
+
readonly code?: number;
|
|
2733
|
+
constructor({ name, message, cause, data, code, }: {
|
|
2732
2734
|
name?: string;
|
|
2733
2735
|
message: string;
|
|
2734
2736
|
cause?: unknown;
|
|
2737
|
+
data?: unknown;
|
|
2738
|
+
code?: number;
|
|
2735
2739
|
});
|
|
2736
2740
|
static isInstance(error: unknown): error is MCPClientError;
|
|
2737
2741
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2728,10 +2728,14 @@ declare const symbol$b: unique symbol;
|
|
|
2728
2728
|
*/
|
|
2729
2729
|
declare class MCPClientError extends AISDKError {
|
|
2730
2730
|
private readonly [symbol$b];
|
|
2731
|
-
|
|
2731
|
+
readonly data?: unknown;
|
|
2732
|
+
readonly code?: number;
|
|
2733
|
+
constructor({ name, message, cause, data, code, }: {
|
|
2732
2734
|
name?: string;
|
|
2733
2735
|
message: string;
|
|
2734
2736
|
cause?: unknown;
|
|
2737
|
+
data?: unknown;
|
|
2738
|
+
code?: number;
|
|
2735
2739
|
});
|
|
2736
2740
|
static isInstance(error: unknown): error is MCPClientError;
|
|
2737
2741
|
}
|
package/dist/index.js
CHANGED
|
@@ -300,10 +300,14 @@ var MCPClientError = class extends import_provider5.AISDKError {
|
|
|
300
300
|
constructor({
|
|
301
301
|
name: name17 = "MCPClientError",
|
|
302
302
|
message,
|
|
303
|
-
cause
|
|
303
|
+
cause,
|
|
304
|
+
data,
|
|
305
|
+
code
|
|
304
306
|
}) {
|
|
305
307
|
super({ name: name17, message, cause });
|
|
306
308
|
this[_a5] = true;
|
|
309
|
+
this.data = data;
|
|
310
|
+
this.code = code;
|
|
307
311
|
}
|
|
308
312
|
static isInstance(error) {
|
|
309
313
|
return import_provider5.AISDKError.hasMarker(error, marker5);
|
|
@@ -819,7 +823,7 @@ function detectMediaType({
|
|
|
819
823
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
820
824
|
|
|
821
825
|
// src/version.ts
|
|
822
|
-
var VERSION = true ? "6.0.0-beta.
|
|
826
|
+
var VERSION = true ? "6.0.0-beta.34" : "0.0.0-test";
|
|
823
827
|
|
|
824
828
|
// src/util/download/download.ts
|
|
825
829
|
var download = async ({ url }) => {
|
|
@@ -2870,17 +2874,21 @@ async function generateText({
|
|
|
2870
2874
|
steps,
|
|
2871
2875
|
totalUsage
|
|
2872
2876
|
}));
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
resolvedOutput: await (output == null ? void 0 : output.parseOutput(
|
|
2877
|
+
let resolvedOutput;
|
|
2878
|
+
if (lastStep.finishReason === "stop") {
|
|
2879
|
+
resolvedOutput = await (output == null ? void 0 : output.parseOutput(
|
|
2877
2880
|
{ text: lastStep.text },
|
|
2878
2881
|
{
|
|
2879
2882
|
response: lastStep.response,
|
|
2880
2883
|
usage: lastStep.usage,
|
|
2881
2884
|
finishReason: lastStep.finishReason
|
|
2882
2885
|
}
|
|
2883
|
-
))
|
|
2886
|
+
));
|
|
2887
|
+
}
|
|
2888
|
+
return new DefaultGenerateTextResult({
|
|
2889
|
+
steps,
|
|
2890
|
+
totalUsage,
|
|
2891
|
+
resolvedOutput
|
|
2884
2892
|
});
|
|
2885
2893
|
}
|
|
2886
2894
|
});
|
|
@@ -9610,6 +9618,8 @@ var DefaultMCPClient = class {
|
|
|
9610
9618
|
handler(
|
|
9611
9619
|
"result" in response ? response : new MCPClientError({
|
|
9612
9620
|
message: response.error.message,
|
|
9621
|
+
code: response.error.code,
|
|
9622
|
+
data: response.error.data,
|
|
9613
9623
|
cause: response.error
|
|
9614
9624
|
})
|
|
9615
9625
|
);
|