@voltagent/core 1.1.4 → 1.1.6

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 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';
@@ -1821,6 +1821,56 @@ declare class VoltOpsClient implements VoltOpsClient$1 {
1821
1821
  */
1822
1822
  declare const createVoltOpsClient: (options: VoltOpsClientOptions) => VoltOpsClient;
1823
1823
 
1824
+ type VoltAgentErrorOptions = {
1825
+ originalError?: unknown;
1826
+ code?: string;
1827
+ metadata?: Record<string, unknown>;
1828
+ stage?: string;
1829
+ toolError?: ToolErrorInfo;
1830
+ };
1831
+ /**
1832
+ * Type guard to check if an error is a VoltAgentError
1833
+ */
1834
+ declare function isVoltAgentError(error: unknown): error is VoltAgentError;
1835
+ declare class VoltAgentError extends Error {
1836
+ name: "VoltAgentError";
1837
+ /**
1838
+ * The original error object thrown by the provider or underlying system (if available).
1839
+ */
1840
+ originalError?: unknown;
1841
+ /**
1842
+ * Optional error code or identifier from the provider.
1843
+ */
1844
+ code?: string | number;
1845
+ /**
1846
+ * Additional metadata related to the error (e.g., retry info, request ID).
1847
+ */
1848
+ metadata?: Record<string, any>;
1849
+ /**
1850
+ * Information about the step or stage where the error occurred (optional, e.g., 'llm_request', 'tool_execution', 'response_parsing').
1851
+ */
1852
+ stage?: string;
1853
+ /**
1854
+ * If the error occurred during tool execution, this field contains the relevant details. Otherwise, it's undefined.
1855
+ */
1856
+ toolError?: ToolErrorInfo;
1857
+ constructor(message: string, options?: VoltAgentErrorOptions);
1858
+ }
1859
+
1860
+ /**
1861
+ * Type guard to check if an error is an AbortError
1862
+ */
1863
+ declare function isAbortError(error: unknown): error is AbortError;
1864
+ /**
1865
+ * Error thrown when an operation is aborted via AbortController
1866
+ */
1867
+ declare class AbortError extends Error {
1868
+ name: "AbortError";
1869
+ /** The reason passed to abort() method */
1870
+ reason?: unknown;
1871
+ constructor(reason?: string);
1872
+ }
1873
+
1824
1874
  /**
1825
1875
  * Available methods for subagent execution
1826
1876
  */
@@ -2931,41 +2981,6 @@ interface ToolErrorInfo {
2931
2981
  /** The arguments passed to the tool when the error occurred (for debugging). */
2932
2982
  toolArguments?: unknown;
2933
2983
  }
2934
- /**
2935
- * Standardized error structure for Voltagent agent operations.
2936
- * Providers should wrap their specific errors in this structure before
2937
- * passing them to onError callbacks.
2938
- */
2939
- interface VoltAgentError {
2940
- /** A clear, human-readable error message. This could be a general message or derived from toolError info. */
2941
- message: string;
2942
- /** The original error object thrown by the provider or underlying system (if available). */
2943
- originalError?: unknown;
2944
- /** Optional error code or identifier from the provider. */
2945
- code?: string | number;
2946
- /** Additional metadata related to the error (e.g., retry info, request ID). */
2947
- metadata?: Record<string, any>;
2948
- /** Information about the step or stage where the error occurred (optional, e.g., 'llm_request', 'tool_execution', 'response_parsing'). */
2949
- stage?: string;
2950
- /** If the error occurred during tool execution, this field contains the relevant details. Otherwise, it's undefined. */
2951
- toolError?: ToolErrorInfo;
2952
- }
2953
- /**
2954
- * Error thrown when an operation is aborted via AbortController
2955
- */
2956
- interface AbortError extends Error {
2957
- name: "AbortError";
2958
- /** The reason passed to abort() method */
2959
- reason?: unknown;
2960
- }
2961
- /**
2962
- * Type guard to check if an error is an AbortError
2963
- */
2964
- declare function isAbortError(error: unknown): error is AbortError;
2965
- /**
2966
- * Type guard to check if an error is a VoltAgentError
2967
- */
2968
- declare function isVoltAgentError(error: unknown): error is VoltAgentError;
2969
2984
  /**
2970
2985
  * Type for onError callbacks in streaming operations.
2971
2986
  * Providers must pass an error conforming to the VoltAgentError structure.
@@ -3262,9 +3277,9 @@ interface StreamObjectResultWithContext<T> {
3262
3277
  /**
3263
3278
  * Extended GenerateTextResult that includes context
3264
3279
  */
3265
- interface GenerateTextResultWithContext<TOOLS extends ToolSet = Record<string, any>, OUTPUT = any> extends GenerateTextResult<TOOLS, OUTPUT> {
3280
+ type GenerateTextResultWithContext<TOOLS extends ToolSet = Record<string, any>, OUTPUT = any> = GenerateTextResult<TOOLS, OUTPUT> & {
3266
3281
  context: Map<string | symbol, unknown>;
3267
- }
3282
+ };
3268
3283
  /**
3269
3284
  * Extended GenerateObjectResult that includes context
3270
3285
  */
@@ -3300,6 +3315,7 @@ interface BaseGenerationOptions extends Partial<CallSettings> {
3300
3315
  tools?: (Tool<any, any> | Toolkit)[];
3301
3316
  hooks?: AgentHooks;
3302
3317
  providerOptions?: ProviderOptions$1;
3318
+ experimental_output?: ReturnType<typeof Output.object> | ReturnType<typeof Output.text>;
3303
3319
  }
3304
3320
  type GenerateTextOptions = BaseGenerationOptions;
3305
3321
  type StreamTextOptions = BaseGenerationOptions & {
@@ -6965,4 +6981,4 @@ declare class VoltAgent {
6965
6981
  */
6966
6982
  declare function convertUsage(usage: LanguageModelUsage | undefined): UsageInfo | undefined;
6967
6983
 
6968
- export { type AbortError, Agent, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type AnyToolConfig, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateReasoningToolsOptions, DEFAULT_INSTRUCTIONS, type DataContent, type Document, type DynamicValue, type DynamicValueOptions, type EmbeddingAdapter$1 as EmbeddingAdapter, EmbeddingAdapterNotConfiguredError, EmbeddingError, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type GenerateObjectOptions, type GenerateObjectSubAgentConfig, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type HTTPServerConfig, type IServerProvider, type VoltOpsClient$1 as IVoltOpsClient, InMemoryStorageAdapter$1 as InMemoryObservabilityAdapter, InMemoryStorageAdapter, InMemoryVectorAdapter, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, Memory, type MemoryConfig, type MemoryOptions, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type PackageUpdateInfo, type PromptApiClient, type PromptApiResponse, type PromptContent, type PromptCreator, type PromptHelper, type PromptReference, type PromptTemplate, type ProviderObjectResponse, type ProviderObjectStreamResponse, type ProviderParams, type ProviderResponse, type ProviderTextResponse, type ProviderTextStreamResponse, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisteredWorkflow, type RetrieveOptions, type Retriever, type RetrieverOptions, type SSEServerConfig, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type SpanAttributes, type SpanEvent, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type VectorAdapter, VectorAdapterNotConfiguredError, VectorError, type VectorItem, type VectorSearchOptions, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, type VoltAgentError, VoltAgentObservability, type VoltAgentOptions, type VoltAgentStreamTextResult, type VoltAgentTextStreamPart, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, readableSpanToObservabilitySpan, safeJsonParse, serializeValueForDebug, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
6984
+ export { AbortError, Agent, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type AnyToolConfig, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateReasoningToolsOptions, DEFAULT_INSTRUCTIONS, type DataContent, type Document, type DynamicValue, type DynamicValueOptions, type EmbeddingAdapter$1 as EmbeddingAdapter, EmbeddingAdapterNotConfiguredError, EmbeddingError, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type GenerateObjectOptions, type GenerateObjectSubAgentConfig, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type HTTPServerConfig, type IServerProvider, type VoltOpsClient$1 as IVoltOpsClient, InMemoryStorageAdapter$1 as InMemoryObservabilityAdapter, InMemoryStorageAdapter, InMemoryVectorAdapter, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, Memory, type MemoryConfig, type MemoryOptions, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type PackageUpdateInfo, type PromptApiClient, type PromptApiResponse, type PromptContent, type PromptCreator, type PromptHelper, type PromptReference, type PromptTemplate, type ProviderObjectResponse, type ProviderObjectStreamResponse, type ProviderParams, type ProviderResponse, type ProviderTextResponse, type ProviderTextStreamResponse, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisteredWorkflow, type RetrieveOptions, type Retriever, type RetrieverOptions, type SSEServerConfig, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type SpanAttributes, type SpanEvent, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type VectorAdapter, VectorAdapterNotConfiguredError, VectorError, type VectorItem, type VectorSearchOptions, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, VoltAgentError, VoltAgentObservability, type VoltAgentOptions, type VoltAgentStreamTextResult, type VoltAgentTextStreamPart, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, readableSpanToObservabilitySpan, safeJsonParse, serializeValueForDebug, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
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';
@@ -1821,6 +1821,56 @@ declare class VoltOpsClient implements VoltOpsClient$1 {
1821
1821
  */
1822
1822
  declare const createVoltOpsClient: (options: VoltOpsClientOptions) => VoltOpsClient;
1823
1823
 
1824
+ type VoltAgentErrorOptions = {
1825
+ originalError?: unknown;
1826
+ code?: string;
1827
+ metadata?: Record<string, unknown>;
1828
+ stage?: string;
1829
+ toolError?: ToolErrorInfo;
1830
+ };
1831
+ /**
1832
+ * Type guard to check if an error is a VoltAgentError
1833
+ */
1834
+ declare function isVoltAgentError(error: unknown): error is VoltAgentError;
1835
+ declare class VoltAgentError extends Error {
1836
+ name: "VoltAgentError";
1837
+ /**
1838
+ * The original error object thrown by the provider or underlying system (if available).
1839
+ */
1840
+ originalError?: unknown;
1841
+ /**
1842
+ * Optional error code or identifier from the provider.
1843
+ */
1844
+ code?: string | number;
1845
+ /**
1846
+ * Additional metadata related to the error (e.g., retry info, request ID).
1847
+ */
1848
+ metadata?: Record<string, any>;
1849
+ /**
1850
+ * Information about the step or stage where the error occurred (optional, e.g., 'llm_request', 'tool_execution', 'response_parsing').
1851
+ */
1852
+ stage?: string;
1853
+ /**
1854
+ * If the error occurred during tool execution, this field contains the relevant details. Otherwise, it's undefined.
1855
+ */
1856
+ toolError?: ToolErrorInfo;
1857
+ constructor(message: string, options?: VoltAgentErrorOptions);
1858
+ }
1859
+
1860
+ /**
1861
+ * Type guard to check if an error is an AbortError
1862
+ */
1863
+ declare function isAbortError(error: unknown): error is AbortError;
1864
+ /**
1865
+ * Error thrown when an operation is aborted via AbortController
1866
+ */
1867
+ declare class AbortError extends Error {
1868
+ name: "AbortError";
1869
+ /** The reason passed to abort() method */
1870
+ reason?: unknown;
1871
+ constructor(reason?: string);
1872
+ }
1873
+
1824
1874
  /**
1825
1875
  * Available methods for subagent execution
1826
1876
  */
@@ -2931,41 +2981,6 @@ interface ToolErrorInfo {
2931
2981
  /** The arguments passed to the tool when the error occurred (for debugging). */
2932
2982
  toolArguments?: unknown;
2933
2983
  }
2934
- /**
2935
- * Standardized error structure for Voltagent agent operations.
2936
- * Providers should wrap their specific errors in this structure before
2937
- * passing them to onError callbacks.
2938
- */
2939
- interface VoltAgentError {
2940
- /** A clear, human-readable error message. This could be a general message or derived from toolError info. */
2941
- message: string;
2942
- /** The original error object thrown by the provider or underlying system (if available). */
2943
- originalError?: unknown;
2944
- /** Optional error code or identifier from the provider. */
2945
- code?: string | number;
2946
- /** Additional metadata related to the error (e.g., retry info, request ID). */
2947
- metadata?: Record<string, any>;
2948
- /** Information about the step or stage where the error occurred (optional, e.g., 'llm_request', 'tool_execution', 'response_parsing'). */
2949
- stage?: string;
2950
- /** If the error occurred during tool execution, this field contains the relevant details. Otherwise, it's undefined. */
2951
- toolError?: ToolErrorInfo;
2952
- }
2953
- /**
2954
- * Error thrown when an operation is aborted via AbortController
2955
- */
2956
- interface AbortError extends Error {
2957
- name: "AbortError";
2958
- /** The reason passed to abort() method */
2959
- reason?: unknown;
2960
- }
2961
- /**
2962
- * Type guard to check if an error is an AbortError
2963
- */
2964
- declare function isAbortError(error: unknown): error is AbortError;
2965
- /**
2966
- * Type guard to check if an error is a VoltAgentError
2967
- */
2968
- declare function isVoltAgentError(error: unknown): error is VoltAgentError;
2969
2984
  /**
2970
2985
  * Type for onError callbacks in streaming operations.
2971
2986
  * Providers must pass an error conforming to the VoltAgentError structure.
@@ -3262,9 +3277,9 @@ interface StreamObjectResultWithContext<T> {
3262
3277
  /**
3263
3278
  * Extended GenerateTextResult that includes context
3264
3279
  */
3265
- interface GenerateTextResultWithContext<TOOLS extends ToolSet = Record<string, any>, OUTPUT = any> extends GenerateTextResult<TOOLS, OUTPUT> {
3280
+ type GenerateTextResultWithContext<TOOLS extends ToolSet = Record<string, any>, OUTPUT = any> = GenerateTextResult<TOOLS, OUTPUT> & {
3266
3281
  context: Map<string | symbol, unknown>;
3267
- }
3282
+ };
3268
3283
  /**
3269
3284
  * Extended GenerateObjectResult that includes context
3270
3285
  */
@@ -3300,6 +3315,7 @@ interface BaseGenerationOptions extends Partial<CallSettings> {
3300
3315
  tools?: (Tool<any, any> | Toolkit)[];
3301
3316
  hooks?: AgentHooks;
3302
3317
  providerOptions?: ProviderOptions$1;
3318
+ experimental_output?: ReturnType<typeof Output.object> | ReturnType<typeof Output.text>;
3303
3319
  }
3304
3320
  type GenerateTextOptions = BaseGenerationOptions;
3305
3321
  type StreamTextOptions = BaseGenerationOptions & {
@@ -6965,4 +6981,4 @@ declare class VoltAgent {
6965
6981
  */
6966
6982
  declare function convertUsage(usage: LanguageModelUsage | undefined): UsageInfo | undefined;
6967
6983
 
6968
- export { type AbortError, Agent, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type AnyToolConfig, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateReasoningToolsOptions, DEFAULT_INSTRUCTIONS, type DataContent, type Document, type DynamicValue, type DynamicValueOptions, type EmbeddingAdapter$1 as EmbeddingAdapter, EmbeddingAdapterNotConfiguredError, EmbeddingError, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type GenerateObjectOptions, type GenerateObjectSubAgentConfig, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type HTTPServerConfig, type IServerProvider, type VoltOpsClient$1 as IVoltOpsClient, InMemoryStorageAdapter$1 as InMemoryObservabilityAdapter, InMemoryStorageAdapter, InMemoryVectorAdapter, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, Memory, type MemoryConfig, type MemoryOptions, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type PackageUpdateInfo, type PromptApiClient, type PromptApiResponse, type PromptContent, type PromptCreator, type PromptHelper, type PromptReference, type PromptTemplate, type ProviderObjectResponse, type ProviderObjectStreamResponse, type ProviderParams, type ProviderResponse, type ProviderTextResponse, type ProviderTextStreamResponse, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisteredWorkflow, type RetrieveOptions, type Retriever, type RetrieverOptions, type SSEServerConfig, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type SpanAttributes, type SpanEvent, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type VectorAdapter, VectorAdapterNotConfiguredError, VectorError, type VectorItem, type VectorSearchOptions, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, type VoltAgentError, VoltAgentObservability, type VoltAgentOptions, type VoltAgentStreamTextResult, type VoltAgentTextStreamPart, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, readableSpanToObservabilitySpan, safeJsonParse, serializeValueForDebug, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
6984
+ export { AbortError, Agent, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type AnyToolConfig, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateReasoningToolsOptions, DEFAULT_INSTRUCTIONS, type DataContent, type Document, type DynamicValue, type DynamicValueOptions, type EmbeddingAdapter$1 as EmbeddingAdapter, EmbeddingAdapterNotConfiguredError, EmbeddingError, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type GenerateObjectOptions, type GenerateObjectSubAgentConfig, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type HTTPServerConfig, type IServerProvider, type VoltOpsClient$1 as IVoltOpsClient, InMemoryStorageAdapter$1 as InMemoryObservabilityAdapter, InMemoryStorageAdapter, InMemoryVectorAdapter, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, Memory, type MemoryConfig, type MemoryOptions, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type PackageUpdateInfo, type PromptApiClient, type PromptApiResponse, type PromptContent, type PromptCreator, type PromptHelper, type PromptReference, type PromptTemplate, type ProviderObjectResponse, type ProviderObjectStreamResponse, type ProviderParams, type ProviderResponse, type ProviderTextResponse, type ProviderTextStreamResponse, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisteredWorkflow, type RetrieveOptions, type Retriever, type RetrieverOptions, type SSEServerConfig, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type SpanAttributes, type SpanEvent, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type VectorAdapter, VectorAdapterNotConfiguredError, VectorError, type VectorItem, type VectorSearchOptions, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, VoltAgentError, VoltAgentObservability, type VoltAgentOptions, type VoltAgentStreamTextResult, type VoltAgentTextStreamPart, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, readableSpanToObservabilitySpan, safeJsonParse, serializeValueForDebug, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };