@voltagent/core 1.1.5 → 1.1.7-next.1
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/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelMessage, DataContent as DataContent$1, UserContent, AssistantContent, ToolContent, ProviderOptions as ProviderOptions$1 } from '@ai-sdk/provider-utils';
|
|
2
2
|
export { AssistantContent, FilePart, ImagePart, TextPart, ToolContent, UserContent } from '@ai-sdk/provider-utils';
|
|
3
|
-
import { TextStreamPart, generateText, UIMessage, StreamTextResult, LanguageModel, CallSettings, ToolSet, GenerateTextResult, GenerateObjectResult, AsyncIterableStream as AsyncIterableStream$1, CallWarning, LanguageModelUsage, FinishReason, EmbeddingModel } from 'ai';
|
|
3
|
+
import { TextStreamPart, generateText, UIMessage, StreamTextResult, LanguageModel, CallSettings, Output, ToolSet, GenerateTextResult, GenerateObjectResult, AsyncIterableStream as AsyncIterableStream$1, CallWarning, LanguageModelUsage, FinishReason, EmbeddingModel } from 'ai';
|
|
4
4
|
export { hasToolCall, stepCountIs } from 'ai';
|
|
5
5
|
import * as zod from 'zod';
|
|
6
6
|
import { z } from 'zod';
|
|
@@ -3277,9 +3277,9 @@ interface StreamObjectResultWithContext<T> {
|
|
|
3277
3277
|
/**
|
|
3278
3278
|
* Extended GenerateTextResult that includes context
|
|
3279
3279
|
*/
|
|
3280
|
-
|
|
3280
|
+
type GenerateTextResultWithContext<TOOLS extends ToolSet = Record<string, any>, OUTPUT = any> = GenerateTextResult<TOOLS, OUTPUT> & {
|
|
3281
3281
|
context: Map<string | symbol, unknown>;
|
|
3282
|
-
}
|
|
3282
|
+
};
|
|
3283
3283
|
/**
|
|
3284
3284
|
* Extended GenerateObjectResult that includes context
|
|
3285
3285
|
*/
|
|
@@ -3315,6 +3315,7 @@ interface BaseGenerationOptions extends Partial<CallSettings> {
|
|
|
3315
3315
|
tools?: (Tool<any, any> | Toolkit)[];
|
|
3316
3316
|
hooks?: AgentHooks;
|
|
3317
3317
|
providerOptions?: ProviderOptions$1;
|
|
3318
|
+
experimental_output?: ReturnType<typeof Output.object> | ReturnType<typeof Output.text>;
|
|
3318
3319
|
}
|
|
3319
3320
|
type GenerateTextOptions = BaseGenerationOptions;
|
|
3320
3321
|
type StreamTextOptions = BaseGenerationOptions & {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelMessage, DataContent as DataContent$1, UserContent, AssistantContent, ToolContent, ProviderOptions as ProviderOptions$1 } from '@ai-sdk/provider-utils';
|
|
2
2
|
export { AssistantContent, FilePart, ImagePart, TextPart, ToolContent, UserContent } from '@ai-sdk/provider-utils';
|
|
3
|
-
import { TextStreamPart, generateText, UIMessage, StreamTextResult, LanguageModel, CallSettings, ToolSet, GenerateTextResult, GenerateObjectResult, AsyncIterableStream as AsyncIterableStream$1, CallWarning, LanguageModelUsage, FinishReason, EmbeddingModel } from 'ai';
|
|
3
|
+
import { TextStreamPart, generateText, UIMessage, StreamTextResult, LanguageModel, CallSettings, Output, ToolSet, GenerateTextResult, GenerateObjectResult, AsyncIterableStream as AsyncIterableStream$1, CallWarning, LanguageModelUsage, FinishReason, EmbeddingModel } from 'ai';
|
|
4
4
|
export { hasToolCall, stepCountIs } from 'ai';
|
|
5
5
|
import * as zod from 'zod';
|
|
6
6
|
import { z } from 'zod';
|
|
@@ -3277,9 +3277,9 @@ interface StreamObjectResultWithContext<T> {
|
|
|
3277
3277
|
/**
|
|
3278
3278
|
* Extended GenerateTextResult that includes context
|
|
3279
3279
|
*/
|
|
3280
|
-
|
|
3280
|
+
type GenerateTextResultWithContext<TOOLS extends ToolSet = Record<string, any>, OUTPUT = any> = GenerateTextResult<TOOLS, OUTPUT> & {
|
|
3281
3281
|
context: Map<string | symbol, unknown>;
|
|
3282
|
-
}
|
|
3282
|
+
};
|
|
3283
3283
|
/**
|
|
3284
3284
|
* Extended GenerateObjectResult that includes context
|
|
3285
3285
|
*/
|
|
@@ -3315,6 +3315,7 @@ interface BaseGenerationOptions extends Partial<CallSettings> {
|
|
|
3315
3315
|
tools?: (Tool<any, any> | Toolkit)[];
|
|
3316
3316
|
hooks?: AgentHooks;
|
|
3317
3317
|
providerOptions?: ProviderOptions$1;
|
|
3318
|
+
experimental_output?: ReturnType<typeof Output.object> | ReturnType<typeof Output.text>;
|
|
3318
3319
|
}
|
|
3319
3320
|
type GenerateTextOptions = BaseGenerationOptions;
|
|
3320
3321
|
type StreamTextOptions = BaseGenerationOptions & {
|
package/dist/index.js
CHANGED
|
@@ -9112,6 +9112,7 @@ var Agent = class {
|
|
|
9112
9112
|
hooks,
|
|
9113
9113
|
maxSteps: userMaxSteps,
|
|
9114
9114
|
tools: userTools,
|
|
9115
|
+
experimental_output,
|
|
9115
9116
|
providerOptions,
|
|
9116
9117
|
...aiSDKOptions
|
|
9117
9118
|
} = options || {};
|
|
@@ -9126,6 +9127,8 @@ var Agent = class {
|
|
|
9126
9127
|
stopWhen: options?.stopWhen ?? this.stopWhen ?? (0, import_ai.stepCountIs)(maxSteps),
|
|
9127
9128
|
// User overrides from AI SDK options
|
|
9128
9129
|
...aiSDKOptions,
|
|
9130
|
+
// Experimental output if provided
|
|
9131
|
+
experimental_output,
|
|
9129
9132
|
// Provider-specific options
|
|
9130
9133
|
providerOptions,
|
|
9131
9134
|
// VoltAgent controlled (these should not be overridden)
|
|
@@ -9239,6 +9242,7 @@ var Agent = class {
|
|
|
9239
9242
|
maxSteps: userMaxSteps,
|
|
9240
9243
|
tools: userTools,
|
|
9241
9244
|
onFinish: userOnFinish,
|
|
9245
|
+
experimental_output,
|
|
9242
9246
|
providerOptions,
|
|
9243
9247
|
...aiSDKOptions
|
|
9244
9248
|
} = options || {};
|
|
@@ -9253,6 +9257,8 @@ var Agent = class {
|
|
|
9253
9257
|
stopWhen: options?.stopWhen ?? this.stopWhen ?? (0, import_ai.stepCountIs)(maxSteps),
|
|
9254
9258
|
// User overrides from AI SDK options
|
|
9255
9259
|
...aiSDKOptions,
|
|
9260
|
+
// Experimental output if provided
|
|
9261
|
+
experimental_output,
|
|
9256
9262
|
// Provider-specific options
|
|
9257
9263
|
providerOptions,
|
|
9258
9264
|
// VoltAgent controlled (these should not be overridden)
|
|
@@ -12258,7 +12264,9 @@ var import_stdio = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
|
12258
12264
|
var import_streamableHttp = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
12259
12265
|
var import_protocol = require("@modelcontextprotocol/sdk/shared/protocol.js");
|
|
12260
12266
|
var import_types6 = require("@modelcontextprotocol/sdk/types.js");
|
|
12267
|
+
var import_zod7 = require("zod");
|
|
12261
12268
|
var import_zod_from_json_schema = require("zod-from-json-schema");
|
|
12269
|
+
var import_zod_from_json_schema_v3 = require("zod-from-json-schema-v3");
|
|
12262
12270
|
var MCPClient = class extends import_node_events5.EventEmitter {
|
|
12263
12271
|
static {
|
|
12264
12272
|
__name(this, "MCPClient");
|
|
@@ -12497,7 +12505,7 @@ var MCPClient = class extends import_node_events5.EventEmitter {
|
|
|
12497
12505
|
const executableTools = {};
|
|
12498
12506
|
for (const toolDef of Object.values(definitions)) {
|
|
12499
12507
|
try {
|
|
12500
|
-
const zodSchema = (
|
|
12508
|
+
const zodSchema = ("toJSONSchema" in import_zod7.z ? import_zod_from_json_schema.convertJsonSchemaToZod : import_zod_from_json_schema_v3.convertJsonSchemaToZod)(
|
|
12501
12509
|
toolDef.inputSchema
|
|
12502
12510
|
);
|
|
12503
12511
|
const namespacedToolName = `${this.clientInfo.name}_${toolDef.name}`;
|