@1mcp/agent 0.38.0 → 0.38.2
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-CzXIIHM0.js → admin-OAuthServicesWorkspace-BnEBXa_2.js} +1 -1
- package/build/admin/assets/{admin-console-Mv3xmdoU.js → admin-console-5rVJC_G2.js} +3 -3
- package/build/admin/index.html +1 -1
- package/build/auth/oauthAuthorizationFlow.d.ts +4 -0
- package/build/auth/oauthAuthorizationFlow.d.ts.map +1 -1
- package/build/auth/oauthAuthorizationFlow.js +61 -4
- package/build/auth/oauthAuthorizationFlow.js.map +1 -1
- package/build/auth/storage/authCodeRepository.d.ts +1 -1
- package/build/auth/storage/authRequestRepository.d.ts +1 -1
- package/build/auth/storage/clientSessionRepository.d.ts +1 -1
- package/build/auth/storage/fileStorageService.d.ts +1 -1
- package/build/auth/storage/refreshTokenFamilyRepository.d.ts +1 -1
- package/build/auth/storage/refreshTokenFamilyRepository.js +1 -1
- package/build/auth/storage/sessionRepository.d.ts +1 -1
- package/build/auth/storage/sessionRepository.js +1 -1
- package/build/commands/admin/admin.d.ts +2 -2
- package/build/commands/admin/admin.js +3 -3
- package/build/commands/admin/index.js +1 -1
- package/build/commands/app/consolidate.js +1 -1
- package/build/commands/auth/index.js +1 -1
- package/build/commands/auth/login.js +1 -1
- package/build/commands/auth/runtimeTargetContext.js +1 -1
- package/build/commands/auth/status.js +1 -1
- package/build/commands/inspect/index.js +1 -1
- package/build/commands/inspect/inspect.d.ts +2 -2
- package/build/commands/inspect/inspect.d.ts.map +1 -1
- package/build/commands/inspect/inspect.js +37 -7
- package/build/commands/inspect/inspect.js.map +1 -1
- package/build/commands/inspect/inspectUtils.d.ts +1 -1
- package/build/commands/inspect/inspectUtils.d.ts.map +1 -1
- package/build/commands/inspect/inspectUtils.js +12 -3
- package/build/commands/inspect/inspectUtils.js.map +1 -1
- package/build/commands/instructions/index.js +1 -1
- package/build/commands/instructions/instructions.js +4 -4
- package/build/commands/mcp/enable.d.ts +1 -1
- package/build/commands/mcp/enable.js +2 -2
- package/build/commands/mcp/restart.d.ts +1 -1
- package/build/commands/mcp/restart.js +2 -2
- package/build/commands/mcp/status.d.ts +1 -1
- package/build/commands/mcp/status.js +2 -2
- package/build/commands/mcp/tokens.js +1 -1
- package/build/commands/mcp/tools.d.ts +1 -1
- package/build/commands/mcp/tools.js +1 -1
- package/build/commands/mcp/utils/mcpServerConfig.d.ts +1 -1
- package/build/commands/mcp/utils/mcpServerConfig.js +2 -2
- package/build/commands/preset/edit.js +1 -1
- package/build/commands/preset/interactive.js +1 -1
- package/build/commands/preset/show.js +1 -1
- package/build/commands/preset/test.js +1 -1
- package/build/commands/proxy/proxy.js +1 -1
- package/build/commands/run/index.js +1 -1
- package/build/commands/run/run.d.ts +3 -3
- package/build/commands/run/run.d.ts.map +1 -1
- package/build/commands/run/run.js +14 -8
- package/build/commands/run/run.js.map +1 -1
- package/build/commands/run/upstreamEofGuidance.d.ts +3 -0
- package/build/commands/run/upstreamEofGuidance.d.ts.map +1 -0
- package/build/commands/run/upstreamEofGuidance.js +19 -0
- package/build/commands/run/upstreamEofGuidance.js.map +1 -0
- package/build/commands/serve/legacyRuntimeStop.d.ts +16 -0
- package/build/commands/serve/legacyRuntimeStop.d.ts.map +1 -0
- package/build/commands/serve/legacyRuntimeStop.js +143 -0
- package/build/commands/serve/legacyRuntimeStop.js.map +1 -0
- package/build/commands/serve/serveBackground.d.ts +3 -0
- package/build/commands/serve/serveBackground.d.ts.map +1 -1
- package/build/commands/serve/serveBackground.js +19 -5
- package/build/commands/serve/serveBackground.js.map +1 -1
- package/build/commands/serve/serveStatus.d.ts +2 -1
- package/build/commands/serve/serveStatus.d.ts.map +1 -1
- package/build/commands/serve/serveStatus.js +36 -12
- package/build/commands/serve/serveStatus.js.map +1 -1
- package/build/commands/serve/serveStop.d.ts +2 -1
- package/build/commands/serve/serveStop.d.ts.map +1 -1
- package/build/commands/serve/serveStop.js +137 -20
- package/build/commands/serve/serveStop.js.map +1 -1
- package/build/commands/shared/clientSurfaceAttachment.d.ts +3 -3
- package/build/commands/shared/clientSurfaceAttachment.js +4 -4
- package/build/commands/shared/inspectApiSchemas.d.ts +13 -0
- package/build/commands/shared/inspectApiSchemas.d.ts.map +1 -1
- package/build/commands/shared/inspectApiSchemas.js +18 -0
- package/build/commands/shared/inspectApiSchemas.js.map +1 -1
- package/build/commands/shared/serveTargetResolver.d.ts +1 -1
- package/build/commands/shared/serveTargetResolver.js +1 -1
- package/build/commands/target/index.js +1 -1
- package/build/commands/wait/index.js +1 -1
- package/build/commands/wait/wait.d.ts +2 -2
- package/build/commands/wait/wait.js +4 -4
- package/build/config/configLoader.js +1 -1
- package/build/config/configManager.js +3 -3
- package/build/config/configuredServerTargets.js +1 -1
- package/build/config/mcpConfigManager.js +3 -3
- package/build/constants/mcp.d.ts +1 -1
- package/build/constants/mcp.js +1 -1
- package/build/constants.d.ts +1 -1
- package/build/constants.js +1 -1
- package/build/core/capabilities/asyncLoadingOrchestrator.d.ts +4 -4
- package/build/core/capabilities/asyncLoadingOrchestrator.js +3 -3
- package/build/core/capabilities/capabilityAggregator.d.ts +1 -1
- package/build/core/capabilities/capabilityAggregator.js +1 -1
- package/build/core/capabilities/capabilityCatalog.d.ts +2 -2
- package/build/core/capabilities/capabilityCatalog.js +5 -5
- package/build/core/capabilities/capabilityManager.d.ts +1 -1
- package/build/core/capabilities/capabilityManager.js +2 -2
- package/build/core/capabilities/capabilityPagination.d.ts +1 -1
- package/build/core/capabilities/configuredToolSnapshot.d.ts +1 -1
- package/build/core/capabilities/configuredToolSnapshot.js +1 -1
- package/build/core/capabilities/inspectPagination.d.ts +16 -0
- package/build/core/capabilities/inspectPagination.d.ts.map +1 -0
- package/build/core/capabilities/inspectPagination.js +41 -0
- package/build/core/capabilities/inspectPagination.js.map +1 -0
- package/build/core/capabilities/internal/discoveryTools.js +1 -1
- package/build/core/capabilities/internal/installationTools.js +1 -1
- package/build/core/capabilities/internal/managementTools.js +1 -1
- package/build/core/capabilities/internalCapabilitiesProvider.d.ts +2 -2
- package/build/core/capabilities/internalCapabilitiesProvider.js +8 -8
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts +3 -3
- package/build/core/capabilities/lazyLoadingOrchestrator.js +3 -3
- package/build/core/capabilities/metaToolProvider.d.ts +2 -2
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.js +4 -4
- package/build/core/capabilities/toolRegistry.d.ts +1 -1
- package/build/core/client/postAuthOAuthRecovery.d.ts +1 -1
- package/build/core/client/postAuthOAuthRecovery.js +3 -3
- package/build/core/client/renderableOutboundConnection.d.ts +2 -2
- package/build/core/configChangeHandler.js +6 -6
- package/build/core/filtering/clientFiltering.d.ts +1 -1
- package/build/core/filtering/filterCache.d.ts +1 -1
- package/build/core/filtering/filterSelection.d.ts +1 -1
- package/build/core/filtering/filteringService.d.ts +1 -1
- package/build/core/filtering/filteringService.js +1 -1
- package/build/core/filtering/templateFilteringService.d.ts +2 -2
- package/build/core/filtering/templateIndex.d.ts +1 -1
- package/build/core/flags/flagManager.js +1 -1
- package/build/core/instructions/effectiveServerInstructions.d.ts +1 -1
- package/build/core/instructions/instructionAggregator.d.ts +3 -3
- package/build/core/instructions/instructionAggregator.js +1 -1
- package/build/core/loading/loadingStateTracker.d.ts.map +1 -1
- package/build/core/loading/loadingStateTracker.js +5 -1
- package/build/core/loading/loadingStateTracker.js.map +1 -1
- package/build/core/loading/mcpLoadingManager.d.ts +2 -2
- package/build/core/notifications/notificationManager.d.ts +2 -2
- package/build/core/notifications/notificationManager.js +2 -2
- package/build/core/protocol/requestHandlerUtils.d.ts +4 -4
- package/build/core/protocol/requestHandlerUtils.js +9 -9
- package/build/core/server/adapters/ExternalServerAdapter.d.ts +2 -2
- package/build/core/server/adapters/ServerRegistry.d.ts +3 -3
- package/build/core/server/adapters/TemplateServerAdapter.d.ts +3 -3
- package/build/core/server/adapters/types.d.ts +3 -3
- package/build/core/server/adapters/types.js +1 -1
- package/build/core/server/agentConfig.d.ts +3 -3
- package/build/core/server/agentConfig.js +2 -2
- package/build/core/server/backendStdioSupervisor.d.ts.map +1 -1
- package/build/core/server/backendStdioSupervisor.js +8 -5
- package/build/core/server/backendStdioSupervisor.js.map +1 -1
- package/build/core/server/backgroundLaunchConfig.d.ts +1 -1
- package/build/core/server/backgroundLaunchConfig.js +1 -1
- package/build/core/server/backgroundRuntimeSupervisor.d.ts +2 -2
- package/build/core/server/backgroundRuntimeSupervisor.d.ts.map +1 -1
- package/build/core/server/backgroundRuntimeSupervisor.js +12 -4
- package/build/core/server/backgroundRuntimeSupervisor.js.map +1 -1
- package/build/core/server/backgroundRuntimeSupervisorState.d.ts +3 -0
- package/build/core/server/backgroundRuntimeSupervisorState.d.ts.map +1 -1
- package/build/core/server/backgroundRuntimeSupervisorState.js +3 -0
- package/build/core/server/backgroundRuntimeSupervisorState.js.map +1 -1
- package/build/core/server/connectionResolver.d.ts +1 -1
- package/build/core/server/disabledTools.d.ts +1 -1
- package/build/core/server/legacyRuntimeRecovery.d.ts +14 -0
- package/build/core/server/legacyRuntimeRecovery.d.ts.map +1 -0
- package/build/core/server/legacyRuntimeRecovery.js +209 -0
- package/build/core/server/legacyRuntimeRecovery.js.map +1 -0
- package/build/core/server/pidFileManager.d.ts +6 -2
- package/build/core/server/pidFileManager.d.ts.map +1 -1
- package/build/core/server/pidFileManager.js +13 -4
- package/build/core/server/pidFileManager.js.map +1 -1
- package/build/core/server/processEvidence.d.ts +23 -0
- package/build/core/server/processEvidence.d.ts.map +1 -0
- package/build/core/server/processEvidence.js +114 -0
- package/build/core/server/processEvidence.js.map +1 -0
- package/build/core/server/processIdentity.d.ts +27 -0
- package/build/core/server/processIdentity.d.ts.map +1 -0
- package/build/core/server/processIdentity.js +101 -0
- package/build/core/server/processIdentity.js.map +1 -0
- package/build/core/server/runtimeFileLock.d.ts +6 -0
- package/build/core/server/runtimeFileLock.d.ts.map +1 -0
- package/build/core/server/runtimeFileLock.js +34 -0
- package/build/core/server/runtimeFileLock.js.map +1 -0
- package/build/core/server/runtimeLifecycle.d.ts +5 -5
- package/build/core/server/runtimeLifecycle.d.ts.map +1 -1
- package/build/core/server/runtimeLifecycle.js +19 -3
- package/build/core/server/runtimeLifecycle.js.map +1 -1
- package/build/core/server/runtimeScopeOwnership.d.ts +3 -0
- package/build/core/server/runtimeScopeOwnership.d.ts.map +1 -1
- package/build/core/server/runtimeScopeOwnership.js +95 -28
- package/build/core/server/runtimeScopeOwnership.js.map +1 -1
- package/build/core/server/templateConfigurationManager.d.ts +1 -1
- package/build/core/server/toolDescriptionOverrides.d.ts +1 -1
- package/build/core/tools/handlers/serverManagementHandler.d.ts +4 -4
- package/build/core/tools/handlers/serverManagementHandler.js +3 -3
- package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts +1 -1
- package/build/core/tools/internal/adapters/management/managementAdapter.d.ts +1 -1
- package/build/core/tools/internal/adapters/management/managementAdapter.js +2 -2
- package/build/core/tools/internal/adapters/management/toolHandlers.js +1 -1
- package/build/core/tools/internal/adapters/management/types.d.ts +1 -1
- package/build/core/tools/internal/adapters/management/validation.d.ts +1 -1
- package/build/core/tools/internal/adapters/validation/configValidation.d.ts +1 -1
- package/build/core/tools/internal/discoveryHandlers.js +1 -1
- package/build/core/tools/internal/installationHandlers.js +2 -2
- package/build/core/tools/internal/managementHandlers.js +2 -2
- package/build/core/types/server.d.ts +2 -2
- package/build/domains/admin/adminConfiguredServerService.d.ts +1 -1
- package/build/domains/admin/adminConfiguredServerService.js +2 -2
- package/build/domains/admin/adminDomain.d.ts +2 -2
- package/build/domains/admin/adminDomain.js +1 -1
- package/build/domains/admin/adminInstructionPreviewRuntime.d.ts +1 -1
- package/build/domains/admin/adminInstructionPreviewRuntime.js +1 -1
- package/build/domains/admin/adminInstructionTemplateService.d.ts +3 -3
- package/build/domains/admin/adminOAuthService.d.ts +1 -0
- package/build/domains/admin/adminOAuthService.d.ts.map +1 -1
- package/build/domains/admin/adminOAuthService.js +8 -2
- package/build/domains/admin/adminOAuthService.js.map +1 -1
- package/build/domains/admin/adminPresetService.d.ts +2 -2
- package/build/domains/admin/adminPresetService.js +2 -2
- package/build/domains/admin/configuredToolInventory.js +1 -1
- package/build/domains/admin/runtimeConfiguredToolInspectionService.js +1 -1
- package/build/domains/discovery/appDiscovery.js +2 -2
- package/build/domains/installation/metadata/defaultsProvider.d.ts +1 -1
- package/build/domains/installation/metadata/metadataExtractor.d.ts +1 -1
- package/build/domains/installation/serverInstallationSourceResolution.d.ts +1 -1
- package/build/domains/installation/serverInstallationTypes.d.ts +2 -2
- package/build/domains/installation/serverInstallationWorkflow.js +2 -2
- package/build/domains/instruction-template/instructionTemplateManager.d.ts +1 -1
- package/build/domains/instruction-template/instructionTemplateManager.js +1 -1
- package/build/domains/preset/manager/presetManager.d.ts +1 -1
- package/build/domains/preset/manager/presetManager.js +3 -3
- package/build/domains/preset/manager/presetManagerCleanup.d.ts +2 -2
- package/build/domains/preset/manager/presetStorage.d.ts +1 -1
- package/build/domains/preset/manager/presetTesting.d.ts +1 -1
- package/build/domains/preset/manager/presetTesting.js +2 -2
- package/build/domains/preset/manager/presetValidation.d.ts +1 -1
- package/build/domains/preset/manager/presetValidation.js +1 -1
- package/build/domains/preset/parsers/tagQueryEvaluator.d.ts +1 -1
- package/build/domains/preset/parsers/tagQueryParser.d.ts +1 -1
- package/build/domains/registry/formatters/commonFormatters.d.ts +1 -1
- package/build/domains/registry/formatters/serverDetailFormatter.d.ts +1 -1
- package/build/domains/registry/formatters/serverDetailFormatter.js +1 -1
- package/build/domains/registry/formatters/versionsFormatter.d.ts +1 -1
- package/build/domains/registry/searchFiltering.d.ts +1 -1
- package/build/domains/registry/searchFiltering.js +1 -1
- package/build/domains/server-management/types.d.ts +1 -1
- package/build/logger/configureGlobalLogger.js +1 -1
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts +2 -2
- package/build/sdk/legacy/auth/sdkOAuthServerProvider.d.ts +4 -4
- package/build/sdk/legacy/auth/sdkOAuthServerProvider.js +1 -1
- package/build/sdk/legacy/client/runtime/clientManager.d.ts +1 -1
- package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.d.ts +2 -2
- package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.js +1 -1
- package/build/sdk/legacy/client/runtime/legacyOutboundConnection.js +1 -1
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts +2 -2
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js +4 -4
- package/build/sdk/legacy/client/runtime/legacyTransport.d.ts +1 -1
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts +1 -1
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js +2 -2
- package/build/sdk/legacy/client/runtime/outboundRequestParams.d.ts +1 -1
- package/build/sdk/legacy/client/runtime/serveClient.d.ts +2 -2
- package/build/sdk/legacy/client/runtime/serveClient.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/serveClient.js +4 -4
- package/build/sdk/legacy/client/runtime/serveClient.js.map +1 -1
- package/build/sdk/legacy/commands/serve.js +1 -1
- package/build/sdk/legacy/server/protocol/notificationHandlers.d.ts +1 -1
- package/build/sdk/legacy/server/protocol/notificationHandlers.js +5 -5
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.d.ts +1 -1
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.js +3 -3
- package/build/sdk/legacy/server/protocol/requestHandlers.d.ts +1 -1
- package/build/sdk/legacy/server/protocol/requestHandlers.js +3 -3
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.d.ts +1 -1
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js +4 -4
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.d.ts +1 -1
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.js +3 -3
- package/build/sdk/legacy/server/runtime/clientInstancePoolTypes.d.ts +2 -2
- package/build/sdk/legacy/server/runtime/connectionManager.d.ts +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.js +2 -2
- package/build/sdk/legacy/server/runtime/legacyInboundConnection.d.ts +2 -2
- package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.d.ts +3 -3
- package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.js +2 -2
- package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.d.ts +1 -1
- package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.d.ts +2 -2
- package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.js +1 -1
- package/build/sdk/legacy/server/runtime/requestContextPreparation.d.ts +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.d.ts +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.js +1 -1
- package/build/sdk/legacy/server/runtime/templateServerCleanup.d.ts +1 -1
- package/build/sdk/legacy/server/runtime/templateServerManager.d.ts +1 -1
- package/build/sdk/legacy/server/runtime/templateServerManager.js +1 -1
- package/build/sdk/legacy/shared/capabilityListCapture.d.ts +1 -1
- package/build/sdk/legacy/shared/capabilityListCapture.js +1 -1
- package/build/sdk/legacy/transport/http/loggingSseTransport.d.ts +2 -2
- package/build/sdk/legacy/transport/http/loggingSseTransport.js +1 -1
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.d.ts +1 -1
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js +1 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js +2 -2
- package/build/sdk/legacy/transport/http/restorableStreamableTransport.d.ts +1 -1
- package/build/sdk/legacy/transport/http/restorableStreamableTransport.js +1 -1
- package/build/sdk/legacy/transport/http/routes/sseRoutes.js +2 -2
- package/build/sdk/legacy/transport/http/server.js +2 -2
- package/build/sdk/legacy/transport/http/streamableSessionLifecycle.d.ts +1 -1
- package/build/sdk/legacy/transport/http/streamableSessionLifecycle.js +1 -1
- package/build/sdk/legacy/transport/restartableStdioTransport.d.ts +3 -3
- package/build/sdk/legacy/transport/restartableStdioTransport.js +1 -1
- package/build/sdk/legacy/transport/stdioProxyTransport.js +2 -2
- package/build/sdk/legacy/transport/transportFactory.js +3 -3
- package/build/sdk/legacy/validation/CustomJsonSchemaValidator.d.ts +1 -1
- package/build/transport/http/middlewares/httpRequestLogger.js +1 -1
- package/build/transport/http/middlewares/tagsExtractor.js +1 -1
- package/build/transport/http/routes/adminRoutes.d.ts +3 -1
- package/build/transport/http/routes/adminRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/adminRoutes.js +36 -1
- package/build/transport/http/routes/adminRoutes.js.map +1 -1
- package/build/transport/http/routes/apiRoutes.js +1 -1
- package/build/transport/http/routes/inspectHelpers.js +1 -1
- package/build/transport/http/routes/inspectRequestContext.js +2 -2
- package/build/transport/http/routes/inspectRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/inspectRoutes.js +57 -59
- package/build/transport/http/routes/inspectRoutes.js.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.js +1 -1
- package/build/transport/http/routes/oauthRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/oauthRoutes.js +20 -4
- package/build/transport/http/routes/oauthRoutes.js.map +1 -1
- package/build/transport/http/routes/streamableHttpRoutes.d.ts +2 -2
- package/build/transport/http/routes/streamableHttpRoutes.js +7 -7
- package/build/transport/http/routes/toolRoutes.js +1 -1
- package/build/transport/http/storage/streamableSessionRepository.js +1 -1
- package/build/transport/http/utils/templateContextAuthority.js +1 -1
- package/build/utils/validation/urlDetection.js +1 -1
- package/package.json +1 -1
|
@@ -3,11 +3,11 @@ import { acquireRuntimeCapabilityCatalog } from '../../../../core/capabilities/r
|
|
|
3
3
|
import { getRequestSession, resolveCapabilityVisibility } from '../../../../core/protocol/requestHandlerUtils.js';
|
|
4
4
|
import { ClientStatus, ServerStatus } from '../../../../core/types/index.js';
|
|
5
5
|
import logger from '../../../../logger/logger.js';
|
|
6
|
-
import { toJsonValue } from '
|
|
7
|
-
import { getLegacyTransport, setOutboundNotificationHandler, } from '
|
|
8
|
-
import { getLegacyInboundServer } from '
|
|
9
|
-
import { projectResourceUri } from '
|
|
10
|
-
import { CancelledNotificationSchema, LoggingMessageNotificationSchema, ProgressNotificationSchema, ResourceUpdatedNotificationSchema, RootsListChangedNotificationSchema, } from '
|
|
6
|
+
import { toJsonValue } from '../../../contracts/index.js';
|
|
7
|
+
import { getLegacyTransport, setOutboundNotificationHandler, } from '../../client/runtime/legacyOutboundConnection.js';
|
|
8
|
+
import { getLegacyInboundServer } from '../runtime/legacyInboundConnection.js';
|
|
9
|
+
import { projectResourceUri } from '../../shared/resourceTemplateRouting.js';
|
|
10
|
+
import { CancelledNotificationSchema, LoggingMessageNotificationSchema, ProgressNotificationSchema, ResourceUpdatedNotificationSchema, RootsListChangedNotificationSchema, } from '../../types.js';
|
|
11
11
|
import { withErrorHandling } from '../../../../utils/core/errorHandling.js';
|
|
12
12
|
function formatNotificationError(error) {
|
|
13
13
|
return error instanceof Error ? `Error: ${error.message}` : String(error);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InboundConnection } from '../../../../core/types/index.js';
|
|
2
|
-
import { type LegacyOutboundConnections } from '
|
|
2
|
+
import { type LegacyOutboundConnections } from '../../client/runtime/legacyOutboundConnection.js';
|
|
3
3
|
export declare function registerPromptHandlers(outboundConns: LegacyOutboundConnections, inboundConn: InboundConnection): void;
|
|
4
4
|
export declare function registerCompletionHandlers(outboundConns: LegacyOutboundConnections, inboundConn: InboundConnection): void;
|
|
5
5
|
//# sourceMappingURL=promptRequestHandlers.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { acquireRuntimeCapabilityCatalog } from '../../../../core/capabilities/runtimeCapabilityCatalog.js';
|
|
2
2
|
import { getRequestSession, resolveCapabilityVisibility } from '../../../../core/protocol/requestHandlerUtils.js';
|
|
3
|
-
import { requestLegacyOutbound, } from '
|
|
4
|
-
import { getLegacyInboundServer } from '
|
|
5
|
-
import { CompleteRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema } from '
|
|
3
|
+
import { requestLegacyOutbound, } from '../../client/runtime/legacyOutboundConnection.js';
|
|
4
|
+
import { getLegacyInboundServer } from '../runtime/legacyInboundConnection.js';
|
|
5
|
+
import { CompleteRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema } from '../../types.js';
|
|
6
6
|
import { withErrorHandling } from '../../../../utils/core/errorHandling.js';
|
|
7
7
|
export function registerPromptHandlers(outboundConns, inboundConn) {
|
|
8
8
|
const acquire = (cursor) => acquireRuntimeCapabilityCatalog(outboundConns, resolveCapabilityVisibility(outboundConns, inboundConn, getRequestSession(inboundConn), 'prompts'), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LazyLoadingOrchestrator } from '../../../../core/capabilities/lazyLoadingOrchestrator.js';
|
|
2
2
|
import { createCapabilityCatalogFromConnections, filterConnectionsForSession, getRequestSession, resolveOutboundConnection } from '../../../../core/protocol/requestHandlerUtils.js';
|
|
3
3
|
import { InboundConnection } from '../../../../core/types/index.js';
|
|
4
|
-
import { type LegacyOutboundConnections } from '
|
|
4
|
+
import { type LegacyOutboundConnections } from '../../client/runtime/legacyOutboundConnection.js';
|
|
5
5
|
export { createCapabilityCatalogFromConnections, filterConnectionsForSession, getRequestSession, resolveOutboundConnection, };
|
|
6
6
|
/**
|
|
7
7
|
* Registers all request handlers based on available capabilities
|
|
@@ -2,9 +2,9 @@ import { createCapabilityCatalogFromConnections, filterConnectionsForSession, ge
|
|
|
2
2
|
import { ServerManager } from '../../../../core/server/serverManager.js';
|
|
3
3
|
import { ClientStatus } from '../../../../core/types/index.js';
|
|
4
4
|
import logger, { setLogLevel } from '../../../../logger/logger.js';
|
|
5
|
-
import { getLegacyTransport, requestLegacyOutbound, setOutboundRequestHandler, } from '
|
|
6
|
-
import { getLegacyInboundServer } from '
|
|
7
|
-
import { CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema, PingRequestSchema, SetLevelRequestSchema, } from '
|
|
5
|
+
import { getLegacyTransport, requestLegacyOutbound, setOutboundRequestHandler, } from '../../client/runtime/legacyOutboundConnection.js';
|
|
6
|
+
import { getLegacyInboundServer } from '../runtime/legacyInboundConnection.js';
|
|
7
|
+
import { CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema, PingRequestSchema, SetLevelRequestSchema, } from '../../types.js';
|
|
8
8
|
import { withErrorHandling } from '../../../../utils/core/errorHandling.js';
|
|
9
9
|
import { getRequestTimeout } from '../../../../utils/core/timeoutUtils.js';
|
|
10
10
|
import { registerCompletionHandlers, registerPromptHandlers } from './promptRequestHandlers.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InboundConnection } from '../../../../core/types/index.js';
|
|
2
|
-
import { type LegacyOutboundConnections } from '
|
|
2
|
+
import { type LegacyOutboundConnections } from '../../client/runtime/legacyOutboundConnection.js';
|
|
3
3
|
export declare function registerResourceHandlers(outboundConns: LegacyOutboundConnections, inboundConn: InboundConnection): void;
|
|
4
4
|
//# sourceMappingURL=resourceRequestHandlers.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { acquireRuntimeCapabilityCatalog } from '../../../../core/capabilities/runtimeCapabilityCatalog.js';
|
|
2
2
|
import { getRequestSession, resolveCapabilityVisibility } from '../../../../core/protocol/requestHandlerUtils.js';
|
|
3
|
-
import { requestLegacyOutbound, } from '
|
|
4
|
-
import { getLegacyInboundServer } from '
|
|
5
|
-
import { projectResourceUri, resolveResourceRoute } from '
|
|
6
|
-
import { ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ReadResourceRequestSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, } from '
|
|
3
|
+
import { requestLegacyOutbound, } from '../../client/runtime/legacyOutboundConnection.js';
|
|
4
|
+
import { getLegacyInboundServer } from '../runtime/legacyInboundConnection.js';
|
|
5
|
+
import { projectResourceUri, resolveResourceRoute } from '../../shared/resourceTemplateRouting.js';
|
|
6
|
+
import { ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ReadResourceRequestSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, } from '../../types.js';
|
|
7
7
|
import { withErrorHandling } from '../../../../utils/core/errorHandling.js';
|
|
8
8
|
export function registerResourceHandlers(outboundConns, inboundConn) {
|
|
9
9
|
const acquire = (cursor, kind = 'resources') => acquireRuntimeCapabilityCatalog(outboundConns, resolveCapabilityVisibility(outboundConns, inboundConn, getRequestSession(inboundConn), 'resources'), { continuation: cursor ? { kind, cursor, enablePagination: inboundConn.enablePagination ?? false } : undefined });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LazyLoadingOrchestrator } from '../../../../core/capabilities/lazyLoadingOrchestrator.js';
|
|
2
2
|
import { InboundConnection } from '../../../../core/types/index.js';
|
|
3
|
-
import { type LegacyOutboundConnections } from '
|
|
3
|
+
import { type LegacyOutboundConnections } from '../../client/runtime/legacyOutboundConnection.js';
|
|
4
4
|
export declare function registerToolHandlers(outboundConns: LegacyOutboundConnections, inboundConn: InboundConnection, lazyLoadingOrchestrator?: LazyLoadingOrchestrator): void;
|
|
5
5
|
//# sourceMappingURL=toolRequestHandlers.d.ts.map
|
|
@@ -4,9 +4,9 @@ import { acquireRuntimeCapabilityCatalog } from '../../../../core/capabilities/r
|
|
|
4
4
|
import { executeWithPostAuthOAuthRecovery } from '../../../../core/client/postAuthOAuthRecovery.js';
|
|
5
5
|
import { getRequestSession, resolveCapabilityVisibility, resolveLazyCapabilityVisibility, } from '../../../../core/protocol/requestHandlerUtils.js';
|
|
6
6
|
import { getDisabledSourceToolError } from '../../../../core/server/disabledTools.js';
|
|
7
|
-
import { requestLegacyOutbound, } from '
|
|
8
|
-
import { getLegacyInboundServer } from '
|
|
9
|
-
import { CallToolRequestSchema, ListToolsRequestSchema } from '
|
|
7
|
+
import { requestLegacyOutbound, } from '../../client/runtime/legacyOutboundConnection.js';
|
|
8
|
+
import { getLegacyInboundServer } from '../runtime/legacyInboundConnection.js';
|
|
9
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '../../types.js';
|
|
10
10
|
import { withErrorHandling } from '../../../../utils/core/errorHandling.js';
|
|
11
11
|
export function registerToolHandlers(outboundConns, inboundConn, lazyLoadingOrchestrator) {
|
|
12
12
|
const sessionId = getRequestSession(inboundConn);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BackendStdioSupervisor, BackendSupervisionSnapshot } from '../../../../core/server/backendStdioSupervisor.js';
|
|
2
2
|
import type { MCPServerParams } from '../../../../core/types/transport.js';
|
|
3
|
-
import type { Client } from '
|
|
4
|
-
import type { AuthProviderTransport } from '
|
|
3
|
+
import type { Client } from '../../client/index.js';
|
|
4
|
+
import type { AuthProviderTransport } from '../../client/runtime/legacyTransport.js';
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for client instance pool
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LazyLoadingOrchestrator } from '../../../../core/capabilities/lazyLoadingOrchestrator.js';
|
|
2
2
|
import type { OutboundConnections } from '../../../../core/types/client.js';
|
|
3
3
|
import { InboundConnection, InboundConnectionConfig, OperationOptions } from '../../../../core/types/index.js';
|
|
4
|
-
import { Transport } from '
|
|
4
|
+
import { Transport } from '../../shared/transport.js';
|
|
5
5
|
import type { ContextData } from '../../../../types/context.js';
|
|
6
6
|
import { type LegacyInboundConnection } from './legacyInboundConnection.js';
|
|
7
7
|
/**
|
|
@@ -5,8 +5,8 @@ import { ServerStatus } from '../../../../core/types/index.js';
|
|
|
5
5
|
import { PresetNotificationService, } from '../../../../domains/preset/services/presetNotificationService.js';
|
|
6
6
|
import logger, { debugIf } from '../../../../logger/logger.js';
|
|
7
7
|
import { enhanceServerWithLogging } from '../../../../logger/mcpLoggingEnhancer.js';
|
|
8
|
-
import { toJsonValue } from '
|
|
9
|
-
import { Server } from '
|
|
8
|
+
import { toJsonValue } from '../../../contracts/jsonValue.js';
|
|
9
|
+
import { Server } from '../index.js';
|
|
10
10
|
import { executeOperation } from '../../../../utils/core/operationExecution.js';
|
|
11
11
|
import { requireLegacyInboundConnection, toInboundConnectionError, } from './legacyInboundConnection.js';
|
|
12
12
|
import { getLegacyServerTransportHandle, isLegacyServerConnected, LegacySdkServerAdapter, } from './legacySdkServerAdapter.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InboundConnection, InboundConnectionError, ServerStatus } from '../../../../core/types/server.js';
|
|
2
|
-
import type { LegacyConnectionId } from '
|
|
3
|
-
import type { Server } from '
|
|
2
|
+
import type { LegacyConnectionId } from '../../../contracts/legacySdkAdapter.js';
|
|
3
|
+
import type { Server } from '../index.js';
|
|
4
4
|
import { LegacySdkServerAdapter } from './legacySdkServerAdapter.js';
|
|
5
5
|
/** Internal connection shape. Never re-export this type through a shared compatibility path. */
|
|
6
6
|
export interface LegacyInboundConnection extends Omit<InboundConnection, 'status' | 'lastError' | 'lastConnected' | 'connectedAt'> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { InboundConnectionAdapter } from '../../../../core/types/server.js';
|
|
2
|
-
import type { LegacyConnectionId, LegacySdkLifecycleState, LegacySdkNotification } from '
|
|
3
|
-
import type { Server } from '
|
|
4
|
-
import type { Transport } from '
|
|
2
|
+
import type { LegacyConnectionId, LegacySdkLifecycleState, LegacySdkNotification } from '../../../contracts/legacySdkAdapter.js';
|
|
3
|
+
import type { Server } from '../index.js';
|
|
4
|
+
import type { Transport } from '../../shared/transport.js';
|
|
5
5
|
/** Owns the live v1 SDK server and transport inside the legacy runtime island. */
|
|
6
6
|
export declare class LegacySdkServerAdapter implements InboundConnectionAdapter {
|
|
7
7
|
readonly connectionId: LegacyConnectionId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toJsonValue } from '
|
|
2
|
-
import { OneMcpProtocolError } from '
|
|
1
|
+
import { toJsonValue } from '../../../contracts/jsonValue.js';
|
|
2
|
+
import { OneMcpProtocolError } from '../../../contracts/oneMcpProtocolError.js';
|
|
3
3
|
const serverHandles = new WeakMap();
|
|
4
4
|
function toProtocolError(error) {
|
|
5
5
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OutboundConnections } from '../../../../core/types/client.js';
|
|
2
2
|
import { MCPServerParams } from '../../../../core/types/index.js';
|
|
3
|
-
import type { AuthProviderTransport } from '
|
|
4
|
-
import { Transport } from '
|
|
3
|
+
import type { AuthProviderTransport } from '../../client/runtime/legacyTransport.js';
|
|
4
|
+
import { Transport } from '../../shared/transport.js';
|
|
5
5
|
/**
|
|
6
6
|
* Manages the lifecycle of MCP server instances (start, stop, restart)
|
|
7
7
|
*/
|
|
@@ -2,7 +2,7 @@ import { sanitizeRuntimeScopeError } from '../../../../config/runtimeScopeEnv.js
|
|
|
2
2
|
import { ClientManager } from '../../../../core/client/clientManager.js';
|
|
3
3
|
import { getGlobalContextManager } from '../../../../core/context/globalContextManager.js';
|
|
4
4
|
import logger, { debugIf } from '../../../../logger/logger.js';
|
|
5
|
-
import { getLegacyTransport } from '
|
|
5
|
+
import { getLegacyTransport } from '../../client/runtime/legacyOutboundConnection.js';
|
|
6
6
|
import { createTransports, createTransportsWithContext, inferTransportType } from '../../../../transport/transportFactory.js';
|
|
7
7
|
/**
|
|
8
8
|
* Manages the lifecycle of MCP server instances (start, stop, restart)
|
|
@@ -2,7 +2,7 @@ import type { TrustedTemplateContext } from '../../../../core/context/templateCo
|
|
|
2
2
|
import type { OutboundConnections } from '../../../../core/types/client.js';
|
|
3
3
|
import type { MCPServerParams } from '../../../../core/types/index.js';
|
|
4
4
|
import type { InboundConnectionConfig } from '../../../../core/types/server.js';
|
|
5
|
-
import type { Transport } from '
|
|
5
|
+
import type { Transport } from '../../shared/transport.js';
|
|
6
6
|
import type { ContextData } from '../../../../types/context.js';
|
|
7
7
|
export type RequestContextPreparationResult = {
|
|
8
8
|
status: 'no_context';
|
|
@@ -4,7 +4,7 @@ import { InstructionAggregator } from '../../../../core/instructions/instruction
|
|
|
4
4
|
import { ServerRegistry } from '../../../../core/server/adapters/ServerRegistry.js';
|
|
5
5
|
import { TemplateServerManager } from '../../../../core/server/templateServerManager.js';
|
|
6
6
|
import type { InboundConnection, InboundConnectionConfig, MCPServerParams, OperationOptions, OutboundConnection, OutboundConnections } from '../../../../core/types/index.js';
|
|
7
|
-
import { Transport } from '
|
|
7
|
+
import { Transport } from '../../shared/transport.js';
|
|
8
8
|
import type { ContextData } from '../../../../types/context.js';
|
|
9
9
|
/**
|
|
10
10
|
* Event data for context change events
|
|
@@ -11,7 +11,7 @@ import { TemplateConfigurationManager } from '../../../../core/server/templateCo
|
|
|
11
11
|
import { TemplateServerManager } from '../../../../core/server/templateServerManager.js';
|
|
12
12
|
import { ClientStatus } from '../../../../core/types/index.js';
|
|
13
13
|
import logger, { debugIf } from '../../../../logger/logger.js';
|
|
14
|
-
import { getLegacyTransport } from '
|
|
14
|
+
import { getLegacyTransport } from '../../client/runtime/legacyOutboundConnection.js';
|
|
15
15
|
/**
|
|
16
16
|
* Refactored ServerManager that coordinates various server management components
|
|
17
17
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClientTemplateTracker } from '../../../../core/filtering/index.js';
|
|
2
2
|
import type { ClientInstancePool } from '../../../../core/server/clientInstancePool.js';
|
|
3
3
|
import type { OutboundConnections } from '../../../../core/types/client.js';
|
|
4
|
-
import type { Transport } from '
|
|
4
|
+
import type { Transport } from '../../shared/transport.js';
|
|
5
5
|
export interface EphemeralTemplateClient {
|
|
6
6
|
templateName: string;
|
|
7
7
|
instanceId: string;
|
|
@@ -6,7 +6,7 @@ import { type TemplateInstancePoolPolicy } from '../../../../core/server/clientI
|
|
|
6
6
|
import type { OutboundConnections } from '../../../../core/types/client.js';
|
|
7
7
|
import { MCPServerParams } from '../../../../core/types/index.js';
|
|
8
8
|
import type { InboundConnectionConfig } from '../../../../core/types/server.js';
|
|
9
|
-
import { Transport } from '
|
|
9
|
+
import { Transport } from '../../shared/transport.js';
|
|
10
10
|
import type { ContextData } from '../../../../types/context.js';
|
|
11
11
|
/**
|
|
12
12
|
* Options for rebuilding the template index
|
|
@@ -12,7 +12,7 @@ import { createRenderedIdentity, createSessionIdentity, resolveTemplateIdentityM
|
|
|
12
12
|
import { cleanupExpiredEphemeralClients, cleanupTemplateServersForSession, } from '../../../../core/server/templateServerCleanup.js';
|
|
13
13
|
import { ClientStatus } from '../../../../core/types/client.js';
|
|
14
14
|
import logger, { debugIf } from '../../../../logger/logger.js';
|
|
15
|
-
import { createLegacyOutboundConnection, getLegacyClient, } from '
|
|
15
|
+
import { createLegacyOutboundConnection, getLegacyClient, } from '../../client/runtime/legacyOutboundConnection.js';
|
|
16
16
|
/**
|
|
17
17
|
* Manages template-based server instances and client pools
|
|
18
18
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type JsonValue } from '
|
|
1
|
+
import { type JsonValue } from '../../contracts/index.js';
|
|
2
2
|
/** Keep malformed template syntax local to one catalog source capability. */
|
|
3
3
|
export declare function captureCapabilityListResult(method: string, result: unknown): JsonValue;
|
|
4
4
|
//# sourceMappingURL=capabilityListCapture.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UriTemplate } from '@modelcontextprotocol/sdk/shared/uriTemplate.js';
|
|
2
|
-
import { toJsonValue } from '
|
|
2
|
+
import { toJsonValue } from '../../contracts/index.js';
|
|
3
3
|
/** Keep malformed template syntax local to one catalog source capability. */
|
|
4
4
|
export function captureCapabilityListResult(method, result) {
|
|
5
5
|
const captured = toJsonValue(result);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ServerResponse } from 'node:http';
|
|
2
|
-
import { SSEServerTransport } from '
|
|
3
|
-
import { JSONRPCMessage } from '
|
|
2
|
+
import { SSEServerTransport } from '../../server/sse.js';
|
|
3
|
+
import { JSONRPCMessage } from '../../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* SSE transport wrapper that logs JSON-RPC error responses.
|
|
6
6
|
* JSON-RPC errors are sent via SSE with HTTP 200 status, so we need
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentConfigManager } from '../../../../core/server/agentConfig.js';
|
|
2
|
-
import { SSEServerTransport } from '
|
|
2
|
+
import { SSEServerTransport } from '../../server/sse.js';
|
|
3
3
|
import { logJsonRpc } from '../../../../transport/http/utils/unifiedLogger.js';
|
|
4
4
|
/**
|
|
5
5
|
* SSE transport wrapper that logs JSON-RPC error responses.
|
|
@@ -2,7 +2,7 @@ import { SDKOAuthServerProvider } from '../../../../../auth/sdkOAuthServerProvid
|
|
|
2
2
|
import type { FilterSelection } from '../../../../../core/filtering/filterSelection.js';
|
|
3
3
|
import { TagExpression } from '../../../../../domains/preset/parsers/tagQueryParser.js';
|
|
4
4
|
import { TagQuery } from '../../../../../domains/preset/types/presetTypes.js';
|
|
5
|
-
import type { AuthInfo as SDKAuthInfo } from '
|
|
5
|
+
import type { AuthInfo as SDKAuthInfo } from '../../../server/auth/types.js';
|
|
6
6
|
import { NextFunction, Request, Response } from 'express';
|
|
7
7
|
declare global {
|
|
8
8
|
namespace Express {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SDKOAuthServerProvider } from '../../../../../auth/sdkOAuthServerProvider.js';
|
|
2
2
|
import { AgentConfigManager } from '../../../../../core/server/agentConfig.js';
|
|
3
3
|
import logger from '../../../../../logger/logger.js';
|
|
4
|
-
import { requireBearerAuth } from '
|
|
4
|
+
import { requireBearerAuth } from '../../../server/auth/middleware/bearerAuth.js';
|
|
5
5
|
import { auditScopeOperation, hasRequiredScopes, scopesToTags } from '../../../../../utils/validation/scopeValidation.js';
|
|
6
6
|
/**
|
|
7
7
|
* Creates a scope validation middleware that uses the SDK's bearer auth middleware
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
|
|
3
3
|
import { LegacyOutboundEraAdapter } from '../../../../gateway/adapters/legacy/legacyOutboundEraAdapter.js';
|
|
4
|
-
import { Client } from '
|
|
5
|
-
import { LegacySdkClientAdapter } from '
|
|
4
|
+
import { Client } from '../../client/index.js';
|
|
5
|
+
import { LegacySdkClientAdapter } from '../../client/runtime/legacySdkClientAdapter.js';
|
|
6
6
|
const LEGACY_REVISION = '2025-11-25';
|
|
7
7
|
/**
|
|
8
8
|
* Gives one modern stateless exchange a private connection to the existing
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StreamableHTTPServerTransport } from '
|
|
1
|
+
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
|
|
2
2
|
/**
|
|
3
3
|
* Metadata about a transport's restoration state, used for debugging
|
|
4
4
|
* and monitoring session restoration flow.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StreamableHTTPServerTransport } from '
|
|
1
|
+
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
|
|
2
2
|
/**
|
|
3
3
|
* RestorableStreamableHTTPServerTransport extends the MCP SDK's StreamableHTTPServerTransport
|
|
4
4
|
* to track whether a transport was restored from persistent storage.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MESSAGES_ENDPOINT, SSE_ENDPOINT } from '../../../../../constants.js';
|
|
2
2
|
import logger from '../../../../../logger/logger.js';
|
|
3
|
-
import { SSEServerTransport } from '
|
|
4
|
-
import { ErrorCode } from '
|
|
3
|
+
import { SSEServerTransport } from '../../../server/sse.js';
|
|
4
|
+
import { ErrorCode } from '../../../types.js';
|
|
5
5
|
import { LoggingSSEServerTransport } from '../../../../../transport/http/loggingSseTransport.js';
|
|
6
6
|
import { getPresetName, getTagExpression, getTagFilterMode, getTagQuery, getValidatedTags, } from '../../../../../transport/http/middlewares/scopeAuthMiddleware.js';
|
|
7
7
|
import tagsExtractor from '../../../../../transport/http/middlewares/tagsExtractor.js';
|
|
@@ -19,8 +19,8 @@ import { getBackendLogBroker } from '../../../../domains/backend-logs/backendLog
|
|
|
19
19
|
import { createConfigChangeService } from '../../../../domains/config-change/configChange.js';
|
|
20
20
|
import { PresetManager } from '../../../../domains/preset/manager/presetManager.js';
|
|
21
21
|
import logger from '../../../../logger/logger.js';
|
|
22
|
-
import { mcpAuthRouter } from '
|
|
23
|
-
import { createModernInboundLegacyBridge } from '
|
|
22
|
+
import { mcpAuthRouter } from '../../server/auth/router.js';
|
|
23
|
+
import { createModernInboundLegacyBridge } from './modernInboundLegacyBridge.js';
|
|
24
24
|
import errorHandler from '../../../../transport/http/middlewares/errorHandler.js';
|
|
25
25
|
import { httpRequestLogger } from '../../../../transport/http/middlewares/httpRequestLogger.js';
|
|
26
26
|
import { createMcpAvailabilityMiddleware } from '../../../../transport/http/middlewares/mcpAvailabilityMiddleware.js';
|
|
@@ -3,7 +3,7 @@ import { AsyncLoadingOrchestrator } from '../../../../core/capabilities/asyncLoa
|
|
|
3
3
|
import type { TemplateContextProof } from '../../../../core/context/templateContextTrust.js';
|
|
4
4
|
import { ServerManager } from '../../../../core/server/serverManager.js';
|
|
5
5
|
import { InboundConnectionConfig } from '../../../../core/types/index.js';
|
|
6
|
-
import { StreamableHTTPServerTransport } from '
|
|
6
|
+
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
|
|
7
7
|
import { RestorableStreamableHTTPServerTransport } from '../../../../transport/http/restorableStreamableTransport.js';
|
|
8
8
|
import { StreamableSessionRepository } from '../../../../transport/http/storage/streamableSessionRepository.js';
|
|
9
9
|
import type { ContextData } from '../../../../types/context.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { AUTH_CONFIG } from '../../../../constants.js';
|
|
3
3
|
import logger from '../../../../logger/logger.js';
|
|
4
|
-
import { StreamableHTTPServerTransport } from '
|
|
4
|
+
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
|
|
5
5
|
import { RestorableStreamableHTTPServerTransport } from '../../../../transport/http/restorableStreamableTransport.js';
|
|
6
6
|
import { authorizeRequestTemplateContext } from '../../../../transport/http/utils/templateContextAuthority.js';
|
|
7
7
|
import { logError } from '../../../../transport/http/utils/unifiedLogger.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stream } from 'node:stream';
|
|
2
|
-
import { StdioServerParameters } from '
|
|
3
|
-
import { Transport } from '
|
|
4
|
-
import { JSONRPCMessage } from '
|
|
2
|
+
import { StdioServerParameters } from '../client/stdio.js';
|
|
3
|
+
import { Transport } from '../shared/transport.js';
|
|
4
|
+
import { JSONRPCMessage } from '../types.js';
|
|
5
5
|
import { ManagedStdioStderr } from '../../../transport/managedStdioStderr.js';
|
|
6
6
|
/**
|
|
7
7
|
* Configuration for the restartable stdio transport
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logger, { debugIf } from '../../../logger/logger.js';
|
|
2
|
-
import { StdioClientTransport } from '
|
|
2
|
+
import { StdioClientTransport } from '../client/stdio.js';
|
|
3
3
|
/**
|
|
4
4
|
* Wrapper around StdioClientTransport that provides automatic restart functionality
|
|
5
5
|
* Implements Transport interface and adds OAuth provider support
|
|
@@ -3,8 +3,8 @@ import { buildCliContext, generateStreamableSessionId } from '../../../commands/
|
|
|
3
3
|
import { MCP_SERVER_VERSION } from '../../../constants/mcp.js';
|
|
4
4
|
import { classifyProtocolEra, createGatewayFailure, } from '../../../gateway/contracts/index.js';
|
|
5
5
|
import logger from '../../../logger/logger.js';
|
|
6
|
-
import { toProtocolJSONRPCMessage } from '
|
|
7
|
-
import { StdioServerTransport } from '
|
|
6
|
+
import { toProtocolJSONRPCMessage } from '../../contracts/index.js';
|
|
7
|
+
import { StdioServerTransport } from '../server/stdio.js';
|
|
8
8
|
import { ClientInfoExtractor } from '../../../utils/client/clientInfoExtractor.js';
|
|
9
9
|
/**
|
|
10
10
|
* Generate a secure mcp-session-id for the proxy with the correct prefix
|
|
@@ -11,9 +11,9 @@ import { createBackendLogProjection } from '../../../domains/backend-logs/backen
|
|
|
11
11
|
import { getBackendLogBroker } from '../../../domains/backend-logs/backendLogRuntime.js';
|
|
12
12
|
import { staticBackendLogSource } from '../../../domains/backend-logs/backendLogSource.js';
|
|
13
13
|
import logger, { debugIf } from '../../../logger/logger.js';
|
|
14
|
-
import { SSEClientTransport } from '
|
|
15
|
-
import { StdioClientTransport } from '
|
|
16
|
-
import { StreamableHTTPClientTransport, } from '
|
|
14
|
+
import { SSEClientTransport } from '../client/sse.js';
|
|
15
|
+
import { StdioClientTransport } from '../client/stdio.js';
|
|
16
|
+
import { StreamableHTTPClientTransport, } from '../client/streamableHttp.js';
|
|
17
17
|
import { HandlebarsTemplateRenderer } from '../../../template/handlebarsTemplateRenderer.js';
|
|
18
18
|
import { ManagedStdioStderr } from '../../../transport/managedStdioStderr.js';
|
|
19
19
|
import { ZodError } from 'zod';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logger from '../../../logger/logger.js';
|
|
2
|
-
import { redactTemplateContextBodyForLogging, redactTemplateContextQueryForLogging, } from '
|
|
2
|
+
import { redactTemplateContextBodyForLogging, redactTemplateContextQueryForLogging, } from '../utils/templateContextAuthority.js';
|
|
3
3
|
import { sanitizeHeaders } from '../../../utils/validation/sanitization.js';
|
|
4
4
|
/**
|
|
5
5
|
* HTTP request logging middleware that provides comprehensive request/response logging
|
|
@@ -2,7 +2,7 @@ import { resolveFilterSelection } from '../../../core/filtering/filterSelection.
|
|
|
2
2
|
import { PresetManager } from '../../../domains/preset/manager/presetManager.js';
|
|
3
3
|
import logger from '../../../logger/logger.js';
|
|
4
4
|
import { ErrorCode } from '../../../sdk/contracts/index.js';
|
|
5
|
-
import { sendBadRequest } from '
|
|
5
|
+
import { sendBadRequest } from '../utils/httpErrorHandler.js';
|
|
6
6
|
/**
|
|
7
7
|
* Middleware to extract and validate tag filters from query parameters.
|
|
8
8
|
* Supports:
|
|
@@ -8,7 +8,7 @@ import type { AdminOAuthOperations } from '../../../domains/admin/adminOAuthServ
|
|
|
8
8
|
import { type AdminPresetOperations } from '../../../domains/admin/adminPresetService.js';
|
|
9
9
|
import type { AdminMutationAvailability } from '../../../domains/admin/runtimeScopeAdminLock.js';
|
|
10
10
|
import type { BackendLogBroker } from '../../../domains/backend-logs/backendLogBroker.js';
|
|
11
|
-
import { type SensitiveOperationRateLimitPolicy } from '
|
|
11
|
+
import { type SensitiveOperationRateLimitPolicy } from '../middlewares/securityMiddleware.js';
|
|
12
12
|
import { Router } from 'express';
|
|
13
13
|
export interface AdminRateLimitPolicy {
|
|
14
14
|
login: {
|
|
@@ -54,5 +54,7 @@ export declare class FailedLoginLimiter {
|
|
|
54
54
|
private key;
|
|
55
55
|
private pruneExpired;
|
|
56
56
|
}
|
|
57
|
+
/** Only authenticated, CSRF-checked browser requests can supply this origin. */
|
|
58
|
+
export declare function trustedAdminReturnOrigin(origin: string | undefined, externalUrl: string): string | undefined;
|
|
57
59
|
export {};
|
|
58
60
|
//# sourceMappingURL=adminRoutes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adminRoutes.d.ts","sourceRoot":"","sources":["../../../../src/transport/http/routes/adminRoutes.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,KAAK,EACV,6BAA6B,EAI9B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAIL,oBAAoB,EACrB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAMpF,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAQtF,OAAO,EAGL,KAAK,iCAAiC,EACvC,MAAM,uDAAuD,CAAC;AAG/D,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"adminRoutes.d.ts","sourceRoot":"","sources":["../../../../src/transport/http/routes/adminRoutes.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,KAAK,EACV,6BAA6B,EAI9B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAIL,oBAAoB,EACrB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAMpF,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAQtF,OAAO,EAGL,KAAK,iCAAiC,EACvC,MAAM,uDAAuD,CAAC;AAG/D,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAgJ7D,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,SAAS,EAAE,iCAAiC,CAAC;CAC9C;AAED,eAAO,MAAM,+BAA+B,EAAE,oBAW7C,CAAC;AAEF,UAAU,kBAAkB;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,oBAAoB,CAAC;IACnC,uBAAuB,CAAC,EAAE,+BAA+B,CAAC;IAC1D,0BAA0B,CAAC,EAAE,kCAAkC,CAAC;IAChE,qBAAqB,CAAC,EAAE,6BAA6B,CAAC;IACtD,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,kBAAkB,EAAE,MAAM,eAAe,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,2BAA2B,CAAC;IACtD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,gBAAgB,CAAC;IAC7C,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,GAAG,IAAI,CAykB5E;AAqQD,wBAAgB,mCAAmC,IAAI,MAAM,CAE5D;AA80BD,qBAAa,kBAAkB;IAI3B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IANpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgE;gBAGtE,GAAG,GAAE,MAAM,MAAiB,EAC5B,aAAa,SAA+B,EAC5C,QAAQ,SAAyB,EACjC,iBAAiB,SAAqB;IAGzD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IASpD,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAWrD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAI7C,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,GAAG;IAIX,OAAO,CAAC,YAAY;CAQrB;AAmxBD,gFAAgF;AAChF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmB5G"}
|
|
@@ -8,7 +8,7 @@ import { AdminConfiguredServerApplyError, AdminConfiguredServerNotFoundError, }
|
|
|
8
8
|
import { ADMIN_SESSION_COOKIE_NAME, AdminIdentityError, } from '../../../domains/admin/adminIdentityService.js';
|
|
9
9
|
import { AdminInstructionTemplateNotFoundError, } from '../../../domains/admin/adminInstructionTemplateService.js';
|
|
10
10
|
import { AdminPresetConflictError, AdminPresetNotFoundError, } from '../../../domains/admin/adminPresetService.js';
|
|
11
|
-
import { createSensitiveOperationLimiter, DEFAULT_SENSITIVE_OPERATION_RATE_LIMIT_POLICY, } from '
|
|
11
|
+
import { createSensitiveOperationLimiter, DEFAULT_SENSITIVE_OPERATION_RATE_LIMIT_POLICY, } from '../middlewares/securityMiddleware.js';
|
|
12
12
|
import { sanitizeErrorMessage } from '../../../utils/validation/sanitization.js';
|
|
13
13
|
import express, { Router } from 'express';
|
|
14
14
|
import rateLimit from 'express-rate-limit';
|
|
@@ -35,6 +35,18 @@ const adminLoginBodySchema = z.object({
|
|
|
35
35
|
username: z.string().trim().min(1).max(ADMIN_USERNAME_MAX_LENGTH),
|
|
36
36
|
password: z.string().min(1).max(ADMIN_PASSWORD_MAX_LENGTH),
|
|
37
37
|
});
|
|
38
|
+
const adminOAuthReturnOriginSchema = z
|
|
39
|
+
.string()
|
|
40
|
+
.refine((value) => {
|
|
41
|
+
try {
|
|
42
|
+
const url = new URL(value);
|
|
43
|
+
return value === url.origin;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}, 'Expected a canonical HTTP(S) origin')
|
|
49
|
+
.pipe(z.url({ protocol: /^https?$/ }));
|
|
38
50
|
const adminOAuthServiceParamsSchema = z.object({
|
|
39
51
|
serviceId: z.string().trim().min(1).max(256),
|
|
40
52
|
});
|
|
@@ -405,6 +417,7 @@ export function createAdminRoutes(options) {
|
|
|
405
417
|
const result = await options.oauthService.authorizeService({
|
|
406
418
|
context: buildAdminOperationContext(req, options, { type: 'backend_oauth_service', id: serviceId }),
|
|
407
419
|
serviceId,
|
|
420
|
+
adminReturnOrigin: trustedAdminReturnOrigin(req.header('Origin'), options.getRuntimeIdentity().externalUrl),
|
|
408
421
|
});
|
|
409
422
|
sendAdminOAuthOperationResult(res, result);
|
|
410
423
|
});
|
|
@@ -419,6 +432,7 @@ export function createAdminRoutes(options) {
|
|
|
419
432
|
const result = await options.oauthService.restartService({
|
|
420
433
|
context: buildAdminOperationContext(req, options, { type: 'backend_oauth_service', id: serviceId }),
|
|
421
434
|
serviceId,
|
|
435
|
+
adminReturnOrigin: trustedAdminReturnOrigin(req.header('Origin'), options.getRuntimeIdentity().externalUrl),
|
|
422
436
|
});
|
|
423
437
|
sendAdminOAuthOperationResult(res, result);
|
|
424
438
|
});
|
|
@@ -2331,4 +2345,25 @@ function isLoopbackRuntimeUrl(value) {
|
|
|
2331
2345
|
return false;
|
|
2332
2346
|
}
|
|
2333
2347
|
}
|
|
2348
|
+
/** Only authenticated, CSRF-checked browser requests can supply this origin. */
|
|
2349
|
+
export function trustedAdminReturnOrigin(origin, externalUrl) {
|
|
2350
|
+
const parsed = adminOAuthReturnOriginSchema.safeParse(origin);
|
|
2351
|
+
if (!parsed.success)
|
|
2352
|
+
return undefined;
|
|
2353
|
+
try {
|
|
2354
|
+
const candidate = new URL(parsed.data);
|
|
2355
|
+
const configured = new URL(externalUrl);
|
|
2356
|
+
const loopback = new Set(['localhost', '127.0.0.1', '[::1]']);
|
|
2357
|
+
if (candidate.origin === configured.origin ||
|
|
2358
|
+
(loopback.has(candidate.hostname) &&
|
|
2359
|
+
loopback.has(configured.hostname) &&
|
|
2360
|
+
candidate.protocol === configured.protocol &&
|
|
2361
|
+
candidate.port === configured.port))
|
|
2362
|
+
return candidate.origin;
|
|
2363
|
+
}
|
|
2364
|
+
catch {
|
|
2365
|
+
/* Invalid origins use the callback-local fallback. */
|
|
2366
|
+
}
|
|
2367
|
+
return undefined;
|
|
2368
|
+
}
|
|
2334
2369
|
//# sourceMappingURL=adminRoutes.js.map
|