@1mcp/agent 0.39.0-beta.3 → 0.39.0-beta.5
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/build/admin/assets/{admin-OAuthServicesWorkspace-D_GlqLxL.js → admin-OAuthServicesWorkspace-zhBb8xAF.js} +1 -1
- package/build/admin/assets/{admin-console-CMRxMjQo.js → admin-console-CnUk1QF1.js} +3 -3
- package/build/admin/index.html +1 -1
- package/build/auth/oauthAuthority.d.ts +149 -0
- package/build/auth/oauthAuthority.d.ts.map +1 -0
- package/build/auth/oauthAuthority.js +101 -0
- package/build/auth/oauthAuthority.js.map +1 -0
- package/build/auth/oauthAuthorizationFlow.d.ts +7 -1
- package/build/auth/oauthAuthorizationFlow.d.ts.map +1 -1
- package/build/auth/oauthAuthorizationFlow.js +60 -74
- package/build/auth/oauthAuthorizationFlow.js.map +1 -1
- package/build/auth/oauthEndpointFetch.d.ts +20 -0
- package/build/auth/oauthEndpointFetch.d.ts.map +1 -0
- package/build/auth/oauthEndpointFetch.js +246 -0
- package/build/auth/oauthEndpointFetch.js.map +1 -0
- package/build/auth/sessionTypes.d.ts +1 -1
- package/build/auth/storage/clientSessionRepository.d.ts +19 -0
- package/build/auth/storage/clientSessionRepository.d.ts.map +1 -1
- package/build/auth/storage/clientSessionRepository.js +178 -0
- package/build/auth/storage/clientSessionRepository.js.map +1 -1
- package/build/auth/storage/fileStorageService.d.ts +9 -1
- package/build/auth/storage/fileStorageService.d.ts.map +1 -1
- package/build/auth/storage/fileStorageService.js +32 -5
- package/build/auth/storage/fileStorageService.js.map +1 -1
- package/build/auth/storage/inboundOAuthStorage.d.ts +14 -0
- package/build/auth/storage/inboundOAuthStorage.d.ts.map +1 -0
- package/build/auth/storage/inboundOAuthStorage.js +29 -0
- package/build/auth/storage/inboundOAuthStorage.js.map +1 -0
- package/build/auth/storage/nativeCredentialStore.d.ts +44 -0
- package/build/auth/storage/nativeCredentialStore.d.ts.map +1 -0
- package/build/auth/storage/nativeCredentialStore.js +177 -0
- package/build/auth/storage/nativeCredentialStore.js.map +1 -0
- package/build/auth/storage/oauthStorageService.d.ts +8 -1
- package/build/auth/storage/oauthStorageService.d.ts.map +1 -1
- package/build/auth/storage/oauthStorageService.js +69 -47
- package/build/auth/storage/oauthStorageService.js.map +1 -1
- package/build/auth/storage/protectedRecordStorage.d.ts +129 -0
- package/build/auth/storage/protectedRecordStorage.d.ts.map +1 -0
- package/build/auth/storage/protectedRecordStorage.js +1139 -0
- package/build/auth/storage/protectedRecordStorage.js.map +1 -0
- package/build/auth/storage/sessionRepository.d.ts.map +1 -1
- package/build/auth/storage/sessionRepository.js +10 -0
- package/build/auth/storage/sessionRepository.js.map +1 -1
- package/build/auth/storage/upstreamOAuthStorage.d.ts +15 -0
- package/build/auth/storage/upstreamOAuthStorage.d.ts.map +1 -0
- package/build/auth/storage/upstreamOAuthStorage.js +25 -0
- package/build/auth/storage/upstreamOAuthStorage.js.map +1 -0
- package/build/auth/storage/upstreamOAuthStoragePath.d.ts +3 -0
- package/build/auth/storage/upstreamOAuthStoragePath.d.ts.map +1 -0
- package/build/auth/storage/upstreamOAuthStoragePath.js +8 -0
- package/build/auth/storage/upstreamOAuthStoragePath.js.map +1 -0
- package/build/commands/auth/exportOAuthCredentials.d.ts +9 -0
- package/build/commands/auth/exportOAuthCredentials.d.ts.map +1 -0
- package/build/commands/auth/exportOAuthCredentials.js +71 -0
- package/build/commands/auth/exportOAuthCredentials.js.map +1 -0
- package/build/commands/auth/exportUpstreamCredentials.d.ts +5 -0
- package/build/commands/auth/exportUpstreamCredentials.d.ts.map +1 -0
- package/build/commands/auth/exportUpstreamCredentials.js +6 -0
- package/build/commands/auth/exportUpstreamCredentials.js.map +1 -0
- package/build/commands/auth/index.d.ts.map +1 -1
- package/build/commands/auth/index.js +23 -1
- package/build/commands/auth/index.js.map +1 -1
- package/build/commands/inspect/inspectUtils.d.ts.map +1 -1
- package/build/commands/inspect/inspectUtils.js +2 -3
- package/build/commands/inspect/inspectUtils.js.map +1 -1
- package/build/commands/run/runUtils.js +2 -2
- package/build/commands/run/runUtils.js.map +1 -1
- package/build/commands/serve/index.d.ts +5 -0
- package/build/commands/serve/index.d.ts.map +1 -1
- package/build/commands/serve/index.js +5 -0
- package/build/commands/serve/index.js.map +1 -1
- package/build/commands/serve/serveBackground.d.ts.map +1 -1
- package/build/commands/serve/serveBackground.js +1 -0
- package/build/commands/serve/serveBackground.js.map +1 -1
- package/build/config/configLoader.d.ts.map +1 -1
- package/build/config/configLoader.js +13 -0
- package/build/config/configLoader.js.map +1 -1
- package/build/config/configManager.d.ts.map +1 -1
- package/build/config/configManager.js +44 -2
- package/build/config/configManager.js.map +1 -1
- package/build/config/configWatcher.d.ts.map +1 -1
- package/build/config/configWatcher.js +3 -1
- package/build/config/configWatcher.js.map +1 -1
- package/build/config/envProcessor.d.ts.map +1 -1
- package/build/config/envProcessor.js +3 -1
- package/build/config/envProcessor.js.map +1 -1
- package/build/config/mcpConfigManager.d.ts.map +1 -1
- package/build/config/mcpConfigManager.js +4 -1
- package/build/config/mcpConfigManager.js.map +1 -1
- package/build/config/projectConfigLoader.d.ts.map +1 -1
- package/build/config/projectConfigLoader.js +7 -0
- package/build/config/projectConfigLoader.js.map +1 -1
- package/build/constants/mcp.d.ts +1 -1
- package/build/constants/mcp.js +1 -1
- package/build/core/capabilities/asyncLoadingOrchestrator.d.ts.map +1 -1
- package/build/core/capabilities/asyncLoadingOrchestrator.js +31 -2
- package/build/core/capabilities/asyncLoadingOrchestrator.js.map +1 -1
- package/build/core/capabilities/capabilityAggregator.d.ts +3 -1
- package/build/core/capabilities/capabilityAggregator.d.ts.map +1 -1
- package/build/core/capabilities/capabilityAggregator.js +9 -2
- package/build/core/capabilities/capabilityAggregator.js.map +1 -1
- package/build/core/capabilities/capabilityCatalog.d.ts +24 -1
- package/build/core/capabilities/capabilityCatalog.d.ts.map +1 -1
- package/build/core/capabilities/capabilityCatalog.js +410 -39
- package/build/core/capabilities/capabilityCatalog.js.map +1 -1
- package/build/core/capabilities/capabilityPagination.d.ts +18 -1
- package/build/core/capabilities/capabilityPagination.d.ts.map +1 -1
- package/build/core/capabilities/capabilityPagination.js +101 -15
- package/build/core/capabilities/capabilityPagination.js.map +1 -1
- package/build/core/capabilities/capabilityVisibility.d.ts +13 -1
- package/build/core/capabilities/capabilityVisibility.d.ts.map +1 -1
- package/build/core/capabilities/capabilityVisibility.js +24 -1
- package/build/core/capabilities/capabilityVisibility.js.map +1 -1
- package/build/core/capabilities/catalogGeneration.d.ts.map +1 -1
- package/build/core/capabilities/catalogGeneration.js +20 -1
- package/build/core/capabilities/catalogGeneration.js.map +1 -1
- package/build/core/capabilities/configuredToolSnapshot.d.ts +1 -0
- package/build/core/capabilities/configuredToolSnapshot.d.ts.map +1 -1
- package/build/core/capabilities/configuredToolSnapshot.js +30 -4
- package/build/core/capabilities/configuredToolSnapshot.js.map +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts +2 -0
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts.map +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.js +20 -4
- package/build/core/capabilities/lazyLoadingOrchestrator.js.map +1 -1
- package/build/core/capabilities/metaToolProvider.d.ts +3 -1
- package/build/core/capabilities/metaToolProvider.d.ts.map +1 -1
- package/build/core/capabilities/metaToolProvider.js +42 -4
- package/build/core/capabilities/metaToolProvider.js.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts +15 -2
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.js +153 -16
- package/build/core/capabilities/runtimeCapabilityCatalog.js.map +1 -1
- package/build/core/capabilities/schemaCache.d.ts.map +1 -1
- package/build/core/capabilities/schemaCache.js +41 -0
- package/build/core/capabilities/schemaCache.js.map +1 -1
- package/build/core/capabilities/schemas/metaToolSchemas.d.ts +1 -0
- package/build/core/capabilities/schemas/metaToolSchemas.d.ts.map +1 -1
- package/build/core/capabilities/schemas/metaToolSchemas.js +1 -0
- package/build/core/capabilities/schemas/metaToolSchemas.js.map +1 -1
- package/build/core/capabilities/toolRegistry.d.ts +7 -3
- package/build/core/capabilities/toolRegistry.d.ts.map +1 -1
- package/build/core/capabilities/toolRegistry.js +28 -9
- package/build/core/capabilities/toolRegistry.js.map +1 -1
- package/build/core/instructions/instructionAggregator.d.ts.map +1 -1
- package/build/core/instructions/instructionAggregator.js +3 -1
- package/build/core/instructions/instructionAggregator.js.map +1 -1
- package/build/core/instructions/templateTypes.d.ts +1 -1
- package/build/core/instructions/templateTypes.d.ts.map +1 -1
- package/build/core/instructions/templateTypes.js +3 -3
- package/build/core/loading/loadingStateTracker.d.ts.map +1 -1
- package/build/core/loading/loadingStateTracker.js +11 -2
- package/build/core/loading/loadingStateTracker.js.map +1 -1
- package/build/core/loading/mcpLoadingManager.d.ts.map +1 -1
- package/build/core/loading/mcpLoadingManager.js +6 -2
- package/build/core/loading/mcpLoadingManager.js.map +1 -1
- package/build/core/protocol/requestHandlerUtils.d.ts +2 -2
- package/build/core/protocol/requestHandlerUtils.d.ts.map +1 -1
- package/build/core/protocol/requestHandlerUtils.js +7 -4
- package/build/core/protocol/requestHandlerUtils.js.map +1 -1
- package/build/core/server/agentConfig.d.ts +1 -0
- package/build/core/server/agentConfig.d.ts.map +1 -1
- package/build/core/server/agentConfig.js +1 -0
- package/build/core/server/agentConfig.js.map +1 -1
- package/build/core/server/disabledTools.d.ts +1 -1
- package/build/core/server/disabledTools.d.ts.map +1 -1
- package/build/core/server/disabledTools.js +18 -25
- package/build/core/server/disabledTools.js.map +1 -1
- package/build/core/server/processIdentity.d.ts.map +1 -1
- package/build/core/server/processIdentity.js +67 -18
- package/build/core/server/processIdentity.js.map +1 -1
- package/build/core/server/runtimeLaunchIpc.d.ts +14 -1
- package/build/core/server/runtimeLaunchIpc.d.ts.map +1 -1
- package/build/core/server/runtimeReplacementConfig.d.ts +14 -1
- package/build/core/server/runtimeReplacementConfig.d.ts.map +1 -1
- package/build/core/server/toolDescriptionOverrides.d.ts +1 -0
- package/build/core/server/toolDescriptionOverrides.d.ts.map +1 -1
- package/build/core/server/toolDescriptionOverrides.js +30 -5
- package/build/core/server/toolDescriptionOverrides.js.map +1 -1
- package/build/core/tools/handlers/serverManagementHandler.d.ts +21 -0
- package/build/core/tools/handlers/serverManagementHandler.d.ts.map +1 -1
- package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts +3 -0
- package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts.map +1 -1
- package/build/core/tools/internal/schemas/discovery.d.ts +1 -1
- package/build/core/tools/internal/schemas/index.d.ts +1 -1
- package/build/core/types/transport.d.ts +25 -2
- package/build/core/types/transport.d.ts.map +1 -1
- package/build/core/types/transport.js +12 -0
- package/build/core/types/transport.js.map +1 -1
- package/build/domains/admin/configuredToolInventory.d.ts.map +1 -1
- package/build/domains/admin/configuredToolInventory.js +47 -9
- package/build/domains/admin/configuredToolInventory.js.map +1 -1
- package/build/domains/admin/runtimeConfiguredToolInspectionService.d.ts.map +1 -1
- package/build/domains/admin/runtimeConfiguredToolInspectionService.js +13 -3
- package/build/domains/admin/runtimeConfiguredToolInspectionService.js.map +1 -1
- package/build/gateway/adapters/modern/modernInboundEraAdapter.d.ts.map +1 -1
- package/build/gateway/adapters/modern/modernInboundEraAdapter.js +3 -3
- package/build/gateway/adapters/modern/modernInboundEraAdapter.js.map +1 -1
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.d.ts.map +1 -1
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.js +4 -0
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.js.map +1 -1
- package/build/gateway/contracts/gatewayFailure.d.ts +39 -1
- package/build/gateway/contracts/gatewayFailure.d.ts.map +1 -1
- package/build/gateway/contracts/gatewayFailure.js +139 -0
- package/build/gateway/contracts/gatewayFailure.js.map +1 -1
- package/build/gateway/interactions/nativeInputResponses.d.ts +16 -0
- package/build/gateway/interactions/nativeInputResponses.d.ts.map +1 -0
- package/build/gateway/interactions/nativeInputResponses.js +76 -0
- package/build/gateway/interactions/nativeInputResponses.js.map +1 -0
- package/build/gateway/interactions/validateInteractionResponse.d.ts.map +1 -1
- package/build/gateway/interactions/validateInteractionResponse.js +20 -1
- package/build/gateway/interactions/validateInteractionResponse.js.map +1 -1
- package/build/gateway/ports/outboundEraAdapter.d.ts +2 -0
- package/build/gateway/ports/outboundEraAdapter.d.ts.map +1 -1
- package/build/logger/diagnosticRedaction.d.ts +3 -0
- package/build/logger/diagnosticRedaction.d.ts.map +1 -0
- package/build/logger/diagnosticRedaction.js +12 -0
- package/build/logger/diagnosticRedaction.js.map +1 -0
- package/build/logger/httpDiagnostics.d.ts +25 -0
- package/build/logger/httpDiagnostics.d.ts.map +1 -0
- package/build/logger/httpDiagnostics.js +125 -0
- package/build/logger/httpDiagnostics.js.map +1 -0
- package/build/logger/localDiagnosticRecord.d.ts +11 -0
- package/build/logger/localDiagnosticRecord.d.ts.map +1 -0
- package/build/logger/localDiagnosticRecord.js +9 -0
- package/build/logger/localDiagnosticRecord.js.map +1 -0
- package/build/logger/localDiagnostics.d.ts +5 -0
- package/build/logger/localDiagnostics.d.ts.map +1 -0
- package/build/logger/localDiagnostics.js +116 -0
- package/build/logger/localDiagnostics.js.map +1 -0
- package/build/logger/logger.d.ts +7 -0
- package/build/logger/logger.d.ts.map +1 -1
- package/build/logger/logger.js +14 -0
- package/build/logger/logger.js.map +1 -1
- package/build/observability/events/registry.d.ts +163 -49
- package/build/observability/events/registry.d.ts.map +1 -1
- package/build/observability/events/registry.js +136 -49
- package/build/observability/events/registry.js.map +1 -1
- package/build/observability/privacy/fields.d.ts +3 -1
- package/build/observability/privacy/fields.d.ts.map +1 -1
- package/build/observability/privacy/fields.js +23 -0
- package/build/observability/privacy/fields.js.map +1 -1
- package/build/sdk/contracts/catalogCoverageInvalidation.d.ts +4 -0
- package/build/sdk/contracts/catalogCoverageInvalidation.d.ts.map +1 -0
- package/build/sdk/contracts/catalogCoverageInvalidation.js +13 -0
- package/build/sdk/contracts/catalogCoverageInvalidation.js.map +1 -0
- package/build/sdk/contracts/mcpParamHeaders.d.ts +17 -0
- package/build/sdk/contracts/mcpParamHeaders.d.ts.map +1 -0
- package/build/sdk/contracts/mcpParamHeaders.js +134 -0
- package/build/sdk/contracts/mcpParamHeaders.js.map +1 -0
- package/build/sdk/contracts/requestProgress.d.ts +29 -0
- package/build/sdk/contracts/requestProgress.d.ts.map +1 -0
- package/build/sdk/contracts/requestProgress.js +126 -0
- package/build/sdk/contracts/requestProgress.js.map +1 -0
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts +77 -84
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts.map +1 -1
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.js +632 -209
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.js.map +1 -1
- package/build/sdk/legacy/auth/sdkOAuthServerProvider.d.ts.map +1 -1
- package/build/sdk/legacy/auth/sdkOAuthServerProvider.js +25 -7
- package/build/sdk/legacy/auth/sdkOAuthServerProvider.js.map +1 -1
- package/build/sdk/legacy/client/runtime/clientManager.d.ts +5 -1
- package/build/sdk/legacy/client/runtime/clientManager.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/clientManager.js +213 -6
- package/build/sdk/legacy/client/runtime/clientManager.js.map +1 -1
- package/build/sdk/legacy/client/runtime/connectionHandler.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/connectionHandler.js +72 -4
- package/build/sdk/legacy/client/runtime/connectionHandler.js.map +1 -1
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.d.ts +2 -1
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.js +11 -2
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.js.map +1 -1
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js +28 -2
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js.map +1 -1
- package/build/sdk/legacy/client/runtime/mcpParamHeaders.d.ts +2 -0
- package/build/sdk/legacy/client/runtime/mcpParamHeaders.d.ts.map +1 -0
- package/build/sdk/legacy/client/runtime/mcpParamHeaders.js +2 -0
- package/build/sdk/legacy/client/runtime/mcpParamHeaders.js.map +1 -0
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts +6 -0
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js +117 -6
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js.map +1 -1
- package/build/sdk/legacy/client/runtime/oauthFlowHandler.d.ts +1 -1
- package/build/sdk/legacy/client/runtime/oauthFlowHandler.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/oauthFlowHandler.js +68 -16
- package/build/sdk/legacy/client/runtime/oauthFlowHandler.js.map +1 -1
- package/build/sdk/legacy/client/runtime/serveClient.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/serveClient.js +3 -0
- package/build/sdk/legacy/client/runtime/serveClient.js.map +1 -1
- package/build/sdk/legacy/client/runtime/transportRecreator.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/transportRecreator.js +9 -4
- package/build/sdk/legacy/client/runtime/transportRecreator.js.map +1 -1
- package/build/sdk/legacy/commands/serve.d.ts +1 -0
- package/build/sdk/legacy/commands/serve.d.ts.map +1 -1
- package/build/sdk/legacy/commands/serve.js +28 -2
- package/build/sdk/legacy/commands/serve.js.map +1 -1
- package/build/sdk/legacy/server/protocol/notificationHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/notificationHandlers.js +2 -6
- package/build/sdk/legacy/server/protocol/notificationHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.d.ts +1 -1
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.js +31 -11
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.js.map +1 -1
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.js +4 -4
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/requestInteractionScope.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/requestInteractionScope.js +62 -10
- package/build/sdk/legacy/server/protocol/requestInteractionScope.js.map +1 -1
- package/build/sdk/legacy/server/protocol/requestProviderProgress.d.ts +8 -0
- package/build/sdk/legacy/server/protocol/requestProviderProgress.d.ts.map +1 -0
- package/build/sdk/legacy/server/protocol/requestProviderProgress.js +29 -0
- package/build/sdk/legacy/server/protocol/requestProviderProgress.js.map +1 -0
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js +20 -2
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.js +151 -60
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/retained-sdk/LICENSE +21 -0
- package/build/sdk/legacy/server/retained-sdk/provenance.json +17 -0
- package/build/sdk/legacy/server/retained-sdk/streamableHttp.js +160 -0
- package/build/sdk/legacy/server/retained-sdk/webStandardStreamableHttp.js +950 -0
- package/build/sdk/legacy/server/runtime/clientInstancePool.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/clientInstancePool.js +34 -6
- package/build/sdk/legacy/server/runtime/clientInstancePool.js.map +1 -1
- package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.js +4 -2
- package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.js.map +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.js +3 -1
- package/build/sdk/legacy/server/runtime/serverManager.js.map +1 -1
- package/build/sdk/legacy/server/runtime/templateServerManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/templateServerManager.js +32 -7
- package/build/sdk/legacy/server/runtime/templateServerManager.js.map +1 -1
- package/build/sdk/legacy/server/streamableHttp.js +1 -1
- package/build/sdk/legacy/shared/resourceTemplateRouting.d.ts.map +1 -1
- package/build/sdk/legacy/shared/resourceTemplateRouting.js +29 -11
- package/build/sdk/legacy/shared/resourceTemplateRouting.js.map +1 -1
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js +12 -1
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js.map +1 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts +4 -0
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js +11 -0
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js.map +1 -1
- package/build/sdk/legacy/transport/http/server.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/server.js +16 -2
- package/build/sdk/legacy/transport/http/server.js.map +1 -1
- package/build/sdk/legacy/transport/stdioProxyTransport.d.ts.map +1 -1
- package/build/sdk/legacy/transport/stdioProxyTransport.js +4 -1
- package/build/sdk/legacy/transport/stdioProxyTransport.js.map +1 -1
- package/build/sdk/legacy/transport/transportFactory.d.ts.map +1 -1
- package/build/sdk/legacy/transport/transportFactory.js +41 -14
- package/build/sdk/legacy/transport/transportFactory.js.map +1 -1
- package/build/transport/http/middlewares/httpRequestLogger.d.ts +4 -2
- package/build/transport/http/middlewares/httpRequestLogger.d.ts.map +1 -1
- package/build/transport/http/middlewares/httpRequestLogger.js +135 -16
- package/build/transport/http/middlewares/httpRequestLogger.js.map +1 -1
- package/build/transport/http/routes/cliTokenRoute.d.ts.map +1 -1
- package/build/transport/http/routes/cliTokenRoute.js +1 -0
- package/build/transport/http/routes/cliTokenRoute.js.map +1 -1
- package/build/transport/http/routes/healthRoutes.d.ts +11 -1
- package/build/transport/http/routes/healthRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/healthRoutes.js +6 -2
- package/build/transport/http/routes/healthRoutes.js.map +1 -1
- package/build/transport/http/routes/inspectHelpers.d.ts.map +1 -1
- package/build/transport/http/routes/inspectHelpers.js +4 -3
- package/build/transport/http/routes/inspectHelpers.js.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.d.ts +4 -0
- package/build/transport/http/routes/modernHttpRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.js +168 -24
- package/build/transport/http/routes/modernHttpRoutes.js.map +1 -1
- package/build/transport/http/routes/modernInteractionBinding.d.ts +2 -1
- package/build/transport/http/routes/modernInteractionBinding.d.ts.map +1 -1
- package/build/transport/http/routes/modernInteractionBinding.js +7 -4
- package/build/transport/http/routes/modernInteractionBinding.js.map +1 -1
- package/build/transport/http/routes/modernToolHeaderRegistry.d.ts +16 -0
- package/build/transport/http/routes/modernToolHeaderRegistry.d.ts.map +1 -0
- package/build/transport/http/routes/modernToolHeaderRegistry.js +161 -0
- package/build/transport/http/routes/modernToolHeaderRegistry.js.map +1 -0
- package/build/transport/http/routes/oauthRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/oauthRoutes.js +6 -3
- package/build/transport/http/routes/oauthRoutes.js.map +1 -1
- package/build/transport/http/routes/toolRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/toolRoutes.js +18 -2
- package/build/transport/http/routes/toolRoutes.js.map +1 -1
- package/build/transport/sseWireLimit.d.ts +19 -0
- package/build/transport/sseWireLimit.d.ts.map +1 -0
- package/build/transport/sseWireLimit.js +227 -0
- package/build/transport/sseWireLimit.js.map +1 -0
- package/build/utils/core/parsing.d.ts +2 -0
- package/build/utils/core/parsing.d.ts.map +1 -1
- package/build/utils/core/parsing.js +19 -0
- package/build/utils/core/parsing.js.map +1 -1
- package/build/utils/core/resourceUris.d.ts +6 -0
- package/build/utils/core/resourceUris.d.ts.map +1 -0
- package/build/utils/core/resourceUris.js +104 -0
- package/build/utils/core/resourceUris.js.map +1 -0
- package/build/utils/core/toolNames.d.ts +8 -0
- package/build/utils/core/toolNames.d.ts.map +1 -0
- package/build/utils/core/toolNames.js +56 -0
- package/build/utils/core/toolNames.js.map +1 -0
- package/package.json +69 -65
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/** Limits bytes retained by the SSE parser before JSON parsing can allocate a message. */
|
|
2
|
+
export const SSE_WIRE_LIMIT_BYTES = 8 * 1024 * 1024;
|
|
3
|
+
export class SseWireLimitError extends Error {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(`Upstream SSE frame exceeds the ${SSE_WIRE_LIMIT_BYTES}-byte wire limit`);
|
|
6
|
+
this.name = 'SseWireLimitError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Byte-only accounting leaves decoding, fields, and emitted messages to the SDK parser. */
|
|
10
|
+
class SseWireCounter {
|
|
11
|
+
limit;
|
|
12
|
+
lineBytes = 0;
|
|
13
|
+
field = '';
|
|
14
|
+
valueStarted = false;
|
|
15
|
+
dataField = false;
|
|
16
|
+
firstValueByte = false;
|
|
17
|
+
dataBytes = 0;
|
|
18
|
+
dataFields = 0;
|
|
19
|
+
afterCR = false;
|
|
20
|
+
initialBytes = [];
|
|
21
|
+
initial = true;
|
|
22
|
+
constructor(limit) {
|
|
23
|
+
this.limit = limit;
|
|
24
|
+
}
|
|
25
|
+
accept(chunk) {
|
|
26
|
+
for (const byte of chunk) {
|
|
27
|
+
if (this.initial) {
|
|
28
|
+
this.initialBytes.push(byte);
|
|
29
|
+
const bom = [0xef, 0xbb, 0xbf];
|
|
30
|
+
if (byte === bom[this.initialBytes.length - 1]) {
|
|
31
|
+
if (this.initialBytes.length === 3) {
|
|
32
|
+
this.initial = false;
|
|
33
|
+
this.lineBytes = 3;
|
|
34
|
+
if (this.lineBytes > this.limit)
|
|
35
|
+
throw new SseWireLimitError();
|
|
36
|
+
this.initialBytes = [];
|
|
37
|
+
}
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
this.initial = false;
|
|
41
|
+
for (const initialByte of this.initialBytes)
|
|
42
|
+
this.acceptByte(initialByte);
|
|
43
|
+
this.initialBytes = [];
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
this.acceptByte(byte);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
finish() {
|
|
50
|
+
// An incomplete initial BOM is ordinary input, even when EOF splits its bytes.
|
|
51
|
+
for (const byte of this.initialBytes)
|
|
52
|
+
this.acceptByte(byte);
|
|
53
|
+
this.initialBytes = [];
|
|
54
|
+
}
|
|
55
|
+
acceptByte(byte) {
|
|
56
|
+
if (this.afterCR) {
|
|
57
|
+
this.afterCR = false;
|
|
58
|
+
if (byte === 10)
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (byte === 10 || byte === 13) {
|
|
62
|
+
this.endLine();
|
|
63
|
+
this.afterCR = byte === 13;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.lineBytes++;
|
|
67
|
+
if (this.lineBytes > this.limit)
|
|
68
|
+
throw new SseWireLimitError();
|
|
69
|
+
if (!this.valueStarted) {
|
|
70
|
+
if (byte === 58) {
|
|
71
|
+
this.valueStarted = true;
|
|
72
|
+
this.dataField = this.field === 'data';
|
|
73
|
+
this.firstValueByte = true;
|
|
74
|
+
if (this.dataField)
|
|
75
|
+
this.beginDataField();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
// Retain only enough bytes to recognize "data"; arbitrary field names stay bounded.
|
|
79
|
+
if (this.field.length < 5)
|
|
80
|
+
this.field += String.fromCharCode(byte);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (!this.dataField)
|
|
84
|
+
return;
|
|
85
|
+
if (this.firstValueByte) {
|
|
86
|
+
this.firstValueByte = false;
|
|
87
|
+
if (byte === 32)
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.addDataBytes(1);
|
|
91
|
+
}
|
|
92
|
+
beginDataField() {
|
|
93
|
+
if (this.dataFields > 0)
|
|
94
|
+
this.addDataBytes(1); // Parser-inserted LF between data fields.
|
|
95
|
+
this.dataFields++;
|
|
96
|
+
}
|
|
97
|
+
addDataBytes(bytes) {
|
|
98
|
+
this.dataBytes += bytes;
|
|
99
|
+
if (this.dataBytes > this.limit)
|
|
100
|
+
throw new SseWireLimitError();
|
|
101
|
+
}
|
|
102
|
+
endLine() {
|
|
103
|
+
if (this.lineBytes === 0) {
|
|
104
|
+
this.dataBytes = 0;
|
|
105
|
+
this.dataFields = 0;
|
|
106
|
+
}
|
|
107
|
+
else if (!this.valueStarted && this.field === 'data') {
|
|
108
|
+
this.beginDataField(); // A field without a colon has an empty value.
|
|
109
|
+
}
|
|
110
|
+
this.lineBytes = 0;
|
|
111
|
+
this.field = '';
|
|
112
|
+
this.valueStarted = false;
|
|
113
|
+
this.dataField = false;
|
|
114
|
+
this.firstValueByte = false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/** Each transport receives a fresh guard, including when the factory recreates it. */
|
|
118
|
+
export function createSseWireLimitedFetch(fetchImpl, owner, limit = SSE_WIRE_LIMIT_BYTES) {
|
|
119
|
+
let terminalError;
|
|
120
|
+
return async (input, init) => {
|
|
121
|
+
if (terminalError)
|
|
122
|
+
throw terminalError;
|
|
123
|
+
const response = await (fetchImpl ?? fetch)(input, init);
|
|
124
|
+
if (!response.body ||
|
|
125
|
+
response.headers.get('content-type')?.split(';')[0].trim().toLowerCase() !== 'text/event-stream') {
|
|
126
|
+
return response;
|
|
127
|
+
}
|
|
128
|
+
const reader = response.body.getReader();
|
|
129
|
+
let cleanupPromise;
|
|
130
|
+
const cleanup = (reason) => {
|
|
131
|
+
cleanupPromise ??= reader
|
|
132
|
+
.cancel(reason)
|
|
133
|
+
.catch(() => { })
|
|
134
|
+
.finally(() => reader.releaseLock());
|
|
135
|
+
return cleanupPromise;
|
|
136
|
+
};
|
|
137
|
+
const counter = new SseWireCounter(limit);
|
|
138
|
+
const body = new ReadableStream({
|
|
139
|
+
async pull(controller) {
|
|
140
|
+
try {
|
|
141
|
+
const next = await reader.read();
|
|
142
|
+
if (next.done) {
|
|
143
|
+
counter.finish();
|
|
144
|
+
controller.close();
|
|
145
|
+
reader.releaseLock();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
counter.accept(next.value);
|
|
149
|
+
controller.enqueue(next.value);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
// Cancellation can take time; settle the body and transport immediately.
|
|
153
|
+
void cleanup(error);
|
|
154
|
+
if (error instanceof SseWireLimitError && !terminalError) {
|
|
155
|
+
terminalError = error;
|
|
156
|
+
// Report the bounded reason to pending requests, then close before the
|
|
157
|
+
// body error reaches SDK/EventSource reconnect handling.
|
|
158
|
+
const transport = owner();
|
|
159
|
+
failPendingStart(transport, error);
|
|
160
|
+
try {
|
|
161
|
+
transport.onerror?.(error);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// Consumer callbacks cannot prevent cancellation or surface unsafe data.
|
|
165
|
+
}
|
|
166
|
+
void transport.close().catch(() => { });
|
|
167
|
+
}
|
|
168
|
+
controller.error(error);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
async cancel(reason) {
|
|
172
|
+
await cleanup(reason);
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
const boundedResponse = new Response(body, {
|
|
176
|
+
status: response.status,
|
|
177
|
+
statusText: response.statusText,
|
|
178
|
+
headers: response.headers,
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperties(boundedResponse, {
|
|
181
|
+
url: { value: response.url },
|
|
182
|
+
redirected: { value: response.redirected },
|
|
183
|
+
type: { value: response.type },
|
|
184
|
+
});
|
|
185
|
+
return boundedResponse;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
const transportFetchDelegates = new WeakMap();
|
|
189
|
+
function failPendingStart(transport, error) {
|
|
190
|
+
const binding = transportFetchDelegates.get(transport);
|
|
191
|
+
if (!binding)
|
|
192
|
+
return;
|
|
193
|
+
binding.terminalError = error;
|
|
194
|
+
for (const reject of binding.pendingStarts)
|
|
195
|
+
reject(error);
|
|
196
|
+
}
|
|
197
|
+
/** Remember the delegate separately from SDK wrappers and settle a pending SSE handshake. */
|
|
198
|
+
export function registerSseWireLimitOwner(transport, fetchImpl) {
|
|
199
|
+
const binding = { fetch: fetchImpl, pendingStarts: new Set() };
|
|
200
|
+
transportFetchDelegates.set(transport, binding);
|
|
201
|
+
if (!transport.start)
|
|
202
|
+
return;
|
|
203
|
+
const start = transport.start.bind(transport);
|
|
204
|
+
transport.start = async () => {
|
|
205
|
+
if (binding.terminalError)
|
|
206
|
+
throw binding.terminalError;
|
|
207
|
+
let rejectStart;
|
|
208
|
+
const failed = new Promise((_resolve, reject) => {
|
|
209
|
+
rejectStart = reject;
|
|
210
|
+
});
|
|
211
|
+
binding.pendingStarts.add(rejectStart);
|
|
212
|
+
try {
|
|
213
|
+
await Promise.race([start(), failed]);
|
|
214
|
+
}
|
|
215
|
+
finally {
|
|
216
|
+
binding.pendingStarts.delete(rejectStart);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/** Recreate from the trusted delegate rather than the SDK's wrapped private fetch. */
|
|
221
|
+
export function getSseWireLimitBinding(transport) {
|
|
222
|
+
const binding = transportFetchDelegates.get(transport);
|
|
223
|
+
if (!binding)
|
|
224
|
+
return undefined;
|
|
225
|
+
return { fetch: binding.fetch };
|
|
226
|
+
}
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AC,SAAS,CAAC,CAAC;IAC9C,SAAS,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;QAC3B,IAAI,OAAO,CAAC,aAAa;YAAE,MAAM,OAAO,CAAC,aAAa,CAAC;QACvD,IAAI,WAAoC,CAAC;QACzC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YACpD,WAAW,GAAG,MAAM,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvC,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;QACxC,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,sBAAsB,CAAC,SAA4B;IACjE,MAAM,OAAO,GAAG,uBAAuB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -22,4 +22,6 @@ export declare function parseUri(uri: string, separator: string): UriParts;
|
|
|
22
22
|
* @returns The constructed URI
|
|
23
23
|
*/
|
|
24
24
|
export declare function buildUri(clientName: string, resourceName: string, separator: string): string;
|
|
25
|
+
/** Preserve valid public names; compact names that exceed MCP's tool-name limits. */
|
|
26
|
+
export declare function buildToolName(serverName: string, toolName: string): string;
|
|
25
27
|
//# sourceMappingURL=parsing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../../../src/utils/core/parsing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../../../src/utils/core/parsing.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,CA4BjE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAc5F;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAe1E"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { MCP_URI_SEPARATOR } from '../../constants/mcp.js';
|
|
1
3
|
import { InvalidRequestError } from './errorTypes.js';
|
|
2
4
|
/**
|
|
3
5
|
* Extracts client name and resource name from a URI
|
|
@@ -48,4 +50,21 @@ export function buildUri(clientName, resourceName, separator) {
|
|
|
48
50
|
}
|
|
49
51
|
return `${clientName.trim()}${separator}${resourceName.trim()}`;
|
|
50
52
|
}
|
|
53
|
+
/** Preserve valid public names; compact names that exceed MCP's tool-name limits. */
|
|
54
|
+
export function buildToolName(serverName, toolName) {
|
|
55
|
+
const qualified = buildUri(serverName, toolName, MCP_URI_SEPARATOR);
|
|
56
|
+
if (qualified.length <= 64 && /^[A-Za-z0-9_./-]+$/.test(qualified))
|
|
57
|
+
return qualified;
|
|
58
|
+
// Hash the structured source tuple, not an ambiguous concatenated identity.
|
|
59
|
+
// Connection IDs and catalog generations must not change consumer references.
|
|
60
|
+
const digest = createHash('sha256')
|
|
61
|
+
.update(JSON.stringify([serverName, toolName]))
|
|
62
|
+
.digest('hex')
|
|
63
|
+
.slice(0, 40);
|
|
64
|
+
const serverPrefix = serverName
|
|
65
|
+
.trim()
|
|
66
|
+
.replace(/[^A-Za-z0-9_./-]/g, '_')
|
|
67
|
+
.slice(0, 18);
|
|
68
|
+
return `${serverPrefix}${MCP_URI_SEPARATOR}${digest}`;
|
|
69
|
+
}
|
|
51
70
|
//# sourceMappingURL=parsing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsing.js","sourceRoot":"","sources":["../../../src/utils/core/parsing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAUtD;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,SAAiB;IACrD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,IAAI,mBAAmB,CAAC,gCAAgC,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,IAAI,mBAAmB,CAAC,sCAAsC,CAAC,CAAC;IACxE,CAAC;IAED,kDAAkD;IAClD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAEtC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,mBAAmB,CAAC,0CAA0C,SAAS,SAAS,GAAG,GAAG,CAAC,CAAC;IACpG,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAE9E,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,CAAC;IACjE,CAAC;IAED,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,IAAI,mBAAmB,CAAC,sCAAsC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,GAAG,SAAS,GAAG,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;AAClE,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,aAAa,CAAC,UAAkB,EAAE,QAAgB;IAChE,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACpE,IAAI,SAAS,CAAC,MAAM,IAAI,EAAE,IAAI,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IAErF,4EAA4E;IAC5E,8EAA8E;IAC9E,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC;SAChC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;SAC9C,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,MAAM,YAAY,GAAG,UAAU;SAC5B,IAAI,EAAE;SACN,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC;SACjC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,OAAO,GAAG,YAAY,GAAG,iBAAiB,GAAG,MAAM,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isValidResourceUri(value: string): boolean;
|
|
2
|
+
/** RFC6570 sections 1.5 and 2; percent-encoded variable names are preserved, never decoded. */
|
|
3
|
+
export declare function isValidResourceTemplate(value: string): boolean;
|
|
4
|
+
export declare function buildPublicResourceUri(server: string, upstreamIdentity: string): string;
|
|
5
|
+
export declare function buildPublicResourceTemplate(server: string, upstreamIdentity: string): string;
|
|
6
|
+
//# sourceMappingURL=resourceUris.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceUris.d.ts","sourceRoot":"","sources":["../../../src/utils/core/resourceUris.ts"],"names":[],"mappings":"AAkCA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIzD;AAED,+FAA+F;AAC/F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAoB9D;AAkCD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAQ5F"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { MCP_URI_SEPARATOR } from '../../constants/mcp.js';
|
|
3
|
+
import addFormats from 'ajv-formats';
|
|
4
|
+
import { InvalidRequestError } from './errorTypes.js';
|
|
5
|
+
import { buildUri } from './parsing.js';
|
|
6
|
+
const uriFormat = addFormats.default.get('uri', 'full');
|
|
7
|
+
// ajv-formats omits RFC3986 path-empty and RFC6570 dotted variable names.
|
|
8
|
+
const queryOrFragment = "(?:[A-Za-z0-9._~!$&'()*+,;=:@/?-]|%[A-Fa-f0-9]{2})*";
|
|
9
|
+
const pathEmptyUri = new RegExp(`^[A-Za-z][A-Za-z0-9+.-]*:(?:\\?${queryOrFragment})?(?:#${queryOrFragment})?$`, 'u');
|
|
10
|
+
const varchar = '(?:[A-Za-z0-9_]|%[A-Fa-f0-9]{2})';
|
|
11
|
+
const varname = `${varchar}(?:\\.?${varchar})*`;
|
|
12
|
+
const varspec = `${varname}(?::[1-9][0-9]{0,3}|\\*)?`;
|
|
13
|
+
const expression = new RegExp(`^[+#./;?&=,!@|]?${varspec}(?:,${varspec})*$`, 'u');
|
|
14
|
+
function hasOnlyUnicodeScalars(value) {
|
|
15
|
+
return Array.from(value).every((character) => {
|
|
16
|
+
const point = character.codePointAt(0);
|
|
17
|
+
return point < 0xd800 || point > 0xdfff;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function hasUriCharacters(value) {
|
|
21
|
+
if (!value)
|
|
22
|
+
return false;
|
|
23
|
+
for (const character of value) {
|
|
24
|
+
const point = character.codePointAt(0);
|
|
25
|
+
if (point <= 0x20 || point === 0x7f)
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return hasOnlyUnicodeScalars(value);
|
|
29
|
+
}
|
|
30
|
+
export function isValidResourceUri(value) {
|
|
31
|
+
if (!hasUriCharacters(value))
|
|
32
|
+
return false;
|
|
33
|
+
if (typeof uriFormat === 'function' && uriFormat(value) === true)
|
|
34
|
+
return true;
|
|
35
|
+
return pathEmptyUri.test(value);
|
|
36
|
+
}
|
|
37
|
+
/** RFC6570 sections 1.5 and 2; percent-encoded variable names are preserved, never decoded. */
|
|
38
|
+
export function isValidResourceTemplate(value) {
|
|
39
|
+
if (!hasUriCharacters(value))
|
|
40
|
+
return false;
|
|
41
|
+
let offset = 0;
|
|
42
|
+
while (offset < value.length) {
|
|
43
|
+
const character = String.fromCodePoint(value.codePointAt(offset));
|
|
44
|
+
if (character === '{') {
|
|
45
|
+
const close = value.indexOf('}', offset + 1);
|
|
46
|
+
if (close < 0 || !expression.test(value.slice(offset + 1, close)))
|
|
47
|
+
return false;
|
|
48
|
+
offset = close + 1;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (character === '%') {
|
|
52
|
+
if (!/^[A-Fa-f0-9]{2}$/u.test(value.slice(offset + 1, offset + 3)))
|
|
53
|
+
return false;
|
|
54
|
+
offset += 3;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (!isTemplateLiteral(character))
|
|
58
|
+
return false;
|
|
59
|
+
offset += character.length;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
function isTemplateLiteral(character) {
|
|
64
|
+
const point = character.codePointAt(0);
|
|
65
|
+
if (point <= 0x7e)
|
|
66
|
+
return !/["'<>%\\^`{|}]/u.test(character);
|
|
67
|
+
if (point >= 0xa0 && point <= 0xd7ff)
|
|
68
|
+
return true;
|
|
69
|
+
if (point >= 0xe000 && point <= 0xfdcf)
|
|
70
|
+
return true;
|
|
71
|
+
if (point >= 0xfdf0 && point <= 0xffef)
|
|
72
|
+
return true;
|
|
73
|
+
if ((point & 0xffff) > 0xfffd)
|
|
74
|
+
return false;
|
|
75
|
+
if (point >= 0x10000 && point <= 0xdfffd)
|
|
76
|
+
return true;
|
|
77
|
+
if (point >= 0xe1000 && point <= 0xefffd)
|
|
78
|
+
return true;
|
|
79
|
+
return point >= 0xf0000 && point <= 0x10fffd;
|
|
80
|
+
}
|
|
81
|
+
function projectResourceIdentity(server, upstreamIdentity, valid, preserveLegacy = valid) {
|
|
82
|
+
if (!valid(upstreamIdentity))
|
|
83
|
+
throw new InvalidRequestError('Unsupported upstream resource identity');
|
|
84
|
+
const canonical = buildUri(server, upstreamIdentity, MCP_URI_SEPARATOR);
|
|
85
|
+
if (!hasOnlyUnicodeScalars(canonical))
|
|
86
|
+
throw new InvalidRequestError('Invalid resource server identity');
|
|
87
|
+
if (preserveLegacy(canonical))
|
|
88
|
+
return canonical;
|
|
89
|
+
// Extending the scheme keeps the complete source URI/template suffix in its original component positions.
|
|
90
|
+
// All resource kinds share one server prefix; sessions, backend instances and reloads do not change it.
|
|
91
|
+
const hash = createHash('sha256')
|
|
92
|
+
.update(JSON.stringify([server.trim()]))
|
|
93
|
+
.digest('hex')
|
|
94
|
+
.slice(0, 16);
|
|
95
|
+
return `mcp+1mcp.${hash}+${upstreamIdentity}`;
|
|
96
|
+
}
|
|
97
|
+
export function buildPublicResourceUri(server, upstreamIdentity) {
|
|
98
|
+
return projectResourceIdentity(server, upstreamIdentity, isValidResourceUri);
|
|
99
|
+
}
|
|
100
|
+
export function buildPublicResourceTemplate(server, upstreamIdentity) {
|
|
101
|
+
// RFC6570 permits variable schemes and relative references. Concrete resource reads still require absolute URIs.
|
|
102
|
+
return projectResourceIdentity(server, upstreamIdentity, isValidResourceTemplate, (canonical) => isValidResourceUri(`${server.trim()}${MCP_URI_SEPARATOR}`) && isValidResourceTemplate(canonical));
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=resourceUris.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceUris.js","sourceRoot":"","sources":["../../../src/utils/core/resourceUris.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACxD,0EAA0E;AAC1E,MAAM,eAAe,GAAG,qDAAqD,CAAC;AAC9E,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,kCAAkC,eAAe,SAAS,eAAe,KAAK,EAAE,GAAG,CAAC,CAAC;AACrH,MAAM,OAAO,GAAG,kCAAkC,CAAC;AACnD,MAAM,OAAO,GAAG,GAAG,OAAO,UAAU,OAAO,IAAI,CAAC;AAChD,MAAM,OAAO,GAAG,GAAG,OAAO,2BAA2B,CAAC;AACtD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,mBAAmB,OAAO,OAAO,OAAO,KAAK,EAAE,GAAG,CAAC,CAAC;AAElF,SAAS,qBAAqB,CAAC,KAAa;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,C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iB,EAAE,CAAC,IAAI,uBAAuB,CAAC,SAAS,CAAC,CAChH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function isValidPublicToolName(name: string): boolean;
|
|
2
|
+
/** Public names are display identities; only the catalog's exact route grants routing authority. */
|
|
3
|
+
export declare function buildPublicToolName(server: string, upstreamIdentity: string): string;
|
|
4
|
+
/** Configuration may reference an exact source name, its historical qualified name, or its current public name. */
|
|
5
|
+
export declare function getSourceToolConfigReferences(server: string, upstreamIdentity: string): readonly string[];
|
|
6
|
+
/** Config-only edits retain opaque public references while supporting historical qualified inputs. */
|
|
7
|
+
export declare function matchesToolConfigReference(server: string, requested: string, configured: string): boolean;
|
|
8
|
+
//# sourceMappingURL=toolNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolNames.d.ts","sourceRoot":"","sources":["../../../src/utils/core/toolNames.ts"],"names":[],"mappings":"AAOA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAI3D;AAED,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CASpF;AAED,mHAAmH;AACnH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAMzG;AAED,sGAAsG;AACtG,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAGzG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MCP_URI_SEPARATOR } from '../../constants/mcp.js';
|
|
2
|
+
import { InvalidRequestError } from './errorTypes.js';
|
|
3
|
+
import { buildToolName, buildUri } from './parsing.js';
|
|
4
|
+
const MAX_PUBLIC_TOOL_NAME_LENGTH = 64;
|
|
5
|
+
export function isValidPublicToolName(name) {
|
|
6
|
+
if (!name.length)
|
|
7
|
+
return false;
|
|
8
|
+
if (name.length > MAX_PUBLIC_TOOL_NAME_LENGTH)
|
|
9
|
+
return false;
|
|
10
|
+
return !/[^A-Za-z0-9_./-]/u.test(name);
|
|
11
|
+
}
|
|
12
|
+
/** Public names are display identities; only the catalog's exact route grants routing authority. */
|
|
13
|
+
export function buildPublicToolName(server, upstreamIdentity) {
|
|
14
|
+
const canonical = buildUri(server, upstreamIdentity, MCP_URI_SEPARATOR);
|
|
15
|
+
for (const character of canonical) {
|
|
16
|
+
const point = character.codePointAt(0);
|
|
17
|
+
if (point >= 0xd800 && point <= 0xdfff) {
|
|
18
|
+
throw new InvalidRequestError('Tool identity must contain only Unicode scalar values');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return buildToolName(server, upstreamIdentity);
|
|
22
|
+
}
|
|
23
|
+
/** Configuration may reference an exact source name, its historical qualified name, or its current public name. */
|
|
24
|
+
export function getSourceToolConfigReferences(server, upstreamIdentity) {
|
|
25
|
+
return [
|
|
26
|
+
upstreamIdentity.trim(),
|
|
27
|
+
buildUri(server, upstreamIdentity, MCP_URI_SEPARATOR),
|
|
28
|
+
buildPublicToolName(server, upstreamIdentity),
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
/** Config-only edits retain opaque public references while supporting historical qualified inputs. */
|
|
32
|
+
export function matchesToolConfigReference(server, requested, configured) {
|
|
33
|
+
if (toolConfigReferenceVariants(server, requested).has(configured))
|
|
34
|
+
return true;
|
|
35
|
+
return toolConfigReferenceVariants(server, configured).has(requested);
|
|
36
|
+
}
|
|
37
|
+
function toolConfigReferenceVariants(server, reference) {
|
|
38
|
+
const normalized = reference.trim();
|
|
39
|
+
const prefix = `${server}${MCP_URI_SEPARATOR}`;
|
|
40
|
+
const legacyRaw = normalized.startsWith(prefix) ? normalized.slice(prefix.length).trim() : normalized;
|
|
41
|
+
const variants = new Set([normalized]);
|
|
42
|
+
for (const sourceName of [normalized, legacyRaw]) {
|
|
43
|
+
if (!sourceName)
|
|
44
|
+
continue;
|
|
45
|
+
variants.add(sourceName);
|
|
46
|
+
variants.add(`${prefix}${sourceName}`);
|
|
47
|
+
try {
|
|
48
|
+
variants.add(buildPublicToolName(server, sourceName));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Invalid config-only references stay opaque and never grant a catalog route.
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return variants;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=toolNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolNames.js","sourceRoot":"","sources":["../../../src/utils/core/toolNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEvC,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC/B,IAAI,IAAI,CAAC,MAAM,GAAG,2BAA2B;QAAE,OAAO,KAAK,CAAC;IAC5D,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,gBAAwB;IAC1E,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACxE,KAAK,MAAM,SAAS,IAAI,SAAS,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC;QACxC,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,EAA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