@voltagent/core 0.1.84 → 0.1.86

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
@@ -2079,6 +2079,21 @@ type SupervisorConfig = {
2079
2079
  * @default { types: ['tool-call', 'tool-result'], addSubAgentPrefix: true }
2080
2080
  */
2081
2081
  fullStreamEventForwarding?: FullStreamEventForwardingConfig;
2082
+ /**
2083
+ * Whether to throw an exception when a subagent stream encounters an error
2084
+ * If true, stream errors will cause the handoff to throw an exception
2085
+ * If false, errors will be captured and returned in the result
2086
+ * @default false
2087
+ */
2088
+ throwOnStreamError?: boolean;
2089
+ /**
2090
+ * Whether to include error message in the result when no text content was produced
2091
+ * Only applies when throwOnStreamError is false
2092
+ * If true, the error message will be included in the result field
2093
+ * If false, the result will be empty but status will still be 'error'
2094
+ * @default true
2095
+ */
2096
+ includeErrorInEmptyResponse?: boolean;
2082
2097
  };
2083
2098
  /**
2084
2099
  * Agent configuration options
@@ -7679,6 +7694,7 @@ declare class VoltAgent {
7679
7694
  * Setup graceful shutdown handlers
7680
7695
  */
7681
7696
  private setupShutdownHandlers;
7697
+ private isSoleSignalHandler;
7682
7698
  /**
7683
7699
  * Check for dependency updates
7684
7700
  */
@@ -7747,4 +7763,4 @@ declare class VoltAgent {
7747
7763
  shutdownTelemetry(): Promise<void>;
7748
7764
  }
7749
7765
 
7750
- export { type AbortError, Agent, type AgentErrorEvent, AgentEventEmitter, type AgentHistoryEntry, type AgentHookOnEnd, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStartEvent, type AgentStartEventMetadata, type AgentSuccessEvent, type AgentSuccessEventMetadata, type AgentTimelineEvent, type AgentTool, type AllowedVariableValue, type AnyToolConfig, type BaseEventMetadata, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTimelineEvent, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, type ConversationQueryOptions, type CreateConversationInput, type CreateReasoningToolsOptions, type CustomEndpointDefinition, CustomEndpointError, type CustomEndpointHandler, DEFAULT_INSTRUCTIONS, type DataContent, type DynamicValue, type DynamicValueOptions, type ErrorStreamPart, type EventStatus, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type FilePart, type FinishStreamPart, type GenerateObjectOptions, type GenerateTextOptions, type HTTPServerConfig, type HistoryStatus, type HttpMethod, type VoltOpsClient$1 as IVoltOpsClient, type ImagePart, InMemoryStorage, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LibSQLStorage, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, type Memory, type MemoryEventMetadata, MemoryManager, type MemoryMessage, type MemoryOptions, type MemoryReadErrorEvent, type MemoryReadStartEvent, type MemoryReadSuccessEvent, type MemoryWriteErrorEvent, type MemoryWriteStartEvent, type MemoryWriteSuccessEvent, type MessageContent, MessageContentBuilder, type MessageFilterOptions, type MessageRole, type ModelToolCall, type NewTimelineEvent, NextAction, NodeType, type ObjectSubAgentConfig, type OnEndHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, 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 ReasoningStreamPart, type ReasoningToolExecuteOptions, type RetrieveOptions, type Retriever, type RetrieverErrorEvent, type RetrieverOptions, type RetrieverStartEvent, type RetrieverSuccessEvent, type SSEServerConfig, type ServerOptions, type SourceStreamPart, type StandardEventData, type StandardTimelineEvent, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StreamEventForwarderOptions, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentConfigObject, type SubAgentMethod, type TemplateVariables, type TextDeltaStreamPart, type TextPart, type TextSubAgentConfig, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolCallStreamPart, type ToolErrorEvent, type ToolErrorInfo, type ToolExecuteOptions, type ToolExecutionContext, ToolManager, type ToolOptions, type ToolResultStreamPart, type ToolSchema, type ToolStartEvent, type ToolStatus, type ToolStatusInfo, type ToolSuccessEvent, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, type VoltAgentError, VoltAgentExporter, type VoltAgentExporterOptions, type VoltAgentOptions, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type Workflow, type WorkflowConfig, type WorkflowErrorEvent, type WorkflowEvent, WorkflowEventEmitter, type WorkflowEventMetadata, type WorkflowExecutionContext, type WorkflowHistoryEntry, WorkflowRegistry, type WorkflowStartEvent, type WorkflowStepContext, type WorkflowStepErrorEvent, type WorkflowStepEventMetadata, type WorkflowStepHistoryEntry, type WorkflowStepStartEvent, type WorkflowStepSuccessEvent, type WorkflowStepSuspendEvent, type WorkflowStepType, type WorkflowSuccessEvent, type WorkflowSuspendEvent, type WorkflowTimelineEvent, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, checkForUpdates, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createStreamEventForwarder, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, registerCustomEndpoint, registerCustomEndpoints, safeJsonParse, serializeValueForDebug, streamEventForwarder, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
7766
+ export { type AbortError, Agent, type AgentErrorEvent, AgentEventEmitter, type AgentHistoryEntry, type AgentHookOnEnd, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStartEvent, type AgentStartEventMetadata, type AgentSuccessEvent, type AgentSuccessEventMetadata, type AgentTimelineEvent, type AgentTool, type AllowedVariableValue, type AnyToolConfig, type BaseEventMetadata, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTimelineEvent, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, type ConversationQueryOptions, type CreateConversationInput, type CreateReasoningToolsOptions, type CustomEndpointDefinition, CustomEndpointError, type CustomEndpointHandler, DEFAULT_INSTRUCTIONS, type DataContent, type DynamicValue, type DynamicValueOptions, type ErrorStreamPart, type EventStatus, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type FilePart, type FinishStreamPart, type GenerateObjectOptions, type GenerateTextOptions, type HTTPServerConfig, type HistoryStatus, type HttpMethod, type VoltOpsClient$1 as IVoltOpsClient, type ImagePart, InMemoryStorage, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LibSQLStorage, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, type Memory, type MemoryEventMetadata, MemoryManager, type MemoryMessage, type MemoryOptions, type MemoryReadErrorEvent, type MemoryReadStartEvent, type MemoryReadSuccessEvent, type MemoryWriteErrorEvent, type MemoryWriteStartEvent, type MemoryWriteSuccessEvent, type MessageContent, MessageContentBuilder, type MessageFilterOptions, type MessageRole, type ModelToolCall, type NewTimelineEvent, NextAction, NodeType, type ObjectSubAgentConfig, type OnEndHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, 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 ReasoningStreamPart, type ReasoningToolExecuteOptions, type RetrieveOptions, type Retriever, type RetrieverErrorEvent, type RetrieverOptions, type RetrieverStartEvent, type RetrieverSuccessEvent, type SSEServerConfig, type ServerOptions, type SourceStreamPart, type StandardEventData, type StandardTimelineEvent, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StreamEventForwarderOptions, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentConfigObject, type SubAgentMethod, type SupervisorConfig, type TemplateVariables, type TextDeltaStreamPart, type TextPart, type TextSubAgentConfig, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolCallStreamPart, type ToolErrorEvent, type ToolErrorInfo, type ToolExecuteOptions, type ToolExecutionContext, ToolManager, type ToolOptions, type ToolResultStreamPart, type ToolSchema, type ToolStartEvent, type ToolStatus, type ToolStatusInfo, type ToolSuccessEvent, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, type VoltAgentError, VoltAgentExporter, type VoltAgentExporterOptions, type VoltAgentOptions, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type Workflow, type WorkflowConfig, type WorkflowErrorEvent, type WorkflowEvent, WorkflowEventEmitter, type WorkflowEventMetadata, type WorkflowExecutionContext, type WorkflowHistoryEntry, WorkflowRegistry, type WorkflowStartEvent, type WorkflowStepContext, type WorkflowStepErrorEvent, type WorkflowStepEventMetadata, type WorkflowStepHistoryEntry, type WorkflowStepStartEvent, type WorkflowStepSuccessEvent, type WorkflowStepSuspendEvent, type WorkflowStepType, type WorkflowSuccessEvent, type WorkflowSuspendEvent, type WorkflowTimelineEvent, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, checkForUpdates, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createStreamEventForwarder, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, registerCustomEndpoint, registerCustomEndpoints, safeJsonParse, serializeValueForDebug, streamEventForwarder, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
package/dist/index.d.ts CHANGED
@@ -2079,6 +2079,21 @@ type SupervisorConfig = {
2079
2079
  * @default { types: ['tool-call', 'tool-result'], addSubAgentPrefix: true }
2080
2080
  */
2081
2081
  fullStreamEventForwarding?: FullStreamEventForwardingConfig;
2082
+ /**
2083
+ * Whether to throw an exception when a subagent stream encounters an error
2084
+ * If true, stream errors will cause the handoff to throw an exception
2085
+ * If false, errors will be captured and returned in the result
2086
+ * @default false
2087
+ */
2088
+ throwOnStreamError?: boolean;
2089
+ /**
2090
+ * Whether to include error message in the result when no text content was produced
2091
+ * Only applies when throwOnStreamError is false
2092
+ * If true, the error message will be included in the result field
2093
+ * If false, the result will be empty but status will still be 'error'
2094
+ * @default true
2095
+ */
2096
+ includeErrorInEmptyResponse?: boolean;
2082
2097
  };
2083
2098
  /**
2084
2099
  * Agent configuration options
@@ -7679,6 +7694,7 @@ declare class VoltAgent {
7679
7694
  * Setup graceful shutdown handlers
7680
7695
  */
7681
7696
  private setupShutdownHandlers;
7697
+ private isSoleSignalHandler;
7682
7698
  /**
7683
7699
  * Check for dependency updates
7684
7700
  */
@@ -7747,4 +7763,4 @@ declare class VoltAgent {
7747
7763
  shutdownTelemetry(): Promise<void>;
7748
7764
  }
7749
7765
 
7750
- export { type AbortError, Agent, type AgentErrorEvent, AgentEventEmitter, type AgentHistoryEntry, type AgentHookOnEnd, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStartEvent, type AgentStartEventMetadata, type AgentSuccessEvent, type AgentSuccessEventMetadata, type AgentTimelineEvent, type AgentTool, type AllowedVariableValue, type AnyToolConfig, type BaseEventMetadata, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTimelineEvent, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, type ConversationQueryOptions, type CreateConversationInput, type CreateReasoningToolsOptions, type CustomEndpointDefinition, CustomEndpointError, type CustomEndpointHandler, DEFAULT_INSTRUCTIONS, type DataContent, type DynamicValue, type DynamicValueOptions, type ErrorStreamPart, type EventStatus, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type FilePart, type FinishStreamPart, type GenerateObjectOptions, type GenerateTextOptions, type HTTPServerConfig, type HistoryStatus, type HttpMethod, type VoltOpsClient$1 as IVoltOpsClient, type ImagePart, InMemoryStorage, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LibSQLStorage, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, type Memory, type MemoryEventMetadata, MemoryManager, type MemoryMessage, type MemoryOptions, type MemoryReadErrorEvent, type MemoryReadStartEvent, type MemoryReadSuccessEvent, type MemoryWriteErrorEvent, type MemoryWriteStartEvent, type MemoryWriteSuccessEvent, type MessageContent, MessageContentBuilder, type MessageFilterOptions, type MessageRole, type ModelToolCall, type NewTimelineEvent, NextAction, NodeType, type ObjectSubAgentConfig, type OnEndHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, 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 ReasoningStreamPart, type ReasoningToolExecuteOptions, type RetrieveOptions, type Retriever, type RetrieverErrorEvent, type RetrieverOptions, type RetrieverStartEvent, type RetrieverSuccessEvent, type SSEServerConfig, type ServerOptions, type SourceStreamPart, type StandardEventData, type StandardTimelineEvent, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StreamEventForwarderOptions, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentConfigObject, type SubAgentMethod, type TemplateVariables, type TextDeltaStreamPart, type TextPart, type TextSubAgentConfig, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolCallStreamPart, type ToolErrorEvent, type ToolErrorInfo, type ToolExecuteOptions, type ToolExecutionContext, ToolManager, type ToolOptions, type ToolResultStreamPart, type ToolSchema, type ToolStartEvent, type ToolStatus, type ToolStatusInfo, type ToolSuccessEvent, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, type VoltAgentError, VoltAgentExporter, type VoltAgentExporterOptions, type VoltAgentOptions, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type Workflow, type WorkflowConfig, type WorkflowErrorEvent, type WorkflowEvent, WorkflowEventEmitter, type WorkflowEventMetadata, type WorkflowExecutionContext, type WorkflowHistoryEntry, WorkflowRegistry, type WorkflowStartEvent, type WorkflowStepContext, type WorkflowStepErrorEvent, type WorkflowStepEventMetadata, type WorkflowStepHistoryEntry, type WorkflowStepStartEvent, type WorkflowStepSuccessEvent, type WorkflowStepSuspendEvent, type WorkflowStepType, type WorkflowSuccessEvent, type WorkflowSuspendEvent, type WorkflowTimelineEvent, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, checkForUpdates, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createStreamEventForwarder, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, registerCustomEndpoint, registerCustomEndpoints, safeJsonParse, serializeValueForDebug, streamEventForwarder, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
7766
+ export { type AbortError, Agent, type AgentErrorEvent, AgentEventEmitter, type AgentHistoryEntry, type AgentHookOnEnd, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnStart, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentStartEvent, type AgentStartEventMetadata, type AgentSuccessEvent, type AgentSuccessEventMetadata, type AgentTimelineEvent, type AgentTool, type AllowedVariableValue, type AnyToolConfig, type BaseEventMetadata, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTimelineEvent, type BaseTool, type BaseToolCall, type CachedPrompt, type ChatMessage, type ClientInfo, type Conversation, type ConversationQueryOptions, type CreateConversationInput, type CreateReasoningToolsOptions, type CustomEndpointDefinition, CustomEndpointError, type CustomEndpointHandler, DEFAULT_INSTRUCTIONS, type DataContent, type DynamicValue, type DynamicValueOptions, type ErrorStreamPart, type EventStatus, type ExtractVariableNames, FEW_SHOT_EXAMPLES, type FilePart, type FinishStreamPart, type GenerateObjectOptions, type GenerateTextOptions, type HTTPServerConfig, type HistoryStatus, type HttpMethod, type VoltOpsClient$1 as IVoltOpsClient, type ImagePart, InMemoryStorage, type InferGenerateObjectResponse, type InferGenerateTextResponse, type InferMessage, type InferModel, type InferProviderParams, type InferStreamResponse, type InferTool, type LLMProvider, LibSQLStorage, MCPClient, type MCPClientConfig, type MCPClientEvents, MCPConfiguration, type MCPOptions, type MCPServerConfig, type MCPToolCall, type MCPToolResult, type Memory, type MemoryEventMetadata, MemoryManager, type MemoryMessage, type MemoryOptions, type MemoryReadErrorEvent, type MemoryReadStartEvent, type MemoryReadSuccessEvent, type MemoryWriteErrorEvent, type MemoryWriteStartEvent, type MemoryWriteSuccessEvent, type MessageContent, MessageContentBuilder, type MessageFilterOptions, type MessageRole, type ModelToolCall, type NewTimelineEvent, NextAction, NodeType, type ObjectSubAgentConfig, type OnEndHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnStartHookArgs, 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 ReasoningStreamPart, type ReasoningToolExecuteOptions, type RetrieveOptions, type Retriever, type RetrieverErrorEvent, type RetrieverOptions, type RetrieverStartEvent, type RetrieverSuccessEvent, type SSEServerConfig, type ServerOptions, type SourceStreamPart, type StandardEventData, type StandardTimelineEvent, type StdioServerConfig, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StreamEventForwarderOptions, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamableHTTPServerConfig, type SubAgentConfig, type SubAgentConfigObject, type SubAgentMethod, type SupervisorConfig, type TemplateVariables, type TextDeltaStreamPart, type TextPart, type TextSubAgentConfig, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolCallStreamPart, type ToolErrorEvent, type ToolErrorInfo, type ToolExecuteOptions, type ToolExecutionContext, ToolManager, type ToolOptions, type ToolResultStreamPart, type ToolSchema, type ToolStartEvent, type ToolStatus, type ToolStatusInfo, type ToolSuccessEvent, type Toolkit, type ToolsetMap, type ToolsetWithTools, type TransportError, type Usage, type UsageInfo, type Voice, type VoiceEventData, type VoiceEventType, type VoiceMetadata, type VoiceOptions, VoltAgent, type VoltAgentError, VoltAgentExporter, type VoltAgentExporterOptions, type VoltAgentOptions, VoltOpsClient, type VoltOpsClientOptions, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type Workflow, type WorkflowConfig, type WorkflowErrorEvent, type WorkflowEvent, WorkflowEventEmitter, type WorkflowEventMetadata, type WorkflowExecutionContext, type WorkflowHistoryEntry, WorkflowRegistry, type WorkflowStartEvent, type WorkflowStepContext, type WorkflowStepErrorEvent, type WorkflowStepEventMetadata, type WorkflowStepHistoryEntry, type WorkflowStepStartEvent, type WorkflowStepSuccessEvent, type WorkflowStepSuspendEvent, type WorkflowStepType, type WorkflowSuccessEvent, type WorkflowSuspendEvent, type WorkflowTimelineEvent, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, checkForUpdates, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createStreamEventForwarder, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeToArray, prependToMessage, registerCustomEndpoint, registerCustomEndpoints, safeJsonParse, serializeValueForDebug, streamEventForwarder, tool, transformTextContent, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
package/dist/index.js CHANGED
@@ -12213,6 +12213,7 @@ ${guidelinesText}
12213
12213
  const schema = this.isSubAgentConfigObject(targetAgentConfig) ? targetAgentConfig.schema : void 0;
12214
12214
  const methodOptions = this.isSubAgentConfigObject(targetAgentConfig) ? targetAgentConfig.options : void 0;
12215
12215
  const handoffConversationId = conversationId || crypto.randomUUID();
12216
+ let streamErrorToThrow = null;
12216
12217
  try {
12217
12218
  if (sourceAgent && targetAgent.hooks) {
12218
12219
  await targetAgent.hooks.onHandoff?.({ agent: targetAgent, source: sourceAgent });
@@ -12292,6 +12293,8 @@ Context: ${(0, import_utils18.safeStringify)(context, { indentation: 2 })}`;
12292
12293
  callOptions
12293
12294
  );
12294
12295
  finalResult = "";
12296
+ let streamError = null;
12297
+ let hasTextContent = false;
12295
12298
  if (streamResponse.fullStream && forwardEvent) {
12296
12299
  const eventForwardingConfig = {
12297
12300
  forwarder: forwardEvent,
@@ -12306,6 +12309,7 @@ Context: ${(0, import_utils18.safeStringify)(context, { indentation: 2 })}`;
12306
12309
  switch (part.type) {
12307
12310
  case "text-delta": {
12308
12311
  finalResult += part.textDelta;
12312
+ hasTextContent = true;
12309
12313
  const eventData = {
12310
12314
  type: "text-delta",
12311
12315
  data: {
@@ -12375,6 +12379,7 @@ Context: ${(0, import_utils18.safeStringify)(context, { indentation: 2 })}`;
12375
12379
  break;
12376
12380
  }
12377
12381
  case "error": {
12382
+ streamError = part.error;
12378
12383
  const eventData = {
12379
12384
  type: "error",
12380
12385
  data: {
@@ -12394,8 +12399,37 @@ Context: ${(0, import_utils18.safeStringify)(context, { indentation: 2 })}`;
12394
12399
  } else {
12395
12400
  for await (const part of streamResponse.textStream) {
12396
12401
  finalResult += part;
12402
+ hasTextContent = true;
12397
12403
  }
12398
12404
  }
12405
+ if (streamError && !hasTextContent) {
12406
+ const errorMessage = streamError instanceof Error ? streamError.message : String(streamError);
12407
+ if (this.supervisorConfig?.throwOnStreamError) {
12408
+ streamErrorToThrow = new Error(`Stream error in ${targetAgent.name}: ${errorMessage}`);
12409
+ throw streamErrorToThrow;
12410
+ }
12411
+ const includeErrorInResponse = this.supervisorConfig?.includeErrorInEmptyResponse ?? true;
12412
+ return {
12413
+ result: includeErrorInResponse ? `Error in ${targetAgent.name}: ${errorMessage}` : "",
12414
+ conversationId: handoffConversationId,
12415
+ messages: [
12416
+ taskMessage,
12417
+ {
12418
+ role: "system",
12419
+ content: `Stream error occurred: ${errorMessage}`
12420
+ }
12421
+ ],
12422
+ status: "error",
12423
+ error: streamError
12424
+ };
12425
+ }
12426
+ if (streamError && hasTextContent) {
12427
+ const logger2 = options.parentOperationContext?.logger || getGlobalLogger().child({ component: "subagent-manager" });
12428
+ logger2.warn(`Stream error occurred after partial content in ${targetAgent.name}`, {
12429
+ error: streamError,
12430
+ partialContent: finalResult
12431
+ });
12432
+ }
12399
12433
  finalMessages = [taskMessage, { role: "assistant", content: finalResult }];
12400
12434
  }
12401
12435
  return {
@@ -12405,6 +12439,9 @@ Context: ${(0, import_utils18.safeStringify)(context, { indentation: 2 })}`;
12405
12439
  status: "success"
12406
12440
  };
12407
12441
  } catch (error) {
12442
+ if (streamErrorToThrow && error === streamErrorToThrow) {
12443
+ throw error;
12444
+ }
12408
12445
  const logger2 = options.parentOperationContext?.logger || getGlobalLogger().child({ component: "subagent-manager" });
12409
12446
  logger2.error(`Error in handoffTask to ${targetAgent.name}`, { error });
12410
12447
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -19630,14 +19667,21 @@ https://voltagent.dev/docs/observability/developer-console/#migration-guide-from
19630
19667
  try {
19631
19668
  await this.workflowRegistry.suspendAllActiveWorkflows();
19632
19669
  this.logger.info("[VoltAgent] All workflows suspended, exiting...");
19633
- process.exit(0);
19670
+ if (this.isSoleSignalHandler(signal)) {
19671
+ process.exit(0);
19672
+ }
19634
19673
  } catch (error) {
19635
19674
  this.logger.error("[VoltAgent] Error during shutdown:", { error });
19636
- process.exit(1);
19675
+ if (this.isSoleSignalHandler(signal)) {
19676
+ process.exit(1);
19677
+ }
19637
19678
  }
19638
19679
  }, "shutdown");
19639
- process.on("SIGTERM", () => shutdown("SIGTERM"));
19640
- process.on("SIGINT", () => shutdown("SIGINT"));
19680
+ process.once("SIGTERM", () => shutdown("SIGTERM"));
19681
+ process.once("SIGINT", () => shutdown("SIGINT"));
19682
+ }
19683
+ isSoleSignalHandler(event) {
19684
+ return process.listeners(event).length === 1;
19641
19685
  }
19642
19686
  /**
19643
19687
  * Check for dependency updates