@voltagent/core 0.1.76 → 0.1.78

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
@@ -1829,11 +1829,34 @@ interface OnToolEndHookArgs {
1829
1829
  error: VoltAgentError | AbortError | undefined;
1830
1830
  context: OperationContext;
1831
1831
  }
1832
+ interface OnPrepareMessagesHookArgs {
1833
+ /**
1834
+ * The messages that will be sent to the LLM.
1835
+ * Modify and return this array to transform the messages.
1836
+ */
1837
+ messages: BaseMessage[];
1838
+ /**
1839
+ * The agent instance making the LLM call.
1840
+ */
1841
+ agent: Agent<any>;
1842
+ /**
1843
+ * The operation context containing metadata about the current operation.
1844
+ */
1845
+ context: OperationContext;
1846
+ }
1847
+ interface OnPrepareMessagesHookResult {
1848
+ /**
1849
+ * The transformed messages to send to the LLM.
1850
+ * If not provided, the original messages will be used.
1851
+ */
1852
+ messages?: BaseMessage[];
1853
+ }
1832
1854
  type AgentHookOnStart = (args: OnStartHookArgs) => Promise<void> | void;
1833
1855
  type AgentHookOnEnd = (args: OnEndHookArgs) => Promise<void> | void;
1834
1856
  type AgentHookOnHandoff = (args: OnHandoffHookArgs) => Promise<void> | void;
1835
1857
  type AgentHookOnToolStart = (args: OnToolStartHookArgs) => Promise<void> | void;
1836
1858
  type AgentHookOnToolEnd = (args: OnToolEndHookArgs) => Promise<void> | void;
1859
+ type AgentHookOnPrepareMessages = (args: OnPrepareMessagesHookArgs) => Promise<OnPrepareMessagesHookResult> | OnPrepareMessagesHookResult;
1837
1860
  /**
1838
1861
  * Type definition for agent hooks using single argument objects.
1839
1862
  */
@@ -1843,6 +1866,7 @@ type AgentHooks = {
1843
1866
  onHandoff?: AgentHookOnHandoff;
1844
1867
  onToolStart?: AgentHookOnToolStart;
1845
1868
  onToolEnd?: AgentHookOnToolEnd;
1869
+ onPrepareMessages?: AgentHookOnPrepareMessages;
1846
1870
  };
