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/dist/index.mjs
CHANGED
|
@@ -193,10 +193,14 @@ var MCPClientError = class extends AISDKError5 {
|
|
|
193
193
|
constructor({
|
|
194
194
|
name: name17 = "MCPClientError",
|
|
195
195
|
message,
|
|
196
|
-
cause
|
|
196
|
+
cause,
|
|
197
|
+
data,
|
|
198
|
+
code
|
|
197
199
|
}) {
|
|
198
200
|
super({ name: name17, message, cause });
|
|
199
201
|
this[_a5] = true;
|
|
202
|
+
this.data = data;
|
|
203
|
+
this.code = code;
|
|
200
204
|
}
|
|
201
205
|
static isInstance(error) {
|
|
202
206
|
return AISDKError5.hasMarker(error, marker5);
|
|
@@ -691,7 +695,7 @@ import {
|
|
|
691
695
|
} from "@ai-sdk/provider-utils";
|
|
692
696
|
|
|
693
697
|
// src/version.ts
|
|
694
|
-
var VERSION = true ? "5.0.
|
|
698
|
+
var VERSION = true ? "5.0.64" : "0.0.0-test";
|
|
695
699
|
|
|
696
700
|
// src/util/download/download.ts
|
|
697
701
|
var download = async ({ url }) => {
|
|
@@ -2229,17 +2233,17 @@ async function generateText({
|
|
|
2229
2233
|
stepNumber: steps.length,
|
|
2230
2234
|
messages: stepInputMessages
|
|
2231
2235
|
}));
|
|
2236
|
+
const stepModel = resolveLanguageModel(
|
|
2237
|
+
(_a17 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a17 : model
|
|
2238
|
+
);
|
|
2232
2239
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
2233
2240
|
prompt: {
|
|
2234
|
-
system: (
|
|
2235
|
-
messages: (
|
|
2241
|
+
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
2242
|
+
messages: (_c = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _c : stepInputMessages
|
|
2236
2243
|
},
|
|
2237
|
-
supportedUrls: await
|
|
2244
|
+
supportedUrls: await stepModel.supportedUrls,
|
|
2238
2245
|
download: download2
|
|
2239
2246
|
});
|
|
2240
|
-
const stepModel = resolveLanguageModel(
|
|
2241
|
-
(_c = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _c : model
|
|
2242
|
-
);
|
|
2243
2247
|
const { toolChoice: stepToolChoice, tools: stepTools } = prepareToolsAndToolChoice({
|
|
2244
2248
|
tools,
|
|
2245
2249
|
toolChoice: (_d = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _d : toolChoice,
|
|
@@ -2458,16 +2462,20 @@ async function generateText({
|
|
|
2458
2462
|
})
|
|
2459
2463
|
);
|
|
2460
2464
|
const lastStep = steps[steps.length - 1];
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
resolvedOutput
|
|
2465
|
+
let resolvedOutput;
|
|
2466
|
+
if (lastStep.finishReason === "stop") {
|
|
2467
|
+
resolvedOutput = await (output == null ? void 0 : output.parseOutput(
|
|
2464
2468
|
{ text: lastStep.text },
|
|
2465
2469
|
{
|
|
2466
2470
|
response: lastStep.response,
|
|
2467
2471
|
usage: lastStep.usage,
|
|
2468
2472
|
finishReason: lastStep.finishReason
|
|
2469
2473
|
}
|
|
2470
|
-
))
|
|
2474
|
+
));
|
|
2475
|
+
}
|
|
2476
|
+
return new DefaultGenerateTextResult({
|
|
2477
|
+
steps,
|
|
2478
|
+
resolvedOutput
|
|
2471
2479
|
});
|
|
2472
2480
|
}
|
|
2473
2481
|
});
|
|
@@ -4919,17 +4927,17 @@ var DefaultStreamTextResult = class {
|
|
|
4919
4927
|
stepNumber: recordedSteps.length,
|
|
4920
4928
|
messages: stepInputMessages
|
|
4921
4929
|
}));
|
|
4930
|
+
const stepModel = resolveLanguageModel(
|
|
4931
|
+
(_a17 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a17 : model
|
|
4932
|
+
);
|
|
4922
4933
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
4923
4934
|
prompt: {
|
|
4924
|
-
system: (
|
|
4925
|
-
messages: (
|
|
4935
|
+
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
4936
|
+
messages: (_c = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _c : stepInputMessages
|
|
4926
4937
|
},
|
|
4927
|
-
supportedUrls: await
|
|
4938
|
+
supportedUrls: await stepModel.supportedUrls,
|
|
4928
4939
|
download: download2
|
|
4929
4940
|
});
|
|
4930
|
-
const stepModel = resolveLanguageModel(
|
|
4931
|
-
(_c = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _c : model
|
|
4932
|
-
);
|
|
4933
4941
|
const { toolChoice: stepToolChoice, tools: stepTools } = prepareToolsAndToolChoice({
|
|
4934
4942
|
tools,
|
|
4935
4943
|
toolChoice: (_d = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _d : toolChoice,
|
|
@@ -9191,6 +9199,8 @@ var DefaultMCPClient = class {
|
|
|
9191
9199
|
handler(
|
|
9192
9200
|
"result" in response ? response : new MCPClientError({
|
|
9193
9201
|
message: response.error.message,
|
|
9202
|
+
code: response.error.code,
|
|
9203
|
+
data: response.error.data,
|
|
9194
9204
|
cause: response.error
|
|
9195
9205
|
})
|
|
9196
9206
|
);
|