@voltagent/core 1.2.21 → 1.3.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
@@ -8407,6 +8407,115 @@ declare class MCPServerRegistry<TServer extends MCPServerLike = MCPServerLike> {
8407
8407
  private createAnonymousSlug;
8408
8408
  }
8409
8409
 
8410
+ /**
8411
+ * The action being authorized.
8412
+ * - "discovery": Tool is being listed/discovered (getTools/getToolsets)
8413
+ * - "execution": Tool is being executed (callTool)
8414
+ */
8415
+ type MCPAuthorizationAction = "discovery" | "execution";
8416
+ /**
8417
+ * Minimal context for tool discovery authorization.
8418
+ * Used when full OperationContext is not available (e.g., during getTools).
8419
+ */
8420
+ interface MCPAuthorizationContext {
8421
+ /** User identifier */
8422
+ userId?: string;
8423
+ /** User-defined context map (same as OperationContext.context) */
8424
+ context?: Map<string | symbol, unknown> | Record<string, unknown>;
8425
+ }
8426
+ /**
8427
+ * Parameters passed to the `can` authorization function.
8428
+ */
8429
+ interface MCPCanParams {
8430
+ /** Tool name (without server prefix) */
8431
+ toolName: string;
8432
+ /** Server/resource identifier */
8433
+ serverName: string;
8434
+ /** The action being authorized: "discovery" or "execution" */
8435
+ action: MCPAuthorizationAction;
8436
+ /** Tool arguments (for attribute-based access control) */
8437
+ arguments?: Record<string, unknown>;
8438
+ /** User identifier */
8439
+ userId?: string;
8440
+ /** User-defined context (from authContext or OperationContext) */
8441
+ context?: Map<string | symbol, unknown>;
8442
+ }
8443
+ /**
8444
+ * Result from the `can` authorization function.
8445
+ * Can be a simple boolean or an object with reason.
8446
+ */
8447
+ type MCPCanResult = boolean | {
8448
+ allowed: boolean;
8449
+ reason?: string;
8450
+ };
8451
+ /**
8452
+ * Simple authorization function type.
8453
+ * Return true/false or { allowed: boolean, reason?: string }
8454
+ *
8455
+ * @example
8456
+ * ```typescript
8457
+ * const can: MCPCanFunction = async ({ toolName, action, userId, context }) => {
8458
+ * const roles = context?.get("roles") as string[] ?? [];
8459
+ * // action is "discovery" or "execution"
8460
+ * if (toolName === "delete_item" && !roles.includes("admin")) {
8461
+ * return { allowed: false, reason: "Only admins can delete" };
8462
+ * }
8463
+ * return true;
8464
+ * };
8465
+ * ```
8466
+ */
8467
+ type MCPCanFunction = (params: MCPCanParams) => Promise<MCPCanResult> | MCPCanResult;
8468
+ /**
8469
+ * Authorization configuration for MCPConfiguration.
8470
+ *
8471
+ * @example
8472
+ * ```typescript
8473
+ * const mcp = new MCPConfiguration({
8474
+ * servers: { myServer: { type: "http", url: "..." } },
8475
+ * authorization: {
8476
+ * can: async ({ toolName, action, userId, context }) => {
8477
+ * const roles = context?.get("roles") as string[] ?? [];
8478
+ * // action is "discovery" or "execution"
8479
+ * if (toolName === "admin_tool" && !roles.includes("admin")) {
8480
+ * return { allowed: false, reason: "Admin only" };
8481
+ * }
8482
+ * return true;
8483
+ * },
8484
+ * filterOnDiscovery: true,
8485
+ * },
8486
+ * });
8487
+ * ```
8488
+ */
8489
+ interface MCPAuthorizationConfig {
8490
+ /**
8491
+ * Authorization function to check if a tool can be accessed.
8492
+ * Called for both discovery and execution based on config options.
8493
+ */
8494
+ can: MCPCanFunction;
8495
+ /**
8496
+ * Whether to filter tools on discovery (getTools/getToolsets).
8497
+ * When true, unauthorized tools are hidden from the tool list.
8498
+ * @default false
8499
+ */
8500
+ filterOnDiscovery?: boolean;
8501
+ /**
8502
+ * Whether to check authorization on execution (callTool).
8503
+ * When true, each tool call is verified before execution.
8504
+ * @default true
8505
+ */
8506
+ checkOnExecution?: boolean;
8507
+ }
8508
+
8509
+ /**
8510
+ * Error thrown when MCP tool authorization is denied.
8511
+ */
8512
+ declare class MCPAuthorizationError extends Error {
8513
+ readonly toolName: string;
8514
+ readonly serverName: string;
8515
+ readonly reason?: string;
8516
+ constructor(toolName: string, serverName: string, reason?: string);
8517
+ }
8518
+
8410
8519
  /**
8411
8520
  * Client information for MCP
8412
8521
  */
