ai 5.0.62 → 5.0.64
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 +13 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +28 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -18
- 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,18 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 5.0.64
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e33947b: fix(ai): mcp errors to be jsonrpc 2.0 compliant
|
|
8
|
+
|
|
9
|
+
## 5.0.63
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 22609f8: fix(ai): only parse experimental_output in generateText when finishReason is stop
|
|
14
|
+
- b552c94: fix(core): Fix image download behavior when the initial model is swapped out during prepareStep
|
|
15
|
+
|
|
3
16
|
## 5.0.62
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2580,10 +2580,14 @@ declare const symbol$b: unique symbol;
|
|
|
2580
2580
|
*/
|
|
2581
2581
|
declare class MCPClientError extends AISDKError {
|
|
2582
2582
|
private readonly [symbol$b];
|
|
2583
|
-
|
|
2583
|
+
readonly data?: unknown;
|
|
2584
|
+
readonly code?: number;
|
|
2585
|
+
constructor({ name, message, cause, data, code, }: {
|
|
2584
2586
|
name?: string;
|
|
2585
2587
|
message: string;
|
|
2586
2588
|
cause?: unknown;
|
|
2589
|
+
data?: unknown;
|
|
2590
|
+
code?: number;
|
|
2587
2591
|
});
|
|
2588
2592
|
static isInstance(error: unknown): error is MCPClientError;
|
|
2589
2593
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2580,10 +2580,14 @@ declare const symbol$b: unique symbol;
|
|
|
2580
2580
|
*/
|
|
2581
2581
|
declare class MCPClientError extends AISDKError {
|
|
2582
2582
|
private readonly [symbol$b];
|
|
2583
|
-
|
|
2583
|
+
readonly data?: unknown;
|
|
2584
|
+
readonly code?: number;
|
|
2585
|
+
constructor({ name, message, cause, data, code, }: {
|
|
2584
2586
|
name?: string;
|
|
2585
2587
|
message: string;
|
|
2586
2588
|
cause?: unknown;
|
|
2589
|
+
data?: unknown;
|
|
2590
|
+
code?: number;
|
|
2587
2591
|
});
|
|
2588
2592
|
static isInstance(error: unknown): error is MCPClientError;
|
|
2589
2593
|
}
|
package/dist/index.js
CHANGED
|
@@ -298,10 +298,14 @@ var MCPClientError = class extends import_provider5.AISDKError {
|
|
|
298
298
|
constructor({
|
|
299
299
|
name: name17 = "MCPClientError",
|
|
300
300
|
message,
|
|
301
|
-
cause
|
|
301
|
+
cause,
|
|
302
|
+
data,
|
|
303
|
+
code
|
|
302
304
|
}) {
|
|
303
305
|
super({ name: name17, message, cause });
|
|
304
306
|
this[_a5] = true;
|
|
307
|
+
this.data = data;
|
|
308
|
+
this.code = code;
|
|
305
309
|
}
|
|
306
310
|
static isInstance(error) {
|
|
307
311
|
return import_provider5.AISDKError.hasMarker(error, marker5);
|
|
@@ -791,7 +795,7 @@ function detectMediaType({
|
|
|
791
795
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
792
796
|
|
|
793
797
|
// src/version.ts
|
|
794
|
-
var VERSION = true ? "5.0.
|
|
798
|
+
var VERSION = true ? "5.0.64" : "0.0.0-test";
|
|
795
799
|
|
|
796
800
|
// src/util/download/download.ts
|
|
797
801
|
var download = async ({ url }) => {
|
|
@@ -2314,17 +2318,17 @@ async function generateText({
|
|
|
2314
2318
|
stepNumber: steps.length,
|
|
2315
2319
|
messages: stepInputMessages
|
|
2316
2320
|
}));
|
|
2321
|
+
const stepModel = resolveLanguageModel(
|
|
2322
|
+
(_a17 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a17 : model
|
|
2323
|
+
);
|
|
2317
2324
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
2318
2325
|
prompt: {
|
|
2319
|
-
system: (
|
|
2320
|
-
messages: (
|
|
2326
|
+
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
2327
|
+
messages: (_c = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _c : stepInputMessages
|
|
2321
2328
|
},
|
|
2322
|
-
supportedUrls: await
|
|
2329
|
+
supportedUrls: await stepModel.supportedUrls,
|
|
2323
2330
|
download: download2
|
|
2324
2331
|
});
|
|
2325
|
-
const stepModel = resolveLanguageModel(
|
|
2326
|
-
(_c = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _c : model
|
|
2327
|
-
);
|
|
2328
2332
|
const { toolChoice: stepToolChoice, tools: stepTools } = prepareToolsAndToolChoice({
|
|
2329
2333
|
tools,
|
|
2330
2334
|
toolChoice: (_d = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _d : toolChoice,
|
|
@@ -2543,16 +2547,20 @@ async function generateText({
|
|
|
2543
2547
|
})
|
|
2544
2548
|
);
|
|
2545
2549
|
const lastStep = steps[steps.length - 1];
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
resolvedOutput
|
|
2550
|
+
let resolvedOutput;
|
|
2551
|
+
if (lastStep.finishReason === "stop") {
|
|
2552
|
+
resolvedOutput = await (output == null ? void 0 : output.parseOutput(
|
|
2549
2553
|
{ text: lastStep.text },
|
|
2550
2554
|
{
|
|
2551
2555
|
response: lastStep.response,
|
|
2552
2556
|
usage: lastStep.usage,
|
|
2553
2557
|
finishReason: lastStep.finishReason
|
|
2554
2558
|
}
|
|
2555
|
-
))
|
|
2559
|
+
));
|
|
2560
|
+
}
|
|
2561
|
+
return new DefaultGenerateTextResult({
|
|
2562
|
+
steps,
|
|
2563
|
+
resolvedOutput
|
|
2556
2564
|
});
|
|
2557
2565
|
}
|
|
2558
2566
|
});
|
|
@@ -4993,17 +5001,17 @@ var DefaultStreamTextResult = class {
|
|
|
4993
5001
|
stepNumber: recordedSteps.length,
|
|
4994
5002
|
messages: stepInputMessages
|
|
4995
5003
|
}));
|
|
5004
|
+
const stepModel = resolveLanguageModel(
|
|
5005
|
+
(_a17 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a17 : model
|
|
5006
|
+
);
|
|
4996
5007
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
4997
5008
|
prompt: {
|
|
4998
|
-
system: (
|
|
4999
|
-
messages: (
|
|
5009
|
+
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
5010
|
+
messages: (_c = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _c : stepInputMessages
|
|
5000
5011
|
},
|
|
5001
|
-
supportedUrls: await
|
|
5012
|
+
supportedUrls: await stepModel.supportedUrls,
|
|
5002
5013
|
download: download2
|
|
5003
5014
|
});
|
|
5004
|
-
const stepModel = resolveLanguageModel(
|
|
5005
|
-
(_c = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _c : model
|
|
5006
|
-
);
|
|
5007
5015
|
const { toolChoice: stepToolChoice, tools: stepTools } = prepareToolsAndToolChoice({
|
|
5008
5016
|
tools,
|
|
5009
5017
|
toolChoice: (_d = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _d : toolChoice,
|
|
@@ -9236,6 +9244,8 @@ var DefaultMCPClient = class {
|
|
|
9236
9244
|
handler(
|
|
9237
9245
|
"result" in response ? response : new MCPClientError({
|
|
9238
9246
|
message: response.error.message,
|
|
9247
|
+
code: response.error.code,
|
|
9248
|
+
data: response.error.data,
|
|
9239
9249
|
cause: response.error
|
|
9240
9250
|
})
|
|
9241
9251
|
);
|