1847
1871
  /**
1848
1872
  * Create hooks from an object literal.
@@ -6709,6 +6733,149 @@ declare const updateSinglePackage: (packageName: string, packagePath?: string) =
6709
6733
  declare function safeJsonParse(value: string | null | undefined): any;
6710
6734
  declare function serializeValueForDebug(value: unknown): unknown;
6711
6735
 
6736
+ /**
6737
+ * Type guard to check if content is a string
6738
+ */
6739
+ declare function isTextContent(content: MessageContent): content is string;
6740
+ /**
6741
+ * Type guard to check if content is structured (array of content parts)
6742
+ */
6743
+ declare function isStructuredContent(content: MessageContent): content is Array<any>;
6744
+ /**
6745
+ * Check if content has any text parts
6746
+ */
6747
+ declare function hasTextPart(content: MessageContent): boolean;
6748
+ /**
6749
+ * Check if content has any image parts
6750
+ */
6751
+ declare function hasImagePart(content: MessageContent): boolean;
6752
+ /**
6753
+ * Check if content has any file parts
6754
+ */
6755
+ declare function hasFilePart(content: MessageContent): boolean;
6756
+ /**
6757
+ * Extract text from message content
6758
+ */
6759
+ declare function extractText(content: MessageContent): string;
6760
+ /**
6761
+ * Extract all text parts from structured content
6762
+ */
6763
+ declare function extractTextParts(content: MessageContent): Array<{
6764
+ type: "text";
6765
+ text: string;
6766
+ }>;
6767
+ /**
6768
+ * Extract image parts from message content
6769
+ */
6770
+ declare function extractImageParts(content: MessageContent): Array<any>;
6771
+ /**
6772
+ * Extract file parts from message content
6773
+ */
6774
+ declare function extractFileParts(content: MessageContent): Array<any>;
6775
+ /**
6776
+ * Transform text content in a message
6777
+ */
6778
+ declare function transformTextContent(content: MessageContent, transformer: (text: string) => string): MessageContent;
6779
+ /**
6780
+ * Map message content with a transformer function
6781
+ */
6782
+ declare function mapMessageContent<T extends BaseMessage>(message: T, transformer: (text: string) => string): T;
6783
+ /**
6784
+ * Filter content parts by type
6785
+ */
6786
+ declare function filterContentParts(content: MessageContent, predicate: (part: any) => boolean): MessageContent;
6787
+ /**
6788
+ * Normalize content to always be an array
6789
+ */
6790
+ declare function normalizeToArray(content: MessageContent): Array<any>;
6791
+ /**
6792
+ * Normalize content to the most compact form
6793
+ */
6794
+ declare function normalizeContent(content: MessageContent): MessageContent;
6795
+ /**
6796
+ * Builder class for creating message content
6797
+ */
6798
+ declare class MessageContentBuilder {
6799
+ private parts;
6800
+ /**
6801
+ * Add a text part
6802
+ */
6803
+ addText(text: string): this;
6804
+ /**
6805
+ * Add an image part
6806
+ */
6807
+ addImage(image: string | Uint8Array): this;
6808
+ /**
6809
+ * Add a file part
6810
+ */
6811
+ addFile(file: string | Uint8Array, mimeType?: string): this;
6812
+ /**
6813
+ * Add a custom part
6814
+ */
6815
+ addPart(part: any): this;
6816
+ /**
6817
+ * Build the final content
6818
+ */
6819
+ build(): MessageContent;
6820
+ /**
6821
+ * Build as array (always returns array)
6822
+ */
6823
+ buildAsArray(): Array<any>;
6824
+ /**
6825
+ * Clear all parts
6826
+ */
6827
+ clear(): this;
6828
+ /**
6829
+ * Get current parts count
6830
+ */
6831
+ get length(): number;
6832
+ }
6833
+ /**
6834
+ * Convenience function to add timestamp to user messages
6835
+ */
6836
+ declare function addTimestampToMessage(message: BaseMessage, timestamp?: string): BaseMessage;
6837
+ /**
6838
+ * Convenience function to prepend text to message content
6839
+ */
6840
+ declare function prependToMessage(message: BaseMessage, prefix: string): BaseMessage;
6841
+ /**
6842
+ * Convenience function to append text to message content
6843
+ */
6844
+ declare function appendToMessage(message: BaseMessage, suffix: string): BaseMessage;
6845
+ /**
6846
+ * Check if message has any content
6847
+ */
6848
+ declare function hasContent(message: BaseMessage): boolean;
6849
+ /**
6850
+ * Get content length (text characters or array items)
6851
+ */
6852
+ declare function getContentLength(content: MessageContent): number;
6853
+ /**
6854
+ * Combined message helpers object for easy importing
6855
+ */
6856
+ declare const messageHelpers: {
6857
+ isTextContent: typeof isTextContent;
6858
+ isStructuredContent: typeof isStructuredContent;
6859
+ hasTextPart: typeof hasTextPart;
6860
+ hasImagePart: typeof hasImagePart;
6861
+ hasFilePart: typeof hasFilePart;
6862
+ extractText: typeof extractText;
6863
+ extractTextParts: typeof extractTextParts;
6864
+ extractImageParts: typeof extractImageParts;
6865
+ extractFileParts: typeof extractFileParts;
6866
+ transformTextContent: typeof transformTextContent;
6867
+ mapMessageContent: typeof mapMessageContent;
6868
+ filterContentParts: typeof filterContentParts;
6869
+ normalizeToArray: typeof normalizeToArray;
6870
+ normalizeContent: typeof normalizeContent;
6871
+ addTimestampToMessage: typeof addTimestampToMessage;
6872
+ prependToMessage: typeof prependToMessage;
6873
+ appendToMessage: typeof appendToMessage;
6874
+ hasContent: typeof hasContent;
6875
+ getContentLength: typeof getContentLength;
6876
+ MessageContentBuilder: typeof MessageContentBuilder;
6877
+ };
6878
+
6712
6879
  /**
6713
6880
  * Creates an AgentTool from a retriever, allowing it to be used as a tool in an agent.
6714
6881
  * This is the preferred way to use a retriever as a tool, as it properly maintains the 'this' context.
@@ -7387,4 +7554,4 @@ declare class VoltAgent {
7387
7554
  shutdownTelemetry(): Promise<void>;
7388
7555
  }
7389
7556
 
7390
- export { type AbortError, Agent, type AgentErrorEvent, AgentEventEmitter, type AgentHistoryEntry, type AgentHookOnEnd, type AgentHookOnHandoff, 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, type MessageFilterOptions, type MessageRole, type ModelToolCall, type NewTimelineEvent, NextAction, NodeType, type ObjectSubAgentConfig, type OnEndHookArgs, type OnHandoffHookArgs, 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, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, buildRetrieverLogMessage, checkForUpdates, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createStreamEventForwarder, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractWorkflowStepInfo, getNodeTypeFromNodeId, getWorkflowStepNodeType, isAbortError, isVoltAgentError, registerCustomEndpoint, registerCustomEndpoints, safeJsonParse, serializeValueForDebug, streamEventForwarder, tool, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
7557
+ 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 };
package/dist/index.d.ts CHANGED
@@ -1829,11 +1829,34 @@ interface OnToolEndHookArgs {
1829
1829
  error: VoltAgentError | AbortError | undefined;
1830
1830
  context: OperationContext;
1831
1831
  }
1832
+ interface OnPrepareMessagesHookArgs {
1833
+ /**
1834
+ * The messages that will be sent to the LLM.
1835
+ * Modify and return this array to transform the messages.
1836
+ */
1837
+ messages: BaseMessage[];
1838
+ /**
1839
+ * The agent instance making the LLM call.
1840
+ */
1841
+ agent: Agent<any>;
1842
+ /**
1843
+ * The operation context containing metadata about the current operation.
1844
+ */
1845
+ context: OperationContext;
1846
+ }
1847
+ interface OnPrepareMessagesHookResult {
1848
+ /**
1849
+ * The transformed messages to send to the LLM.
1850
+ * If not provided, the original messages will be used.
1851
+ */
1852
+ messages?: BaseMessage[];
1853
+ }
1832
1854
  type AgentHookOnStart = (args: OnStartHookArgs) => Promise<void> | void;