@@ -8628,6 +8737,40 @@ type ToolsetWithTools = Record<string, AnyToolConfig> & {
8628
8737
  * Any tool configuration
8629
8738
  */
8630
8739
  type AnyToolConfig = Tool<any>;
8740
+ /**
8741
+ * Options for MCPConfiguration constructor.
8742
+ */
8743
+ interface MCPConfigurationOptions<TServerKeys extends string = string> {
8744
+ /**
8745
+ * Map of server configurations keyed by server names.
8746
+ */
8747
+ servers: Record<TServerKeys, MCPServerConfig>;
8748
+ /**
8749
+ * Optional authorization configuration for tool access control.
8750
+ */
8751
+ authorization?: MCPAuthorizationConfig;
8752
+ }
8753
+ /**
8754
+ * Options for MCPClient.callTool method with authorization support.
8755
+ */
8756
+ interface MCPClientCallOptions {
8757
+ /**
8758
+ * Full operation context for authorization (from agent execution).
8759
+ */
8760
+ operationContext?: OperationContext;
8761
+ /**
8762
+ * Authorization function.
8763
+ */
8764
+ canFunction?: MCPCanFunction;
8765
+ /**
8766
+ * Authorization config settings.
8767
+ */
8768
+ authorizationConfig?: MCPAuthorizationConfig;
8769
+ /**
8770
+ * Server name for authorization context.
8771
+ */
8772
+ serverName?: string;
8773
+ }
8631
8774
 
8632
8775
  /**
8633
8776
  * Client for interacting with Model Context Protocol (MCP) servers.
@@ -8707,15 +8850,17 @@ declare class MCPClient extends SimpleEventEmitter {
8707
8850
  /**
8708
8851
  * Builds executable Tool objects from the server's tool definitions.
8709
8852
  * These tools include an `execute` method for calling the remote tool.
8853
+ * @param options - Optional call options including authorization context.
8710
8854
  * @returns A record mapping namespaced tool names (`clientName_toolName`) to executable Tool objects.
8711
8855
  */
8712
- getAgentTools(): Promise<Record<string, Tool<any>>>;
8856
+ getAgentTools(options?: MCPClientCallOptions): Promise<Record<string, Tool<any>>>;
8713
8857
  /**
8714
8858
  * Executes a specified tool on the remote MCP server.
8715
8859
  * @param toolCall Details of the tool to call, including name and arguments.
8860
+ * @param options Optional call options including authorization context.
8716
8861
  * @returns The result content returned by the tool.
8717
8862
  */
8718
- callTool(toolCall: MCPToolCall): Promise<MCPToolResult>;
8863
+ callTool(toolCall: MCPToolCall, options?: MCPClientCallOptions): Promise<MCPToolResult>;
8719
8864
  /**
8720
8865
  * Retrieves a list of resource identifiers available on the server.
8721
8866
  * @returns A promise resolving to an array of resource ID strings.
@@ -8782,13 +8927,15 @@ declare class MCPConfiguration<TServerKeys extends string = string> {
8782
8927
  * Map of connected MCP clients keyed by server names (local cache).
8783
8928
  */
8784
8929
  private readonly mcpClientsById;
8930
+ /**
8931
+ * Authorization configuration for tool access control.
8932
+ */
8933
+ private readonly authorizationConfig?;
8785
8934
  /**
8786
8935
  * Creates a new, independent MCP configuration instance.
8787
- * @param options Configuration options including server definitions.
8936
+ * @param options Configuration options including server definitions and optional authorization.
8788
8937
  */
8789
- constructor(options: {
8790
- servers: Record<TServerKeys, MCPServerConfig>;
8791
- });
8938
+ constructor(options: MCPConfigurationOptions<TServerKeys>);
8792
8939
  /**
8793
8940
  * Type guard to check if an object conforms to the basic structure of AnyToolConfig.
8794
8941
  */
@@ -8799,9 +8946,22 @@ declare class MCPConfiguration<TServerKeys extends string = string> {
8799
8946
  disconnect(): Promise<void>;
8800
8947
  /**
8801
8948
  * Retrieves agent-ready tools from all configured MCP servers for this instance.
8949
+ * @param authContext - Optional authorization context for filtering tools.
8802
8950
  * @returns A flat array of all agent-ready tools.
8803
8951
  */
8804
- getTools(): Promise<Tool<any>[]>;
8952
+ getTools(authContext?: MCPAuthorizationContext): Promise<Tool<any>[]>;
8953
+ /**
8954
+ * Checks if the can authorization function is configured.
8955
+ */
8956
+ private hasAuthorizationHandler;
8957
+ /**
8958
+ * Creates call options for MCPClient methods with authorization context.
8959
+ */
8960
+ private createClientCallOptions;
8961
+ /**
8962
+ * Filters tools based on authorization using the `can` function.
8963
+ */
8964
+ private filterToolsByAuthorization;
8805
8965
  /**
8806
8966
  * Retrieves raw tool definitions from all configured MCP servers for this instance.
8807
8967
  * @returns A flat record of all raw tools keyed by their namespaced name.
@@ -10678,4 +10838,4 @@ declare class VoltAgent {
10678
10838
  */
10679
10839
  declare function convertUsage(usage: LanguageModelUsage | undefined): UsageInfo | undefined;
10680
10840
 
10681
- 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 ConversationStepRecord, type ConversationStepType, 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 GetConversationStepsOptions, 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 ManagedMemoryQueryWorkflowRunsInput, 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 RegisteredTrigger, 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, TRIGGER_CONTEXT_KEY, 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 TriggerHandler, type TriggerHandlerBody, type TriggerHandlerContext, type TriggerHandlerResponse, type TriggerHandlerResult, type TriggerHandlerReturn, type TriggerHttpMethod, TriggerRegistry, 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 VoltAgentTriggerConfig, type VoltAgentTriggersConfig, type VoltOpsActionExecutionResult, type VoltOpsActionsApi, VoltOpsActionsClient, type VoltOpsActionsTransport, type VoltOpsAirtableCreateRecordParams, type VoltOpsAirtableCredential, type VoltOpsAirtableDeleteRecordParams, type VoltOpsAirtableGetRecordParams, type VoltOpsAirtableListRecordsParams, type VoltOpsAirtableUpdateRecordParams, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsDiscordChannelMessageParams, type VoltOpsDiscordChannelType, type VoltOpsDiscordConfig, type VoltOpsDiscordCreateChannelParams, type VoltOpsDiscordCredential, type VoltOpsDiscordDeleteChannelParams, type VoltOpsDiscordGetChannelParams, type VoltOpsDiscordListChannelsParams, type VoltOpsDiscordListMembersParams, type VoltOpsDiscordListMessagesParams, type VoltOpsDiscordMemberRoleParams, type VoltOpsDiscordReactionParams, type VoltOpsDiscordSendMessageParams, type VoltOpsDiscordSendWebhookMessageParams, type VoltOpsDiscordUpdateChannelParams, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsSlackCredential, type VoltOpsSlackDeleteMessageParams, type VoltOpsSlackPostMessageParams, type VoltOpsSlackSearchMessagesParams, type VoltOpsTerminalEvalRunStatus, type VoltOpsTriggerDefinition, VoltOpsTriggerDefinitions, type VoltOpsTriggerEnvelope, type VoltOpsTriggerGroupMap, type VoltOpsTriggerName, VoltOpsTriggerNames, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowRunQuery, 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, createTriggers, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, defineVoltOpsTrigger, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getVoltOpsTriggerDefinition, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, setWaitUntil, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };
10841
+ 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 ConversationStepRecord, type ConversationStepType, 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 GetConversationStepsOptions, 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, type MCPAuthorizationAction, type MCPAuthorizationConfig, type MCPAuthorizationContext, MCPAuthorizationError, type MCPCanFunction, type MCPCanParams, type MCPCanResult, type MCPClientCallOptions, MCPConfiguration, type MCPConfigurationOptions, 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 ManagedMemoryQueryWorkflowRunsInput, 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 RegisteredTrigger, 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, TRIGGER_CONTEXT_KEY, 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 TriggerHandler, type TriggerHandlerBody, type TriggerHandlerContext, type TriggerHandlerResponse, type TriggerHandlerResult, type TriggerHandlerReturn, type TriggerHttpMethod, TriggerRegistry, 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 VoltAgentTriggerConfig, type VoltAgentTriggersConfig, type VoltOpsActionExecutionResult, type VoltOpsActionsApi, VoltOpsActionsClient, type VoltOpsActionsTransport, type VoltOpsAirtableCreateRecordParams, type VoltOpsAirtableCredential, type VoltOpsAirtableDeleteRecordParams, type VoltOpsAirtableGetRecordParams, type VoltOpsAirtableListRecordsParams, type VoltOpsAirtableUpdateRecordParams, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsDiscordChannelMessageParams, type VoltOpsDiscordChannelType, type VoltOpsDiscordConfig, type VoltOpsDiscordCreateChannelParams, type VoltOpsDiscordCredential, type VoltOpsDiscordDeleteChannelParams, type VoltOpsDiscordGetChannelParams, type VoltOpsDiscordListChannelsParams, type VoltOpsDiscordListMembersParams, type VoltOpsDiscordListMessagesParams, type VoltOpsDiscordMemberRoleParams, type VoltOpsDiscordReactionParams, type VoltOpsDiscordSendMessageParams, type VoltOpsDiscordSendWebhookMessageParams, type VoltOpsDiscordUpdateChannelParams, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsSlackCredential, type VoltOpsSlackDeleteMessageParams, type VoltOpsSlackPostMessageParams, type VoltOpsSlackSearchMessagesParams, type VoltOpsTerminalEvalRunStatus, type VoltOpsTriggerDefinition, VoltOpsTriggerDefinitions, type VoltOpsTriggerEnvelope, type VoltOpsTriggerGroupMap, type VoltOpsTriggerName, VoltOpsTriggerNames, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowRunQuery, 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, createTriggers, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, defineVoltOpsTrigger, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getVoltOpsTriggerDefinition, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, setWaitUntil, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };
package/dist/index.d.ts CHANGED
@@ -8407,6 +8407,115 @@ declare class MCPServerRegistry<TServer extends MCPServerLike = MCPServerLike> {
8407
8407
  private createAnonymousSlug;
8408
8408
  }
8409
8409
 
8410
+ /**
8411
+ * The action being authorized.
8412
+ * - "discovery": Tool is being listed/discovered (getTools/getToolsets)
8413
+ * - "execution": Tool is being executed (callTool)
8414
+ */
8415
+ type MCPAuthorizationAction = "discovery" | "execution";
8416
+ /**
8417
+ * Minimal context for tool discovery authorization.
8418
+ * Used when full OperationContext is not available (e.g., during getTools).
8419
+ */
8420
+ interface MCPAuthorizationContext {
8421
+ /** User identifier */
8422
+ userId?: string;
8423
+ /** User-defined context map (same as OperationContext.context) */
8424
+ context?: Map<string | symbol, unknown> | Record<string, unknown>;
8425
+ }
8426
+ /**
8427
+ * Parameters passed to the `can` authorization function.
8428
+ */
8429
+ interface MCPCanParams {
8430
+ /** Tool name (without server prefix) */
8431
+ toolName: string;
8432
+ /** Server/resource identifier */
8433
+ serverName: string;
8434
+ /** The action being authorized: "discovery" or "execution" */
8435
+ action: MCPAuthorizationAction;
8436
+ /** Tool arguments (for attribute-based access control) */
8437
+ arguments?: Record<string, unknown>;
8438
+ /** User identifier */
8439
+ userId?: string;
8440
+ /** User-defined context (from authContext or OperationContext) */
8441
+ context?: Map<string | symbol, unknown>;
8442
+ }
8443
+ /**
8444
+ * Result from the `can` authorization function.
8445
+ * Can be a simple boolean or an object with reason.
8446
+ */
8447
+ type MCPCanResult = boolean | {
8448
+ allowed: boolean;
8449
+ reason?: string;
8450
+ };
8451
+ /**
8452
+ * Simple authorization function type.
8453
+ * Return true/false or { allowed: boolean, reason?: string }
8454
+ *
8455
+ * @example
8456
+ * ```typescript
8457
+ * const can: MCPCanFunction = async ({ toolName, action, userId, context }) => {
8458
+ * const roles = context?.get("roles") as string[] ?? [];
8459
+ * // action is "discovery" or "execution"
8460
+ * if (toolName === "delete_item" && !roles.includes("admin")) {
8461
+ * return { allowed: false, reason: "Only admins can delete" };
8462
+ * }
8463
+ * return true;
8464
+ * };
8465
+ * ```
8466
+ */
8467
+ type MCPCanFunction = (params: MCPCanParams) => Promise<MCPCanResult> | MCPCanResult;
8468
+ /**
8469
+ * Authorization configuration for MCPConfiguration.
8470
+ *
8471
+ * @example
8472
+ * ```typescript
8473
+ * const mcp = new MCPConfiguration({
8474
+ * servers: { myServer: { type: "http", url: "..." } },
8475
+ * authorization: {
8476
+ * can: async ({ toolName, action, userId, context }) => {
8477
+ * const roles = context?.get("roles") as string[] ?? [];
8478
+ * // action is "discovery" or "execution"
8479
+ * if (toolName === "admin_tool" && !roles.includes("admin")) {
8480
+ * return { allowed: false, reason: "Admin only" };
8481
+ * }
8482
+ * return true;
8483
+ * },
8484
+ * filterOnDiscovery: true,
8485
+ * },
8486
+ * });
8487
+ * ```
8488
+ */
8489
+ interface MCPAuthorizationConfig {
8490
+ /**
8491
+ * Authorization function to check if a tool can be accessed.
8492
+ * Called for both discovery and execution based on config options.
8493
+ */
8494
+ can: MCPCanFunction;
8495
+ /**
8496
+ * Whether to filter tools on discovery (getTools/getToolsets).
8497
+ * When true, unauthorized tools are hidden from the tool list.
8498
+ * @default false
8499
+ */
8500
+ filterOnDiscovery?: boolean;
8501
+ /**
8502
+ * Whether to check authorization on execution (callTool).
8503
+ * When true, each tool call is verified before execution.
8504
+ * @default true
8505
+ */
8506
+ checkOnExecution?: boolean;
8507
+ }
8508
+
8509
+ /**
8510
+ * Error thrown when MCP tool authorization is denied.
8511
+ */
8512
+ declare class MCPAuthorizationError extends Error {
8513
+ readonly toolName: string;
8514
+ readonly serverName: string;
8515
+ readonly reason?: string;
8516
+ constructor(toolName: string, serverName: string, reason?: string);
8517
+ }
8518
+
8410
8519
  /**
8411
8520
  * Client information for MCP
8412
8521
  */
@@ -8628,6 +8737,40 @@ type ToolsetWithTools = Record<string, AnyToolConfig> & {
8628
8737
  * Any tool configuration
8629
8738
  */
8630
8739
  type AnyToolConfig = Tool<any>;
8740
+ /**
8741
+ * Options for MCPConfiguration constructor.
8742
+ */
8743
+ interface MCPConfigurationOptions<TServerKeys extends string = string> {
8744
+ /**
8745
+ * Map of server configurations keyed by server names.
8746
+ */
8747
+ servers: Record<TServerKeys, MCPServerConfig>;
8748
+ /**
8749
+ * Optional authorization configuration for tool access control.
8750
+ */
8751
+ authorization?: MCPAuthorizationConfig;
8752
+ }
8753
+ /**
8754
+ * Options for MCPClient.callTool method with authorization support.
8755
+ */
8756
+ interface MCPClientCallOptions {
8757
+ /**
8758
+ * Full operation context for authorization (from agent execution).
8759
+ */
8760
+ operationContext?: OperationContext;
8761
+ /**
8762
+ * Authorization function.
8763
+ */
8764
+ canFunction?: MCPCanFunction;
8765
+ /**
8766
+ * Authorization config settings.
8767
+ */
8768
+ authorizationConfig?: MCPAuthorizationConfig;
8769
+ /**
8770
+ * Server name for authorization context.
8771
+ */
8772
+ serverName?: string;
8773
+ }
8631
8774
 
8632
8775
  /**
8633
8776
  * Client for interacting with Model Context Protocol (MCP) servers.
@@ -8707,15 +8850,17 @@ declare class MCPClient extends SimpleEventEmitter {
8707
8850
  /**
8708
8851
  * Builds executable Tool objects from the server's tool definitions.
8709
8852
  * These tools include an `execute` method for calling the remote tool.
8853
+ * @param options - Optional call options including authorization context.
8710
8854
  * @returns A record mapping namespaced tool names (`clientName_toolName`) to executable Tool objects.
8711
8855
  */
8712
- getAgentTools(): Promise<Record<string, Tool<any>>>;
8856
+ getAgentTools(options?: MCPClientCallOptions): Promise<Record<string, Tool<any>>>;
8713
8857
  /**
8714
8858
  * Executes a specified tool on the remote MCP server.
8715
8859
  * @param toolCall Details of the tool to call, including name and arguments.
8860
+ * @param options Optional call options including authorization context.
8716
8861
  * @returns The result content returned by the tool.
8717
8862
  */
8718
- callTool(toolCall: MCPToolCall): Promise<MCPToolResult>;
8863
+ callTool(toolCall: MCPToolCall, options?: MCPClientCallOptions): Promise<MCPToolResult>;
8719
8864
  /**
8720
8865
  * Retrieves a list of resource identifiers available on the server.
8721
8866
  * @returns A promise resolving to an array of resource ID strings.
@@ -8782,13 +8927,15 @@ declare class MCPConfiguration<TServerKeys extends string = string> {
8782
8927
  * Map of connected MCP clients keyed by server names (local cache).
8783
8928
  */
8784
8929
  private readonly mcpClientsById;
8930
+ /**
8931
+ * Authorization configuration for tool access control.
8932
+ */
8933
+ private readonly authorizationConfig?;
8785
8934
  /**
8786
8935
  * Creates a new, independent MCP configuration instance.
8787
- * @param options Configuration options including server definitions.
8936
+ * @param options Configuration options including server definitions and optional authorization.
8788
8937
  */
8789
- constructor(options: {
8790
- servers: Record<TServerKeys, MCPServerConfig>;
8791
- });
8938
+ constructor(options: MCPConfigurationOptions<TServerKeys>);
8792
8939
  /**
8793
8940
  * Type guard to check if an object conforms to the basic structure of AnyToolConfig.
8794
8941
  */
@@ -8799,9 +8946,22 @@ declare class MCPConfiguration<TServerKeys extends string = string> {
8799
8946
  disconnect(): Promise<void>;
8800
8947
  /**
8801
8948
  * Retrieves agent-ready tools from all configured MCP servers for this instance.
8949
+ * @param authContext - Optional authorization context for filtering tools.
8802
8950
  * @returns A flat array of all agent-ready tools.
8803
8951
  */
8804
- getTools(): Promise<Tool<any>[]>;
8952
+ getTools(authContext?: MCPAuthorizationContext): Promise<Tool<any>[]>;
8953
+ /**
8954
+ * Checks if the can authorization function is configured.
8955
+ */
8956
+ private hasAuthorizationHandler;
8957
+ /**
8958
+ * Creates call options for MCPClient methods with authorization context.
8959
+ */
8960
+ private createClientCallOptions;
8961
+ /**
8962
+ * Filters tools based on authorization using the `can` function.
8963
+ */
8964
+ private filterToolsByAuthorization;
8805
8965
  /**
8806
8966
  * Retrieves raw tool definitions from all configured MCP servers for this instance.
8807
8967
  * @returns A flat record of all raw tools keyed by their namespaced name.
@@ -10678,4 +10838,4 @@ declare class VoltAgent {
10678
10838
  */
10679
10839
  declare function convertUsage(usage: LanguageModelUsage | undefined): UsageInfo | undefined;
10680
10840
 
10681
- 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 ConversationStepRecord, type ConversationStepType, 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 GetConversationStepsOptions, 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 ManagedMemoryQueryWorkflowRunsInput, 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 RegisteredTrigger, 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, TRIGGER_CONTEXT_KEY, 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 TriggerHandler, type TriggerHandlerBody, type TriggerHandlerContext, type TriggerHandlerResponse, type TriggerHandlerResult, type TriggerHandlerReturn, type TriggerHttpMethod, TriggerRegistry, 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 VoltAgentTriggerConfig, type VoltAgentTriggersConfig, type VoltOpsActionExecutionResult, type VoltOpsActionsApi, VoltOpsActionsClient, type VoltOpsActionsTransport, type VoltOpsAirtableCreateRecordParams, type VoltOpsAirtableCredential, type VoltOpsAirtableDeleteRecordParams, type VoltOpsAirtableGetRecordParams, type VoltOpsAirtableListRecordsParams, type VoltOpsAirtableUpdateRecordParams, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsDiscordChannelMessageParams, type VoltOpsDiscordChannelType, type VoltOpsDiscordConfig, type VoltOpsDiscordCreateChannelParams, type VoltOpsDiscordCredential, type VoltOpsDiscordDeleteChannelParams, type VoltOpsDiscordGetChannelParams, type VoltOpsDiscordListChannelsParams, type VoltOpsDiscordListMembersParams, type VoltOpsDiscordListMessagesParams, type VoltOpsDiscordMemberRoleParams, type VoltOpsDiscordReactionParams, type VoltOpsDiscordSendMessageParams, type VoltOpsDiscordSendWebhookMessageParams, type VoltOpsDiscordUpdateChannelParams, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsSlackCredential, type VoltOpsSlackDeleteMessageParams, type VoltOpsSlackPostMessageParams, type VoltOpsSlackSearchMessagesParams, type VoltOpsTerminalEvalRunStatus, type VoltOpsTriggerDefinition, VoltOpsTriggerDefinitions, type VoltOpsTriggerEnvelope, type VoltOpsTriggerGroupMap, type VoltOpsTriggerName, VoltOpsTriggerNames, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowRunQuery, 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, createTriggers, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, defineVoltOpsTrigger, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getVoltOpsTriggerDefinition, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, setWaitUntil, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };
10841
+ 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 ConversationStepRecord, type ConversationStepType, 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 GetConversationStepsOptions, 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, type MCPAuthorizationAction, type MCPAuthorizationConfig, type MCPAuthorizationContext, MCPAuthorizationError, type MCPCanFunction, type MCPCanParams, type MCPCanResult, type MCPClientCallOptions, MCPConfiguration, type MCPConfigurationOptions, 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 ManagedMemoryQueryWorkflowRunsInput, 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 RegisteredTrigger, 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, TRIGGER_CONTEXT_KEY, 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 TriggerHandler, type TriggerHandlerBody, type TriggerHandlerContext, type TriggerHandlerResponse, type TriggerHandlerResult, type TriggerHandlerReturn, type TriggerHttpMethod, TriggerRegistry, 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 VoltAgentTriggerConfig, type VoltAgentTriggersConfig, type VoltOpsActionExecutionResult, type VoltOpsActionsApi, VoltOpsActionsClient, type VoltOpsActionsTransport, type VoltOpsAirtableCreateRecordParams, type VoltOpsAirtableCredential, type VoltOpsAirtableDeleteRecordParams, type VoltOpsAirtableGetRecordParams, type VoltOpsAirtableListRecordsParams, type VoltOpsAirtableUpdateRecordParams, type VoltOpsAppendEvalRunResultPayload, type VoltOpsAppendEvalRunResultsRequest, VoltOpsClient, type VoltOpsClientOptions, type VoltOpsCompleteEvalRunRequest, type VoltOpsCreateEvalRunRequest, type VoltOpsCreateScorerRequest, type VoltOpsDiscordChannelMessageParams, type VoltOpsDiscordChannelType, type VoltOpsDiscordConfig, type VoltOpsDiscordCreateChannelParams, type VoltOpsDiscordCredential, type VoltOpsDiscordDeleteChannelParams, type VoltOpsDiscordGetChannelParams, type VoltOpsDiscordListChannelsParams, type VoltOpsDiscordListMembersParams, type VoltOpsDiscordListMessagesParams, type VoltOpsDiscordMemberRoleParams, type VoltOpsDiscordReactionParams, type VoltOpsDiscordSendMessageParams, type VoltOpsDiscordSendWebhookMessageParams, type VoltOpsDiscordUpdateChannelParams, type VoltOpsEvalResultStatus, type VoltOpsEvalRunCompletionSummaryPayload, type VoltOpsEvalRunErrorPayload, type VoltOpsEvalRunResultLiveMetadata, type VoltOpsEvalRunResultScorePayload, type VoltOpsEvalRunStatus, type VoltOpsEvalRunSummary, VoltOpsPromptApiClient, type VoltOpsPromptManager, VoltOpsPromptManagerImpl, type VoltOpsScorerSummary, type VoltOpsSlackCredential, type VoltOpsSlackDeleteMessageParams, type VoltOpsSlackPostMessageParams, type VoltOpsSlackSearchMessagesParams, type VoltOpsTerminalEvalRunStatus, type VoltOpsTriggerDefinition, VoltOpsTriggerDefinitions, type VoltOpsTriggerEnvelope, type VoltOpsTriggerGroupMap, type VoltOpsTriggerName, VoltOpsTriggerNames, WebSocketEventEmitter, WebSocketLogProcessor, WebSocketSpanProcessor, type WeightedBlendComponent, type WeightedBlendOptions, type Workflow, type WorkflowConfig, type WorkflowExecutionContext, WorkflowRegistry, type WorkflowRunQuery, 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, createTriggers, createVoltAgentObservability, createVoltOpsClient, createWorkflow, createWorkflowChain, createWorkflowStepNodeId, VoltAgent as default, defineVoltOpsTrigger, extractFileParts, extractImageParts, extractText, extractTextParts, extractWorkflowStepInfo, filterContentParts, getContentLength, getEnvVar, getGlobalLogBuffer, getGlobalLogger, getNodeTypeFromNodeId, getVoltOpsTriggerDefinition, getWorkflowStepNodeType, hasContent, hasFilePart, hasImagePart, hasTextPart, isAbortError, isNodeRuntime, isServerlessRuntime, isStructuredContent, isTextContent, isVoltAgentError, mapMessageContent, messageHelpers, normalizeContent, normalizeScorerResult, normalizeToArray, prependToMessage, readableLogRecordToObservabilityLog, readableSpanToObservabilitySpan, runLocalScorers, safeJsonParse, serializeValueForDebug, setWaitUntil, shouldSample, tool, transformTextContent, updateAllPackages, updateSinglePackage, weightedBlend, zodSchemaToJsonUI };