@voltagent/core 1.1.38 → 1.2.0

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,5 +1,5 @@
1
- import { ModelMessage, ToolCallOptions, DataContent as DataContent$1, UserContent, AssistantContent, ToolContent, ProviderOptions as ProviderOptions$1 } from '@ai-sdk/provider-utils';
2
- export { AssistantContent, FilePart, ImagePart, TextPart, ToolContent, UserContent } from '@ai-sdk/provider-utils';
1
+ import { ToolCallOptions, ProviderOptions as ProviderOptions$1, ModelMessage, DataContent as DataContent$1, UserContent, AssistantContent, ToolContent } from '@ai-sdk/provider-utils';
2
+ export { AssistantContent, FilePart, ImagePart, ProviderOptions, TextPart, ToolContent, UserContent } from '@ai-sdk/provider-utils';
3
3
  import { Tool as Tool$1, TextStreamPart, generateText, UIMessage, StreamTextResult, LanguageModel, CallSettings, Output, ToolSet, GenerateTextResult, GenerateObjectResult, AsyncIterableStream as AsyncIterableStream$1, CallWarning, LanguageModelUsage, FinishReason, EmbeddingModel } from 'ai';
4
4
  export { LanguageModel, Tool as VercelTool, hasToolCall, stepCountIs } from 'ai';
5
5
  import * as zod from 'zod';
@@ -191,7 +191,7 @@ declare class ToolManager extends BaseToolManager<AgentTool | Tool$1 | Toolkit,
191
191
  * @returns true if the toolkit was successfully added or replaced.
192
192
  */
193
193
  addToolkit(toolkit: Toolkit): boolean;
194
- prepareToolsForExecution(createToolExecuteFunction: (tool: AgentTool) => (args: any, options?: ToolExecuteOptions) => Promise<any>): Record<string, any>;
194
+ prepareToolsForExecution(createToolExecuteFunction: (tool: AgentTool) => (args: any, options?: ToolCallOptions) => Promise<any>): Record<string, any>;
195
195
  /**
196
196
  * Get agent's tools (including those in toolkits) for API exposure.
197
197
  */
@@ -216,6 +216,40 @@ type ToolStatusInfo = {
216
216
  parameters?: any;
217
217
  };
218
218
 
219
+ /**
220
+ * JSON value types (matches AI SDK's JSONValue)
221
+ */
222
+ type JSONValue = string | number | boolean | null | {
223
+ [key: string]: JSONValue;
224
+ } | Array<JSONValue>;
225
+ /**
226
+ * Tool result output format for multi-modal content.
227
+ * Matches AI SDK's LanguageModelV2ToolResultOutput type.
228
+ */
229
+ type ToolResultOutput = {
230
+ type: "text";
231
+ value: string;
232
+ } | {
233
+ type: "json";
234
+ value: JSONValue;
235
+ } | {
236
+ type: "error-text";
237
+ value: string;
238
+ } | {
239
+ type: "error-json";
240
+ value: JSONValue;
241
+ } | {
242
+ type: "content";
243
+ value: Array<{
244
+ type: "text";
245
+ text: string;
246
+ } | {
247
+ type: "media";
248
+ data: string;
249
+ mediaType: string;
250
+ }>;
251
+ };
252
+
219
253
  /**
220
254
  * Tool definition compatible with Vercel AI SDK
221
255
  */
@@ -251,9 +285,45 @@ type ToolOptions<T extends ToolSchema = ToolSchema, O extends ToolSchema | undef
251
285
  */
252
286
  outputSchema?: O;
253
287
  /**
254
- * Function to execute when the tool is called
288
+ * Provider-specific options for the tool.
289
+ * Enables provider-specific functionality like cache control.
290
+ *
291
+ * @example
292
+ * ```typescript
293
+ * // Anthropic cache control
294
+ * providerOptions: {
295
+ * anthropic: {
296
+ * cacheControl: { type: 'ephemeral' }
297
+ * }
298
+ * }
299
+ * ```
300
+ */
301
+ providerOptions?: ProviderOptions$1;
302
+ /**
303
+ * Optional function to convert tool output to multi-modal content.
304
+ * Enables returning images, media, or structured content to the LLM.
305
+ *
306
+ * Supported by: Anthropic, OpenAI
307
+ *
308
+ * @example
309
+ * ```typescript
310
+ * // Return image + text
311
+ * toModelOutput: (result) => ({
312
+ * type: 'content',
313
+ * value: [
314
+ * { type: 'text', text: 'Screenshot taken' },
315
+ * { type: 'media', data: result.base64Image, mediaType: 'image/png' }
316
+ * ]
317
+ * })
318
+ * ```
255
319
  */