1833
1855
  type AgentHookOnEnd = (args: OnEndHookArgs) => Promise<void> | void;
1834
1856
  type AgentHookOnHandoff = (args: OnHandoffHookArgs) => Promise<void> | void;
1835
1857
  type AgentHookOnToolStart = (args: OnToolStartHookArgs) => Promise<void> | void;
1836
1858
  type AgentHookOnToolEnd = (args: OnToolEndHookArgs) => Promise<void> | void;
1859
+ type AgentHookOnPrepareMessages = (args: OnPrepareMessagesHookArgs) => Promise<OnPrepareMessagesHookResult> | OnPrepareMessagesHookResult;
1837
1860
  /**
1838
1861
  * Type definition for agent hooks using single argument objects.
1839
1862
  */
@@ -1843,6 +1866,7 @@ type AgentHooks = {
1843
1866
  onHandoff?: AgentHookOnHandoff;
1844
1867
  onToolStart?: AgentHookOnToolStart;
1845
1868
  onToolEnd?: AgentHookOnToolEnd;
1869
+ onPrepareMessages?: AgentHookOnPrepareMessages;
1846
1870
  };
1847
1871
  /**
1848
1872
  * Create hooks from an object literal.
@@ -6709,6 +6733,149 @@ declare const updateSinglePackage: (packageName: string, packagePath?: string) =
6709
6733
  declare function safeJsonParse(value: string | null | undefined): any;
6710
6734
  declare function serializeValueForDebug(value: unknown): unknown;
6711
6735
 
6736
+ /**
6737
+ * Type guard to check if content is a string
6738
+ */
6739
+ declare function isTextContent(content: MessageContent): content is string;
6740
+ /**
6741
+ * Type guard to check if content is structured (array of content parts)
6742
+ */
6743
+ declare function isStructuredContent(content: MessageContent): content is Array<any>;
6744
+ /**
6745
+ * Check if content has any text parts
6746
+ */
6747
+ declare function hasTextPart(content: MessageContent): boolean;
6748
+ /**
6749
+ * Check if content has any image parts
6750
+ */
6751
+ declare function hasImagePart(content: MessageContent): boolean;
6752
+ /**
6753
+ * Check if content has any file parts
6754
+ */
6755
+ declare function hasFilePart(content: MessageContent): boolean;
6756
+ /**
6757
+ * Extract text from message content
6758
+ */
6759
+ declare function extractText(content: MessageContent): string;
6760
+ /**
6761
+ * Extract all text parts from structured content
6762
+ */
6763
+ declare function extractTextParts(content: MessageContent): Array<{
6764
+ type: "text";
6765
+ text: string;
6766
+ }>;
6767
+ /**
6768
+ * Extract image parts from message content
6769
+ */
6770
+ declare function extractImageParts(content: MessageContent): Array<any>;
6771
+ /**
6772
+ * Extract file parts from message content
6773
+ */
6774
+ declare function extractFileParts(content: MessageContent): Array<any>;
6775
+ /**
6776
+ * Transform text content in a message
6777
+ */
6778
+ declare function transformTextContent(content: MessageContent, transformer: (text: string) => string): MessageContent;
6779
+ /**
6780
+ * Map message content with a transformer function
6781
+ */
6782
+ declare function mapMessageContent<T extends BaseMessage>(message: T, transformer: (text: string) => string): T;
6783
+ /**
6784
+ * Filter content parts by type
6785
+ */
6786
+ declare function filterContentParts(content: MessageContent, predicate: (part: any) => boolean): MessageContent;
6787
+ /**
6788
+ * Normalize content to always be an array
6789
+ */
6790
+ declare function normalizeToArray(content: MessageContent): Array<any>;
6791
+ /**
6792
+ * Normalize content to the most compact form
6793
+ */
6794
+ declare function normalizeContent(content: MessageContent): MessageContent;
6795
+ /**
6796
+ * Builder class for creating message content
6797
+ */
6798
+ declare class MessageContentBuilder {
6799
+ private parts;
6800
+ /**
6801
+ * Add a text part
6802
+ */
6803
+ addText(text: string): this;
6804
+ /**
6805
+ * Add an image part
6806
+ */
6807
+ addImage(image: string | Uint8Array): this;
6808
+ /**
6809
+ * Add a file part
6810
+ */
6811
+ addFile(file: string | Uint8Array, mimeType?: string): this;
6812
+ /**
6813
+ * Add a custom part
6814
+ */
6815
+ addPart(part: any): this;
6816
+ /**
6817
+ * Build the final content
6818
+ */
6819
+ build(): MessageContent;
6820
+ /**
6821
+ * Build as array (always returns array)
6822
+ */
6823
+ buildAsArray(): Array<any>;
6824
+ /**
6825
+ * Clear all parts
6826
+ */
6827
+ clear(): this;
6828
+ /**
6829
+ * Get current parts count
6830
+ */
6831
+ get length(): number;
6832
+ }
6833
+ /**
6834
+ * Convenience function to add timestamp to user messages
6835
+ */
6836
+ declare function addTimestampToMessage(message: BaseMessage, timestamp?: string): BaseMessage;
6837
+ /**
6838
+ * Convenience function to prepend text to message content
6839
+ */
6840
+ declare function prependToMessage(message: BaseMessage, prefix: string): BaseMessage;
6841
+ /**
6842
+ * Convenience function to append text to message content
6843
+ */
6844
+ declare function appendToMessage(message: BaseMessage, suffix: string): BaseMessage;
6845
+ /**
6846
+ * Check if message has any content
6847
+ */
6848
+ declare function hasContent(message: BaseMessage): boolean;
6849
+ /**
6850
+ * Get content length (text characters or array items)
6851
+ */
6852
+ declare function getContentLength(content: MessageContent): number;
6853
+ /**
6854
+ * Combined message helpers object for easy importing
6855
+ */
6856
+ declare const messageHelpers: {
6857
+ isTextContent: typeof isTextContent;
6858
+ isStructuredContent: typeof isStructuredContent;
6859
+ hasTextPart: typeof hasTextPart;
6860
+ hasImagePart: typeof hasImagePart;
6861
+ hasFilePart: typeof hasFilePart;
6862
+ extractText: typeof extractText;
6863
+ extractTextParts: typeof extractTextParts;
6864
+ extractImageParts: typeof extractImageParts;
6865
+ extractFileParts: typeof extractFileParts;
6866
+ transformTextContent: typeof transformTextContent;
6867
+ mapMessageContent: typeof mapMessageContent;
6868
+ filterContentParts: typeof filterContentParts;
6869
+ normalizeToArray: typeof normalizeToArray;
6870
+ normalizeContent: typeof normalizeContent;
6871
+ addTimestampToMessage: typeof addTimestampToMessage;
6872
+ prependToMessage: typeof prependToMessage;
6873
+ appendToMessage: typeof appendToMessage;
6874
+ hasContent: typeof hasContent;
6875
+ getContentLength: typeof getContentLength;
6876
+ MessageContentBuilder: typeof MessageContentBuilder;
6877
+ };
6878
+
6712
6879
  /**
6713
6880
  * Creates an AgentTool from a retriever, allowing it to be used as a tool in an agent.
6714
6881
  * This is the preferred way to use a retriever as a tool, as it properly maintains the 'this' context.
@@ -7387,4 +7554,4 @@ declare class VoltAgent {
7387
7554
  shutdownTelemetry(): Promise<void>;
7388
7555
  }
7389
7556
 
7390
- export { type AbortError, Agent, type AgentErrorEvent, AgentEventEmitter, type AgentHistoryEntry, type AgentHookOnEnd, type AgentHookOnHandoff, 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, type MessageFilterOptions, type MessageRole, type ModelToolCall, type NewTimelineEvent, NextAction, NodeType, type ObjectSubAgentConfig, type OnEndHookArgs, type OnHandoffHookArgs, 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, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, buildRetrieverLogMessage, checkForUpdates, createHooks, createNodeId, createPrompt, createReasoningTools, createRetrieverTool, createSimpleTemplateEngine, createStreamEventForwarder, createSubagent, createSuspendController, createTool, createToolkit, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractWorkflowStepInfo, getNodeTypeFromNodeId, getWorkflowStepNodeType, isAbortError, isVoltAgentError, registerCustomEndpoint, registerCustomEndpoints, safeJsonParse, serializeValueForDebug, streamEventForwarder, tool, updateAllPackages, updateSinglePackage, zodSchemaToJsonUI };
7557
+ 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 };