@voltagent/server-core 2.0.2 → 2.1.1
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -2370,7 +2370,7 @@ declare abstract class BaseServerProvider implements IServerProvider {
|
|
|
2370
2370
|
* Handle graceful shutdown
|
|
2371
2371
|
*/
|
|
2372
2372
|
protected setupGracefulShutdown(): void;
|
|
2373
|
-
|
|
2373
|
+
protected collectFeatureEndpoints(): ServerEndpointSummary[];
|
|
2374
2374
|
}
|
|
2375
2375
|
|
|
2376
2376
|
export { A2AServerLikeWithHandlers, type A2AServerLookupResult, AgentListSchema, AgentParamsSchema, AgentResponseSchema, ApiResponse, type AuthNextAccess, type AuthNextConfig, type AuthNextRoutesConfig, type AuthProvider, type BaseCustomEndpointDefinition, type BaseServerConfig, BaseServerProvider, BasicJsonSchema, type CLIAnnouncement, type CapabilityRecord, CustomEndpointError, type CustomEndpointHandler, DEFAULT_A2A_ROUTE_PREFIX, DEFAULT_A2A_WELL_KNOWN_PREFIX, DEFAULT_CONSOLE_ROUTES, DEFAULT_LEGACY_PUBLIC_ROUTES, DEFAULT_MCP_HTTP_SEGMENT, DEFAULT_MCP_MESSAGES_SEGMENT, DEFAULT_MCP_ROUTE_PREFIX, DEFAULT_MCP_SSE_SEGMENT, DEFAULT_PUBLIC_ROUTES, ErrorSchema, type FilterContext, GenerateOptionsSchema, HttpMethod, type IWebSocket, type JWTAuthOptions, type LogStreamClient, LogStreamManager, type MCPAgentMetadata, type MCPListedTool, type MCPServerCapabilitiesConfig, type MCPServerLike, type MCPServerMetadata, type MCPServerPackageInfo, type MCPServerRemoteInfo, type MCPToolMetadata, type MCPToolOrigin, type MCPWorkflowSummary, MCP_SESSION_QUERY_PARAM, type McpInvokeToolRequest, type McpInvokeToolResponse, type McpPromptDetailResponse, type McpPromptListResponse, type McpResourceDetailResponse, type McpResourceListResponse, type McpResourceTemplateListResponse, type McpRouteOptions, type McpRoutePaths, type McpServerDetailResponse, type McpServerListResponse, type McpServerLookupResult, McpSessionStore, type McpSetLogLevelRequest, type McpSetLogLevelResponse, type McpToolListResponse, ObjectRequestSchema, ObjectResponseSchema, PROTECTED_ROUTES, ParamsSchema, type PortConfig, type ProcessedAgentOptions, type ProtocolConfig, type ProtocolRecord, type ServerEndpointSummary, type ServerProviderConfig, type ServerStartupOptions, StreamObjectEventSchema, StreamTextEventSchema, SubAgentResponseSchema, TextRequestSchema, TextResponseSchema, type TriggerHandlerHttpResponse, type TriggerHttpRequestContext, type WebSocketAdapter, type WebSocketConnectionHandler, type WebSocketConnectionInfo, type WebSocketEventHandlers, type WebSocketMessage, WebSocketRouter, WorkflowCancelRequestSchema, WorkflowCancelResponseSchema, WorkflowExecutionParamsSchema, WorkflowExecutionRequestSchema, WorkflowExecutionResponseSchema, WorkflowListSchema, WorkflowParamsSchema, WorkflowResponseSchema, WorkflowResumeRequestSchema, WorkflowResumeResponseSchema, WorkflowStreamEventSchema, WorkflowSuspendRequestSchema, WorkflowSuspendResponseSchema, buildA2AEndpointPath, buildAgentCardPath, buildMcpRoutePaths, cleanupWebSockets, closeAllObservabilityConnections, colors, createJWT, createSSEHeaders, createSSEResponse, createSSEStream, createWebSocketRouter, createWebSocketServer, executeTriggerHandler, fetchAnnouncements, formatSSE, getLandingPageHTML, getLogsBySpanIdHandler, getLogsByTraceIdHandler, getObservabilityStatusHandler, getPortsToTry, getSpanByIdHandler, getTraceByIdHandler, getTracesHandler, handleCheckUpdates, handleExecuteTool, handleGetMcpPrompt, handleGetMcpResource, handleGetMcpServer, handleInstallUpdates, handleInvokeMcpServerTool, handleListMcpPrompts, handleListMcpResourceTemplates, handleListMcpResources, handleListMcpServerTools, handleListMcpServers, handleListTools, handleObservabilityConnection, handleSetMcpLogLevel, handleWebSocketConnection, hasConsoleAccess, isAuthNextConfig, isDevRequest, jwtAuth, listA2AServers, listMcpServers, lookupA2AServer, lookupMcpServer, normalizeAuthNextConfig, pathMatches, portManager, preferredPorts, printAnnouncements, printServerStartup, processAgentOptions, processWorkflowOptions, queryLogsHandler, requiresAuth, resolveAuthNextAccess, setupObservabilityHandler, setupObservabilityListeners, setupWebSocketUpgrade, showAnnouncements, transformToSSE, validateBaseCustomEndpoint, validateEndpointMethod, validateEndpointPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -2370,7 +2370,7 @@ declare abstract class BaseServerProvider implements IServerProvider {
|
|
|
2370
2370
|
* Handle graceful shutdown
|
|
2371
2371
|
*/
|
|
2372
2372
|
protected setupGracefulShutdown(): void;
|
|
2373
|
-
|
|
2373
|
+
protected collectFeatureEndpoints(): ServerEndpointSummary[];
|
|
2374
2374
|
}
|
|
2375
2375
|
|
|
2376
2376
|
export { A2AServerLikeWithHandlers, type A2AServerLookupResult, AgentListSchema, AgentParamsSchema, AgentResponseSchema, ApiResponse, type AuthNextAccess, type AuthNextConfig, type AuthNextRoutesConfig, type AuthProvider, type BaseCustomEndpointDefinition, type BaseServerConfig, BaseServerProvider, BasicJsonSchema, type CLIAnnouncement, type CapabilityRecord, CustomEndpointError, type CustomEndpointHandler, DEFAULT_A2A_ROUTE_PREFIX, DEFAULT_A2A_WELL_KNOWN_PREFIX, DEFAULT_CONSOLE_ROUTES, DEFAULT_LEGACY_PUBLIC_ROUTES, DEFAULT_MCP_HTTP_SEGMENT, DEFAULT_MCP_MESSAGES_SEGMENT, DEFAULT_MCP_ROUTE_PREFIX, DEFAULT_MCP_SSE_SEGMENT, DEFAULT_PUBLIC_ROUTES, ErrorSchema, type FilterContext, GenerateOptionsSchema, HttpMethod, type IWebSocket, type JWTAuthOptions, type LogStreamClient, LogStreamManager, type MCPAgentMetadata, type MCPListedTool, type MCPServerCapabilitiesConfig, type MCPServerLike, type MCPServerMetadata, type MCPServerPackageInfo, type MCPServerRemoteInfo, type MCPToolMetadata, type MCPToolOrigin, type MCPWorkflowSummary, MCP_SESSION_QUERY_PARAM, type McpInvokeToolRequest, type McpInvokeToolResponse, type McpPromptDetailResponse, type McpPromptListResponse, type McpResourceDetailResponse, type McpResourceListResponse, type McpResourceTemplateListResponse, type McpRouteOptions, type McpRoutePaths, type McpServerDetailResponse, type McpServerListResponse, type McpServerLookupResult, McpSessionStore, type McpSetLogLevelRequest, type McpSetLogLevelResponse, type McpToolListResponse, ObjectRequestSchema, ObjectResponseSchema, PROTECTED_ROUTES, ParamsSchema, type PortConfig, type ProcessedAgentOptions, type ProtocolConfig, type ProtocolRecord, type ServerEndpointSummary, type ServerProviderConfig, type ServerStartupOptions, StreamObjectEventSchema, StreamTextEventSchema, SubAgentResponseSchema, TextRequestSchema, TextResponseSchema, type TriggerHandlerHttpResponse, type TriggerHttpRequestContext, type WebSocketAdapter, type WebSocketConnectionHandler, type WebSocketConnectionInfo, type WebSocketEventHandlers, type WebSocketMessage, WebSocketRouter, WorkflowCancelRequestSchema, WorkflowCancelResponseSchema, WorkflowExecutionParamsSchema, WorkflowExecutionRequestSchema, WorkflowExecutionResponseSchema, WorkflowListSchema, WorkflowParamsSchema, WorkflowResponseSchema, WorkflowResumeRequestSchema, WorkflowResumeResponseSchema, WorkflowStreamEventSchema, WorkflowSuspendRequestSchema, WorkflowSuspendResponseSchema, buildA2AEndpointPath, buildAgentCardPath, buildMcpRoutePaths, cleanupWebSockets, closeAllObservabilityConnections, colors, createJWT, createSSEHeaders, createSSEResponse, createSSEStream, createWebSocketRouter, createWebSocketServer, executeTriggerHandler, fetchAnnouncements, formatSSE, getLandingPageHTML, getLogsBySpanIdHandler, getLogsByTraceIdHandler, getObservabilityStatusHandler, getPortsToTry, getSpanByIdHandler, getTraceByIdHandler, getTracesHandler, handleCheckUpdates, handleExecuteTool, handleGetMcpPrompt, handleGetMcpResource, handleGetMcpServer, handleInstallUpdates, handleInvokeMcpServerTool, handleListMcpPrompts, handleListMcpResourceTemplates, handleListMcpResources, handleListMcpServerTools, handleListMcpServers, handleListTools, handleObservabilityConnection, handleSetMcpLogLevel, handleWebSocketConnection, hasConsoleAccess, isAuthNextConfig, isDevRequest, jwtAuth, listA2AServers, listMcpServers, lookupA2AServer, lookupMcpServer, normalizeAuthNextConfig, pathMatches, portManager, preferredPorts, printAnnouncements, printServerStartup, processAgentOptions, processWorkflowOptions, queryLogsHandler, requiresAuth, resolveAuthNextAccess, setupObservabilityHandler, setupObservabilityListeners, setupWebSocketUpgrade, showAnnouncements, transformToSSE, validateBaseCustomEndpoint, validateEndpointMethod, validateEndpointPath };
|
package/dist/index.js
CHANGED
|
@@ -2955,6 +2955,7 @@ async function handleListTools(deps, logger) {
|
|
|
2955
2955
|
__name(handleListTools, "handleListTools");
|
|
2956
2956
|
async function handleExecuteTool(toolName, body, deps, logger) {
|
|
2957
2957
|
const { input, context } = body || {};
|
|
2958
|
+
const contextMap = context instanceof Map ? context : context && typeof context === "object" ? new Map(Object.entries(context)) : /* @__PURE__ */ new Map();
|
|
2958
2959
|
const lookup = findTool(deps, toolName);
|
|
2959
2960
|
if (!lookup) {
|
|
2960
2961
|
return {
|
|
@@ -2986,14 +2987,12 @@ async function handleExecuteTool(toolName, body, deps, logger) {
|
|
|
2986
2987
|
const executionStart = Date.now();
|
|
2987
2988
|
const abortController = new AbortController();
|
|
2988
2989
|
try {
|
|
2989
|
-
const userId = context?.userId ?? body?.userId;
|
|
2990
|
-
const conversationId = context?.conversationId ?? body?.conversationId;
|
|
2990
|
+
const userId = (context instanceof Map ? context.get("userId") : context?.userId) ?? body?.userId;
|
|
2991
|
+
const conversationId = (context instanceof Map ? context.get("conversationId") : context?.conversationId) ?? body?.conversationId;
|
|
2991
2992
|
const result = await tool.execute(parsedInput, {
|
|
2992
2993
|
userId,
|
|
2993
2994
|
conversationId,
|
|
2994
|
-
context:
|
|
2995
|
-
context && typeof context === "object" ? Object.entries(context) : []
|
|
2996
|
-
),
|
|
2995
|
+
context: contextMap,
|
|
2997
2996
|
systemContext: /* @__PURE__ */ new Map(),
|
|
2998
2997
|
abortController,
|
|
2999
2998
|
toolContext: {
|