256
- execute?: (args: z.infer<T>, context?: OperationContext, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
320
+ toModelOutput?: (output: O extends ToolSchema ? z.infer<O> : unknown) => ToolResultOutput;
321
+ /**
322
+ * Function to execute when the tool is called.
323
+ * @param args - The arguments passed to the tool
324
+ * @param options - Optional execution options including context, abort signals, etc.
325
+ */
326
+ execute?: (args: z.infer<T>, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
257
327
  };
258
328
  /**
259
329
  * Tool class for defining tools that agents can use
@@ -279,15 +349,27 @@ declare class Tool<T extends ToolSchema = ToolSchema, O extends ToolSchema | und
279
349
  * Tool output schema
280
350
  */
281
351
  readonly outputSchema?: O;
352
+ /**
353
+ * Provider-specific options for the tool.
354
+ * Enables provider-specific functionality like cache control.
355
+ */
356
+ readonly providerOptions?: ProviderOptions$1;
357
+ /**
358
+ * Optional function to convert tool output to multi-modal content.
359
+ * Enables returning images, media, or structured content to the LLM.
360
+ */
361
+ readonly toModelOutput?: (output: O extends ToolSchema ? z.infer<O> : unknown) => ToolResultOutput;
282
362
  /**
283
363
  * Internal discriminator to make runtime/type checks simpler across module boundaries.
284
364
  * Marking our Tool instances with a stable string avoids instanceof issues.
285
365
  */
286
366
  readonly type: "user-defined";
287
367
  /**
288
- * Function to execute when the tool is called
368
+ * Function to execute when the tool is called.
369
+ * @param args - The arguments passed to the tool
370
+ * @param options - Optional execution options including context, abort signals, etc.
289
371
  */
290
- readonly execute?: (args: z.infer<T>, context?: OperationContext, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
372
+ readonly execute?: (args: z.infer<T>, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
291
373
  /**
292
374
  * Whether this tool should be executed on the client side.
293
375
  * Returns true when no server-side execute handler is provided.
@@ -485,21 +567,35 @@ type MessageRole = "user" | "assistant" | "system" | "tool";
485
567
  */
486
568
  type BaseMessage = ModelMessage;
487
569
  type ToolSchema = z.ZodType;
488
- type ToolExecuteOptions = ToolCallOptions & {
489
- /**
490
- * Optional AbortController for cancelling the execution and accessing the signal.
491
- * Prefer using the provided abortSignal, but we keep this for backward compatibility.
492
- */
493
- abortController?: AbortController;
570
+ /**
571
+ * Tool execution context containing all tool-specific metadata.
572
+ * Encapsulates both AI SDK fields and VoltAgent metadata for better organization.
573
+ */
574
+ type ToolContext = {
575
+ /** Name of the tool being executed */
576
+ name: string;
577
+ /** Unique identifier for this specific tool call (from AI SDK) */
578
+ callId: string;
579
+ /** Message history at the time of tool call (from AI SDK) */
580
+ messages: any[];
581
+ /** Abort signal for detecting cancellation (from AI SDK) */
582
+ abortSignal?: AbortSignal;
583
+ };
584
+ type ToolExecuteOptions = Partial<OperationContext> & {
494
585
  /**
495
- * @deprecated Use abortController.signal or options.abortSignal instead. This field will be removed in a future version.
586
+ * Tool execution context containing all tool-specific metadata.
587
+ * Includes both AI SDK fields (callId, messages, abortSignal) and
588
+ * VoltAgent metadata (name).
589
+ *
590
+ * Optional for external callers (e.g., MCP servers) that may not have tool metadata.
591
+ * When called from VoltAgent's agent, this is always populated.
496
592
  */
497
- signal?: AbortSignal;
593
+ toolContext?: ToolContext;
498
594
  /**
499
- * The operation context associated with the agent invocation triggering this tool execution.
500
- * Provides access to operation-specific state like context and logging metadata.
595
+ * Optional AbortController for cancelling the execution and accessing the signal.
596
+ * Prefer using toolContext.abortSignal.
501
597
  */
502
- operationContext?: OperationContext;
598
+ abortController?: AbortController;
503
599
  /**
504
600
  * Additional options can be added in the future.
505
601
  */
@@ -3453,6 +3549,26 @@ interface OnHandoffHookArgs {
3453
3549
  agent: Agent;
3454
3550
  sourceAgent: Agent;
3455
3551
  }
3552
+ interface OnHandoffCompleteHookArgs {
3553
+ /** The target agent (subagent) that completed the task. */
3554
+ agent: Agent;
3555
+ /** The source agent (supervisor) that delegated the task. */
3556
+ sourceAgent: Agent;
3557
+ /** The result produced by the subagent. */
3558
+ result: string;
3559
+ /** The full conversation messages including the task and response. */
3560
+ messages: UIMessage[];
3561
+ /** Token usage information from the subagent execution. */
3562
+ usage?: UsageInfo;
3563
+ /** The operation context containing metadata about the operation. */
3564
+ context: OperationContext;
3565
+ /**
3566
+ * Call this function to bail (skip supervisor processing) and return result directly.
3567
+ * Optionally provide a transformed result to use instead of the original.
3568
+ * @param transformedResult - Optional transformed result to return instead of original
3569
+ */
3570
+ bail: (transformedResult?: string) => void;
3571
+ }
3456
3572
  interface OnToolStartHookArgs {
3457
3573
  agent: Agent;
3458
3574
  tool: AgentTool;
@@ -3511,6 +3627,7 @@ interface OnStepFinishHookArgs {
3511
3627
  type AgentHookOnStart = (args: OnStartHookArgs) => Promise<void> | void;
3512
3628
  type AgentHookOnEnd = (args: OnEndHookArgs) => Promise<void> | void;
3513
3629
  type AgentHookOnHandoff = (args: OnHandoffHookArgs) => Promise<void> | void;
3630
+ type AgentHookOnHandoffComplete = (args: OnHandoffCompleteHookArgs) => Promise<void> | void;
3514
3631
  type AgentHookOnToolStart = (args: OnToolStartHookArgs) => Promise<void> | void;
3515
3632
  type AgentHookOnToolEnd = (args: OnToolEndHookArgs) => Promise<void> | void;
3516
3633
  type AgentHookOnPrepareMessages = (args: OnPrepareMessagesHookArgs) => Promise<OnPrepareMessagesHookResult> | OnPrepareMessagesHookResult;
@@ -3524,6 +3641,7 @@ type AgentHooks = {
3524
3641
  onStart?: AgentHookOnStart;
3525
3642
  onEnd?: AgentHookOnEnd;
3526
3643
  onHandoff?: AgentHookOnHandoff;
3644
+ onHandoffComplete?: AgentHookOnHandoffComplete;
3527
3645
  onToolStart?: AgentHookOnToolStart;
3528
3646
  onToolEnd?: AgentHookOnToolEnd;
3529
3647
  onPrepareMessages?: AgentHookOnPrepareMessages;
@@ -8416,4 +8534,4 @@ declare class VoltAgent {
8416
8534
  */
8417
8535
  declare function convertUsage(usage: LanguageModelUsage | undefined): UsageInfo | undefined;
8418
8536
 
8419
- export { A2AServerRegistry, AbortError, Agent, type AgentEvalConfig, type AgentEvalContext, type AgentEvalOperationType, type AgentEvalPayload, type AgentEvalResult, type AgentEvalSamplingPolicy, type AgentEvalScorerConfig, type AgentEvalScorerFactory, type AgentEvalScorerReference, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnPrepareModelMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentScorerState, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type BuildScorerOptions, type BuildScorerRunArgs, type BuildScorerRunResult, type BuilderAnalyzeContext, type BuilderPrepareContext, type BuilderReasonContext, type BuilderScoreContext, type CachedPrompt, type ChatMessage, ClientHTTPError, type ClientSideToolResult, type CloudflareFetchHandler, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateInputGuardrailOptions, type CreateOutputGuardrailOptions, type CreateReasoningToolsOptions, type CreateScorerOptions, 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 GenerateReasonResult, type GenerateScoreResult, type GenerateScoreStep, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type GuardrailAction, type GuardrailContext, type GuardrailDefinition, type GuardrailFunction, type GuardrailSeverity, type IServerProvider, type IServerlessProvider, 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 InputGuardrail, type InputGuardrailArgs, type InputGuardrailResult, type LLMProvider, LazyRemoteExportProcessor, type LocalScorerDefinition, type LocalScorerExecutionResult, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPConfiguration, type MCPElicitationAdapter, type MCPLoggingAdapter, type MCPPromptsAdapter, type MCPResourcesAdapter, MCPServerRegistry, type ManagedMemoryAddMessageInput, type ManagedMemoryAddMessagesInput, type ManagedMemoryClearMessagesInput, type ManagedMemoryConnectionInfo, type ManagedMemoryConversationsClient, type ManagedMemoryCredentialCreateResult, type ManagedMemoryCredentialListResult, type ManagedMemoryCredentialSummary, type ManagedMemoryDatabaseSummary, type ManagedMemoryGetMessagesInput, type ManagedMemoryMessagesClient, type ManagedMemorySetWorkingMemoryInput, type ManagedMemoryStatus, type ManagedMemoryUpdateConversationInput, type ManagedMemoryVoltOpsClient, type ManagedMemoryWorkflowStateUpdateInput, type ManagedMemoryWorkflowStatesClient, type ManagedMemoryWorkingMemoryClient, type ManagedMemoryWorkingMemoryInput, Memory, type MemoryConfig, type MemoryOptions, type MemoryStorageMetadata, type MemoryUpdateMode, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, VoltAgentObservability$1 as NodeVoltAgentObservability, type ObservabilityConfig, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnPrepareModelMessagesHookArgs, type OnPrepareModelMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type OutputGuardrail, type OutputGuardrailArgs, type OutputGuardrailResult, 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 ProviderTool, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisterOptions, type RegisteredWorkflow, type RemoteLogExportConfig, RemoteLogProcessor, type RetrieveOptions, type Retriever, type RetrieverOptions, type RunLocalScorersArgs, type RunLocalScorersResult, type SamplingMetadata, type SamplingPolicy, type ScorerBuilder, type ScorerContext, type ScorerLifecycleScope, type ScorerPipelineContext, type ScorerReasonContext, type ScorerResult, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type ServerlessProviderFactory, type ServerlessRemoteEndpointConfig, type ServerlessRemoteExportConfig, type ServerlessRequestHandler, ServerlessVoltAgentObservability, type SpanAttributes, type SpanEvent, type SpanFilterConfig, SpanFilterProcessor, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, StorageLogProcessor, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, ToolDeniedError, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, 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, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsTerminalEvalRunStatus, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, type WorkingMemorySummary, type WorkingMemoryUpdateOptions, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSamplingMetadata, buildScorer, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createDefaultInputSafetyGuardrails, createDefaultPIIGuardrails, createDefaultSafetyGuardrails, createEmailRedactorGuardrail, createHTMLSanitizerInputGuardrail, createHooks, createInputGuardrail, createInputLengthGuardrail, createMaxLengthGuardrail, createNodeId, createOutputGuardrail, createPIIInputGuardrail, createPhoneNumberGuardrail, createProfanityGuardrail, createProfanityInputGuardrail, createPrompt, createPromptInjectionGuardrail, createReasoningTools, createRetrieverTool, createScorer, createSensitiveNumberGuardrail, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };
8537
+ export { A2AServerRegistry, AbortError, Agent, type AgentEvalConfig, type AgentEvalContext, type AgentEvalOperationType, type AgentEvalPayload, type AgentEvalResult, type AgentEvalSamplingPolicy, type AgentEvalScorerConfig, type AgentEvalScorerFactory, type AgentEvalScorerReference, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnHandoffComplete, type AgentHookOnPrepareMessages, type AgentHookOnPrepareModelMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentScorerState, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type BuildScorerOptions, type BuildScorerRunArgs, type BuildScorerRunResult, type BuilderAnalyzeContext, type BuilderPrepareContext, type BuilderReasonContext, type BuilderScoreContext, type CachedPrompt, type ChatMessage, ClientHTTPError, type ClientSideToolResult, type CloudflareFetchHandler, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateInputGuardrailOptions, type CreateOutputGuardrailOptions, type CreateReasoningToolsOptions, type CreateScorerOptions, 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 GenerateReasonResult, type GenerateScoreResult, type GenerateScoreStep, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type GuardrailAction, type GuardrailContext, type GuardrailDefinition, type GuardrailFunction, type GuardrailSeverity, type IServerProvider, type IServerlessProvider, 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 InputGuardrail, type InputGuardrailArgs, type InputGuardrailResult, type LLMProvider, LazyRemoteExportProcessor, type LocalScorerDefinition, type LocalScorerExecutionResult, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPConfiguration, type MCPElicitationAdapter, type MCPLoggingAdapter, type MCPPromptsAdapter, type MCPResourcesAdapter, MCPServerRegistry, type ManagedMemoryAddMessageInput, type ManagedMemoryAddMessagesInput, type ManagedMemoryClearMessagesInput, type ManagedMemoryConnectionInfo, type ManagedMemoryConversationsClient, type ManagedMemoryCredentialCreateResult, type ManagedMemoryCredentialListResult, type ManagedMemoryCredentialSummary, type ManagedMemoryDatabaseSummary, type ManagedMemoryGetMessagesInput, type ManagedMemoryMessagesClient, type ManagedMemorySetWorkingMemoryInput, type ManagedMemoryStatus, type ManagedMemoryUpdateConversationInput, type ManagedMemoryVoltOpsClient, type ManagedMemoryWorkflowStateUpdateInput, type ManagedMemoryWorkflowStatesClient, type ManagedMemoryWorkingMemoryClient, type ManagedMemoryWorkingMemoryInput, Memory, type MemoryConfig, type MemoryOptions, type MemoryStorageMetadata, type MemoryUpdateMode, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, VoltAgentObservability$1 as NodeVoltAgentObservability, type ObservabilityConfig, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffCompleteHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnPrepareModelMessagesHookArgs, type OnPrepareModelMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type OutputGuardrail, type OutputGuardrailArgs, type OutputGuardrailResult, 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 ProviderTool, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisterOptions, type RegisteredWorkflow, type RemoteLogExportConfig, RemoteLogProcessor, type RetrieveOptions, type Retriever, type RetrieverOptions, type RunLocalScorersArgs, type RunLocalScorersResult, type SamplingMetadata, type SamplingPolicy, type ScorerBuilder, type ScorerContext, type ScorerLifecycleScope, type ScorerPipelineContext, type ScorerReasonContext, type ScorerResult, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type ServerlessProviderFactory, type ServerlessRemoteEndpointConfig, type ServerlessRemoteExportConfig, type ServerlessRequestHandler, ServerlessVoltAgentObservability, type SpanAttributes, type SpanEvent, type SpanFilterConfig, SpanFilterProcessor, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, StorageLogProcessor, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolContext, ToolDeniedError, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolResultOutput, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, 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, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsTerminalEvalRunStatus, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, type WorkingMemorySummary, type WorkingMemoryUpdateOptions, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSamplingMetadata, buildScorer, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createDefaultInputSafetyGuardrails, createDefaultPIIGuardrails, createDefaultSafetyGuardrails, createEmailRedactorGuardrail, createHTMLSanitizerInputGuardrail, createHooks, createInputGuardrail, createInputLengthGuardrail, createMaxLengthGuardrail, createNodeId, createOutputGuardrail, createPIIInputGuardrail, createPhoneNumberGuardrail, createProfanityGuardrail, createProfanityInputGuardrail, createPrompt, createPromptInjectionGuardrail, createReasoningTools, createRetrieverTool, createScorer, createSensitiveNumberGuardrail, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ModelMessage, ToolCallOptions, DataContent as DataContent$1, UserContent, AssistantContent, ToolContent, ProviderOptions as ProviderOptions$1 } from '@ai-sdk/provider-utils';
2
- export { AssistantContent, FilePart, ImagePart, TextPart, ToolContent, UserContent } from '@ai-sdk/provider-utils';
1
+ import { ToolCallOptions, ProviderOptions as ProviderOptions$1, ModelMessage, DataContent as DataContent$1, UserContent, AssistantContent, ToolContent } from '@ai-sdk/provider-utils';
2
+ export { AssistantContent, FilePart, ImagePart, ProviderOptions, TextPart, ToolContent, UserContent } from '@ai-sdk/provider-utils';
3
3
  import { Tool as Tool$1, TextStreamPart, generateText, UIMessage, StreamTextResult, LanguageModel, CallSettings, Output, ToolSet, GenerateTextResult, GenerateObjectResult, AsyncIterableStream as AsyncIterableStream$1, CallWarning, LanguageModelUsage, FinishReason, EmbeddingModel } from 'ai';
4
4
  export { LanguageModel, Tool as VercelTool, hasToolCall, stepCountIs } from 'ai';
5
5
  import * as zod from 'zod';
@@ -191,7 +191,7 @@ declare class ToolManager extends BaseToolManager<AgentTool | Tool$1 | Toolkit,
191
191
  * @returns true if the toolkit was successfully added or replaced.
192
192
  */
193
193
  addToolkit(toolkit: Toolkit): boolean;
194
- prepareToolsForExecution(createToolExecuteFunction: (tool: AgentTool) => (args: any, options?: ToolExecuteOptions) => Promise<any>): Record<string, any>;
194
+ prepareToolsForExecution(createToolExecuteFunction: (tool: AgentTool) => (args: any, options?: ToolCallOptions) => Promise<any>): Record<string, any>;
195
195
  /**
196
196
  * Get agent's tools (including those in toolkits) for API exposure.
197
197
  */
@@ -216,6 +216,40 @@ type ToolStatusInfo = {
216
216
  parameters?: any;
217
217
  };
218
218
 
219
+ /**
220
+ * JSON value types (matches AI SDK's JSONValue)
221
+ */
222
+ type JSONValue = string | number | boolean | null | {
223
+ [key: string]: JSONValue;
224
+ } | Array<JSONValue>;
225
+ /**
226
+ * Tool result output format for multi-modal content.
227
+ * Matches AI SDK's LanguageModelV2ToolResultOutput type.
228
+ */
229
+ type ToolResultOutput = {
230
+ type: "text";
231
+ value: string;
232
+ } | {
233
+ type: "json";
234
+ value: JSONValue;
235
+ } | {
236
+ type: "error-text";
237
+ value: string;
238
+ } | {
239
+ type: "error-json";
240
+ value: JSONValue;
241
+ } | {
242
+ type: "content";
243
+ value: Array<{
244
+ type: "text";
245
+ text: string;
246
+ } | {
247
+ type: "media";
248
+ data: string;
249
+ mediaType: string;
250
+ }>;
251
+ };
252
+
219
253
  /**
220
254
  * Tool definition compatible with Vercel AI SDK
221
255
  */
@@ -251,9 +285,45 @@ type ToolOptions<T extends ToolSchema = ToolSchema, O extends ToolSchema | undef
251
285
  */
252
286
  outputSchema?: O;
253
287
  /**
254
- * Function to execute when the tool is called
288
+ * Provider-specific options for the tool.
289
+ * Enables provider-specific functionality like cache control.
290
+ *
291
+ * @example
292
+ * ```typescript
293
+ * // Anthropic cache control
294
+ * providerOptions: {
295
+ * anthropic: {
296
+ * cacheControl: { type: 'ephemeral' }
297
+ * }
298
+ * }
299
+ * ```
300
+ */
301
+ providerOptions?: ProviderOptions$1;
302
+ /**
303
+ * Optional function to convert tool output to multi-modal content.
304
+ * Enables returning images, media, or structured content to the LLM.
305
+ *
306
+ * Supported by: Anthropic, OpenAI
307
+ *
308
+ * @example
309
+ * ```typescript
310
+ * // Return image + text
311
+ * toModelOutput: (result) => ({
312
+ * type: 'content',
313
+ * value: [
314
+ * { type: 'text', text: 'Screenshot taken' },
315
+ * { type: 'media', data: result.base64Image, mediaType: 'image/png' }
316
+ * ]
317
+ * })
318
+ * ```
255
319
  */
256
- execute?: (args: z.infer<T>, context?: OperationContext, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
320
+ toModelOutput?: (output: O extends ToolSchema ? z.infer<O> : unknown) => ToolResultOutput;
321
+ /**
322
+ * Function to execute when the tool is called.
323
+ * @param args - The arguments passed to the tool
324
+ * @param options - Optional execution options including context, abort signals, etc.
325
+ */
326
+ execute?: (args: z.infer<T>, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
257
327
  };
258
328
  /**
259
329
  * Tool class for defining tools that agents can use
@@ -279,15 +349,27 @@ declare class Tool<T extends ToolSchema = ToolSchema, O extends ToolSchema | und
279
349
  * Tool output schema
280
350
  */
281
351
  readonly outputSchema?: O;
352
+ /**
353
+ * Provider-specific options for the tool.
354
+ * Enables provider-specific functionality like cache control.
355
+ */
356
+ readonly providerOptions?: ProviderOptions$1;
357
+ /**
358
+ * Optional function to convert tool output to multi-modal content.
359
+ * Enables returning images, media, or structured content to the LLM.
360
+ */
361
+ readonly toModelOutput?: (output: O extends ToolSchema ? z.infer<O> : unknown) => ToolResultOutput;
282
362
  /**
283
363
  * Internal discriminator to make runtime/type checks simpler across module boundaries.
284
364
  * Marking our Tool instances with a stable string avoids instanceof issues.
285
365
  */
286
366
  readonly type: "user-defined";
287
367
  /**
288
- * Function to execute when the tool is called
368
+ * Function to execute when the tool is called.
369
+ * @param args - The arguments passed to the tool
370
+ * @param options - Optional execution options including context, abort signals, etc.
289
371
  */
290
- readonly execute?: (args: z.infer<T>, context?: OperationContext, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
372
+ readonly execute?: (args: z.infer<T>, options?: ToolExecuteOptions) => Promise<O extends ToolSchema ? z.infer<O> : unknown>;
291
373
  /**
292
374
  * Whether this tool should be executed on the client side.
293
375
  * Returns true when no server-side execute handler is provided.
@@ -485,21 +567,35 @@ type MessageRole = "user" | "assistant" | "system" | "tool";
485
567
  */
486
568
  type BaseMessage = ModelMessage;
487
569
  type ToolSchema = z.ZodType;
488
- type ToolExecuteOptions = ToolCallOptions & {
489
- /**
490
- * Optional AbortController for cancelling the execution and accessing the signal.
491
- * Prefer using the provided abortSignal, but we keep this for backward compatibility.
492
- */
493
- abortController?: AbortController;
570
+ /**
571
+ * Tool execution context containing all tool-specific metadata.
572
+ * Encapsulates both AI SDK fields and VoltAgent metadata for better organization.
573
+ */
574
+ type ToolContext = {
575
+ /** Name of the tool being executed */
576
+ name: string;
577
+ /** Unique identifier for this specific tool call (from AI SDK) */
578
+ callId: string;
579
+ /** Message history at the time of tool call (from AI SDK) */
580
+ messages: any[];
581
+ /** Abort signal for detecting cancellation (from AI SDK) */
582
+ abortSignal?: AbortSignal;
583
+ };
584
+ type ToolExecuteOptions = Partial<OperationContext> & {
494
585
  /**
495
- * @deprecated Use abortController.signal or options.abortSignal instead. This field will be removed in a future version.
586
+ * Tool execution context containing all tool-specific metadata.
587
+ * Includes both AI SDK fields (callId, messages, abortSignal) and
588
+ * VoltAgent metadata (name).
589
+ *
590
+ * Optional for external callers (e.g., MCP servers) that may not have tool metadata.
591
+ * When called from VoltAgent's agent, this is always populated.
496
592
  */
497
- signal?: AbortSignal;
593
+ toolContext?: ToolContext;
498
594
  /**
499
- * The operation context associated with the agent invocation triggering this tool execution.
500
- * Provides access to operation-specific state like context and logging metadata.
595
+ * Optional AbortController for cancelling the execution and accessing the signal.
596
+ * Prefer using toolContext.abortSignal.
501
597
  */
502
- operationContext?: OperationContext;
598
+ abortController?: AbortController;
503
599
  /**
504
600
  * Additional options can be added in the future.
505
601
  */
@@ -3453,6 +3549,26 @@ interface OnHandoffHookArgs {
3453
3549
  agent: Agent;
3454
3550
  sourceAgent: Agent;
3455
3551
  }
3552
+ interface OnHandoffCompleteHookArgs {
3553
+ /** The target agent (subagent) that completed the task. */
3554
+ agent: Agent;
3555
+ /** The source agent (supervisor) that delegated the task. */
3556
+ sourceAgent: Agent;
3557
+ /** The result produced by the subagent. */
3558
+ result: string;
3559
+ /** The full conversation messages including the task and response. */
3560
+ messages: UIMessage[];
3561
+ /** Token usage information from the subagent execution. */
3562
+ usage?: UsageInfo;
3563
+ /** The operation context containing metadata about the operation. */
3564
+ context: OperationContext;
3565
+ /**
3566
+ * Call this function to bail (skip supervisor processing) and return result directly.
3567
+ * Optionally provide a transformed result to use instead of the original.
3568
+ * @param transformedResult - Optional transformed result to return instead of original
3569
+ */
3570
+ bail: (transformedResult?: string) => void;
3571
+ }
3456
3572
  interface OnToolStartHookArgs {
3457
3573
  agent: Agent;
3458
3574
  tool: AgentTool;
@@ -3511,6 +3627,7 @@ interface OnStepFinishHookArgs {
3511
3627
  type AgentHookOnStart = (args: OnStartHookArgs) => Promise<void> | void;
3512
3628
  type AgentHookOnEnd = (args: OnEndHookArgs) => Promise<void> | void;
3513
3629
  type AgentHookOnHandoff = (args: OnHandoffHookArgs) => Promise<void> | void;
3630
+ type AgentHookOnHandoffComplete = (args: OnHandoffCompleteHookArgs) => Promise<void> | void;
3514
3631
  type AgentHookOnToolStart = (args: OnToolStartHookArgs) => Promise<void> | void;
3515
3632
  type AgentHookOnToolEnd = (args: OnToolEndHookArgs) => Promise<void> | void;
3516
3633
  type AgentHookOnPrepareMessages = (args: OnPrepareMessagesHookArgs) => Promise<OnPrepareMessagesHookResult> | OnPrepareMessagesHookResult;
@@ -3524,6 +3641,7 @@ type AgentHooks = {
3524
3641
  onStart?: AgentHookOnStart;
3525
3642
  onEnd?: AgentHookOnEnd;
3526
3643
  onHandoff?: AgentHookOnHandoff;
3644
+ onHandoffComplete?: AgentHookOnHandoffComplete;
3527
3645
  onToolStart?: AgentHookOnToolStart;
3528
3646
  onToolEnd?: AgentHookOnToolEnd;
3529
3647
  onPrepareMessages?: AgentHookOnPrepareMessages;
@@ -8416,4 +8534,4 @@ declare class VoltAgent {
8416
8534
  */
8417
8535
  declare function convertUsage(usage: LanguageModelUsage | undefined): UsageInfo | undefined;
8418
8536
 
8419
- export { A2AServerRegistry, AbortError, Agent, type AgentEvalConfig, type AgentEvalContext, type AgentEvalOperationType, type AgentEvalPayload, type AgentEvalResult, type AgentEvalSamplingPolicy, type AgentEvalScorerConfig, type AgentEvalScorerFactory, type AgentEvalScorerReference, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnPrepareMessages, type AgentHookOnPrepareModelMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentScorerState, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type BuildScorerOptions, type BuildScorerRunArgs, type BuildScorerRunResult, type BuilderAnalyzeContext, type BuilderPrepareContext, type BuilderReasonContext, type BuilderScoreContext, type CachedPrompt, type ChatMessage, ClientHTTPError, type ClientSideToolResult, type CloudflareFetchHandler, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateInputGuardrailOptions, type CreateOutputGuardrailOptions, type CreateReasoningToolsOptions, type CreateScorerOptions, 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 GenerateReasonResult, type GenerateScoreResult, type GenerateScoreStep, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type GuardrailAction, type GuardrailContext, type GuardrailDefinition, type GuardrailFunction, type GuardrailSeverity, type IServerProvider, type IServerlessProvider, 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 InputGuardrail, type InputGuardrailArgs, type InputGuardrailResult, type LLMProvider, LazyRemoteExportProcessor, type LocalScorerDefinition, type LocalScorerExecutionResult, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPConfiguration, type MCPElicitationAdapter, type MCPLoggingAdapter, type MCPPromptsAdapter, type MCPResourcesAdapter, MCPServerRegistry, type ManagedMemoryAddMessageInput, type ManagedMemoryAddMessagesInput, type ManagedMemoryClearMessagesInput, type ManagedMemoryConnectionInfo, type ManagedMemoryConversationsClient, type ManagedMemoryCredentialCreateResult, type ManagedMemoryCredentialListResult, type ManagedMemoryCredentialSummary, type ManagedMemoryDatabaseSummary, type ManagedMemoryGetMessagesInput, type ManagedMemoryMessagesClient, type ManagedMemorySetWorkingMemoryInput, type ManagedMemoryStatus, type ManagedMemoryUpdateConversationInput, type ManagedMemoryVoltOpsClient, type ManagedMemoryWorkflowStateUpdateInput, type ManagedMemoryWorkflowStatesClient, type ManagedMemoryWorkingMemoryClient, type ManagedMemoryWorkingMemoryInput, Memory, type MemoryConfig, type MemoryOptions, type MemoryStorageMetadata, type MemoryUpdateMode, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, VoltAgentObservability$1 as NodeVoltAgentObservability, type ObservabilityConfig, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnPrepareModelMessagesHookArgs, type OnPrepareModelMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type OutputGuardrail, type OutputGuardrailArgs, type OutputGuardrailResult, 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 ProviderTool, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisterOptions, type RegisteredWorkflow, type RemoteLogExportConfig, RemoteLogProcessor, type RetrieveOptions, type Retriever, type RetrieverOptions, type RunLocalScorersArgs, type RunLocalScorersResult, type SamplingMetadata, type SamplingPolicy, type ScorerBuilder, type ScorerContext, type ScorerLifecycleScope, type ScorerPipelineContext, type ScorerReasonContext, type ScorerResult, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type ServerlessProviderFactory, type ServerlessRemoteEndpointConfig, type ServerlessRemoteExportConfig, type ServerlessRequestHandler, ServerlessVoltAgentObservability, type SpanAttributes, type SpanEvent, type SpanFilterConfig, SpanFilterProcessor, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, StorageLogProcessor, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, ToolDeniedError, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, 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, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsTerminalEvalRunStatus, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, type WorkingMemorySummary, type WorkingMemoryUpdateOptions, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSamplingMetadata, buildScorer, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createDefaultInputSafetyGuardrails, createDefaultPIIGuardrails, createDefaultSafetyGuardrails, createEmailRedactorGuardrail, createHTMLSanitizerInputGuardrail, createHooks, createInputGuardrail, createInputLengthGuardrail, createMaxLengthGuardrail, createNodeId, createOutputGuardrail, createPIIInputGuardrail, createPhoneNumberGuardrail, createProfanityGuardrail, createProfanityInputGuardrail, createPrompt, createPromptInjectionGuardrail, createReasoningTools, createRetrieverTool, createScorer, createSensitiveNumberGuardrail, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };
8537
+ export { A2AServerRegistry, AbortError, Agent, type AgentEvalConfig, type AgentEvalContext, type AgentEvalOperationType, type AgentEvalPayload, type AgentEvalResult, type AgentEvalSamplingPolicy, type AgentEvalScorerConfig, type AgentEvalScorerFactory, type AgentEvalScorerReference, type AgentFullState, type AgentHookOnEnd, type AgentHookOnError, type AgentHookOnHandoff, type AgentHookOnHandoffComplete, type AgentHookOnPrepareMessages, type AgentHookOnPrepareModelMessages, type AgentHookOnStart, type AgentHookOnStepFinish, type AgentHookOnToolEnd, type AgentHookOnToolStart, type AgentHooks, type AgentOptions, AgentRegistry, type AgentResponse, type AgentScorerState, type AgentStatus, type AgentTool, AiSdkEmbeddingAdapter, type AllowedVariableValue, type ApiToolInfo, type BaseEventMetadata, type BaseGenerationOptions, type BaseLLMOptions, type BaseMessage, BaseRetriever, type BaseTool, type BaseToolCall, type BuildScorerOptions, type BuildScorerRunArgs, type BuildScorerRunResult, type BuilderAnalyzeContext, type BuilderPrepareContext, type BuilderReasonContext, type BuilderScoreContext, type CachedPrompt, type ChatMessage, ClientHTTPError, type ClientSideToolResult, type CloudflareFetchHandler, type Conversation, ConversationAlreadyExistsError, ConversationNotFoundError, type ConversationQueryOptions, type ConversationQueryOptions as ConversationQueryOptionsV2, type Conversation as ConversationV2, type CreateConversationInput, type CreateConversationInput as CreateConversationInputV2, type CreateInputGuardrailOptions, type CreateOutputGuardrailOptions, type CreateReasoningToolsOptions, type CreateScorerOptions, 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 GenerateReasonResult, type GenerateScoreResult, type GenerateScoreStep, type GenerateTextOptions, type GenerateTextSubAgentConfig, type GetMessagesOptions, type GuardrailAction, type GuardrailContext, type GuardrailDefinition, type GuardrailFunction, type GuardrailSeverity, type IServerProvider, type IServerlessProvider, 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 InputGuardrail, type InputGuardrailArgs, type InputGuardrailResult, type LLMProvider, LazyRemoteExportProcessor, type LocalScorerDefinition, type LocalScorerExecutionResult, LocalStorageSpanProcessor, type LogFilter, LoggerProxy, MCPConfiguration, type MCPElicitationAdapter, type MCPLoggingAdapter, type MCPPromptsAdapter, type MCPResourcesAdapter, MCPServerRegistry, type ManagedMemoryAddMessageInput, type ManagedMemoryAddMessagesInput, type ManagedMemoryClearMessagesInput, type ManagedMemoryConnectionInfo, type ManagedMemoryConversationsClient, type ManagedMemoryCredentialCreateResult, type ManagedMemoryCredentialListResult, type ManagedMemoryCredentialSummary, type ManagedMemoryDatabaseSummary, type ManagedMemoryGetMessagesInput, type ManagedMemoryMessagesClient, type ManagedMemorySetWorkingMemoryInput, type ManagedMemoryStatus, type ManagedMemoryUpdateConversationInput, type ManagedMemoryVoltOpsClient, type ManagedMemoryWorkflowStateUpdateInput, type ManagedMemoryWorkflowStatesClient, type ManagedMemoryWorkingMemoryClient, type ManagedMemoryWorkingMemoryInput, Memory, type MemoryConfig, type MemoryOptions, type MemoryStorageMetadata, type MemoryUpdateMode, Memory as MemoryV2, MemoryV2Error, type MessageContent, MessageContentBuilder, type MessageRole, type ModelToolCall, NextAction, NodeType, VoltAgentObservability$1 as NodeVoltAgentObservability, type ObservabilityConfig, type ObservabilityLogRecord, type ObservabilitySpan, type ObservabilityStorageAdapter, type ObservabilityWebSocketEvent, type OnEndHookArgs, type OnErrorHookArgs, type OnHandoffCompleteHookArgs, type OnHandoffHookArgs, type OnPrepareMessagesHookArgs, type OnPrepareMessagesHookResult, type OnPrepareModelMessagesHookArgs, type OnPrepareModelMessagesHookResult, type OnStartHookArgs, type OnStepFinishHookArgs, type OnToolEndHookArgs, type OnToolStartHookArgs, type OperationContext, type OutputGuardrail, type OutputGuardrailArgs, type OutputGuardrailResult, 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 ProviderTool, type ReadableStreamType, type ReasoningStep, ReasoningStepSchema, type RegisterOptions, type RegisteredWorkflow, type RemoteLogExportConfig, RemoteLogProcessor, type RetrieveOptions, type Retriever, type RetrieverOptions, type RunLocalScorersArgs, type RunLocalScorersResult, type SamplingMetadata, type SamplingPolicy, type ScorerBuilder, type ScorerContext, type ScorerLifecycleScope, type ScorerPipelineContext, type ScorerReasonContext, type ScorerResult, type SearchOptions, type SearchResult, type ServerAgentResponse, type ServerApiResponse, type ServerProviderDeps, type ServerProviderFactory, type ServerWorkflowResponse, type ServerlessProviderFactory, type ServerlessRemoteEndpointConfig, type ServerlessRemoteExportConfig, type ServerlessRequestHandler, ServerlessVoltAgentObservability, type SpanAttributes, type SpanEvent, type SpanFilterConfig, SpanFilterProcessor, SpanKind, type SpanLink, type SpanStatus, SpanStatusCode, type SpanTreeNode, type StepChunkCallback, type StepFinishCallback, type StepWithContent, type StopWhen, type StorageAdapter, StorageError, StorageLogProcessor, type StoredUIMessage, type StreamObjectFinishResult, type StreamObjectOnFinishCallback, type StreamObjectOptions, type StreamObjectSubAgentConfig, type StreamPart, type StreamTextFinishResult, type StreamTextOnFinishCallback, type StreamTextOptions, type StreamTextSubAgentConfig, type SubAgentConfig, type SubAgentMethod, type SubAgentStateData, type SupervisorConfig, type TemplateVariables, type TimelineEventCoreLevel, type TimelineEventCoreStatus, type TimelineEventCoreType, Tool, type ToolCall, type ToolContext, ToolDeniedError, type ToolErrorInfo, type ToolExecuteOptions, ToolManager, type ToolOptions, type ToolResultOutput, type ToolSchema, type ToolStatus, type ToolStatusInfo, type ToolWithNodeId, type Toolkit, 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, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsTerminalEvalRunStatus, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowStateEntry, type WorkflowStats, type WorkflowStepContext, type WorkflowStepType, type WorkflowTimelineEvent, type WorkingMemoryConfig, type WorkingMemoryScope, type WorkingMemorySummary, type WorkingMemoryUpdateOptions, addTimestampToMessage, andAgent, andAll, andRace, andTap, andThen, andWhen, andWorkflow, appendToMessage, buildRetrieverLogMessage, buildSamplingMetadata, buildScorer, buildSpanTree, checkForUpdates, convertUsage, cosineSimilarity, createDefaultInputSafetyGuardrails, createDefaultPIIGuardrails, createDefaultSafetyGuardrails, createEmailRedactorGuardrail, createHTMLSanitizerInputGuardrail, createHooks, createInputGuardrail, createInputLengthGuardrail, createMaxLengthGuardrail, createNodeId, createOutputGuardrail, createPIIInputGuardrail, createPhoneNumberGuardrail, createProfanityGuardrail, createProfanityInputGuardrail, createPrompt, createPromptInjectionGuardrail, createReasoningTools, createRetrieverTool, createScorer, createSensitiveNumberGuardrail, createSimpleTemplateEngine, createSubagent, createSuspendController, createTool, createToolkit, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };