@1mcp/agent 0.39.0-beta.3 → 0.39.0-beta.4
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-CKR1HA-8.js} +1 -1
- package/build/admin/assets/{admin-console-CMRxMjQo.js → admin-console-OfHKqRm-.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 +70 -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/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/transportFactory.d.ts.map +1 -1
- package/build/sdk/legacy/transport/transportFactory.js +34 -12
- 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/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 +68 -64
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { createGatewayFailure } from '../../gateway/contracts/gatewayFailure.js';
|
|
2
|
+
const invalidHeaderTokenCharacter = /[^!#$%&'*+.^_`|~0-9A-Za-z-]/;
|
|
3
|
+
const excludedSubschemas = [
|
|
4
|
+
'items',
|
|
5
|
+
'prefixItems',
|
|
6
|
+
'contains',
|
|
7
|
+
'additionalItems',
|
|
8
|
+
'contentSchema',
|
|
9
|
+
'additionalProperties',
|
|
10
|
+
'unevaluatedProperties',
|
|
11
|
+
'unevaluatedItems',
|
|
12
|
+
'propertyNames',
|
|
13
|
+
'patternProperties',
|
|
14
|
+
'dependentSchemas',
|
|
15
|
+
'dependencies',
|
|
16
|
+
'oneOf',
|
|
17
|
+
'anyOf',
|
|
18
|
+
'allOf',
|
|
19
|
+
'not',
|
|
20
|
+
'if',
|
|
21
|
+
'then',
|
|
22
|
+
'else',
|
|
23
|
+
'$defs',
|
|
24
|
+
'definitions',
|
|
25
|
+
];
|
|
26
|
+
const mappedSubschemas = new Set(['patternProperties', 'dependentSchemas', 'dependencies', '$defs', 'definitions']);
|
|
27
|
+
function record(value) {
|
|
28
|
+
if (value === null || Array.isArray(value) || typeof value !== 'object')
|
|
29
|
+
return undefined;
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
/** Scan only detached, budgeted catalog JSON. Never resolve a schema reference or read caller headers. */
|
|
33
|
+
export function scanMcpParamDeclarations(schema) {
|
|
34
|
+
const declarations = [];
|
|
35
|
+
const names = new Set();
|
|
36
|
+
const visit = (value, path, reachable) => {
|
|
37
|
+
const node = record(value);
|
|
38
|
+
if (!node)
|
|
39
|
+
return undefined;
|
|
40
|
+
if (Object.hasOwn(node, 'x-mcp-header')) {
|
|
41
|
+
if (!reachable || path.length === 0)
|
|
42
|
+
return 'Annotation must be reachable through properties';
|
|
43
|
+
const name = node['x-mcp-header'];
|
|
44
|
+
if (typeof name !== 'string' || name.length === 0 || invalidHeaderTokenCharacter.test(name))
|
|
45
|
+
return 'Header name must be an HTTP token';
|
|
46
|
+
const type = node.type;
|
|
47
|
+
if (type !== 'string' && type !== 'integer' && type !== 'boolean')
|
|
48
|
+
return 'Header parameter must have type string, integer, or boolean';
|
|
49
|
+
const normalized = name.toLowerCase();
|
|
50
|
+
if (names.has(normalized))
|
|
51
|
+
return 'Header names must be case-insensitively unique';
|
|
52
|
+
names.add(normalized);
|
|
53
|
+
declarations.push({ path, name, type });
|
|
54
|
+
}
|
|
55
|
+
const properties = record(node.properties);
|
|
56
|
+
for (const [name, child] of Object.entries(properties ?? {})) {
|
|
57
|
+
const failure = visit(child, [...path, name], reachable);
|
|
58
|
+
if (failure)
|
|
59
|
+
return failure;
|
|
60
|
+
}
|
|
61
|
+
for (const keyword of excludedSubschemas) {
|
|
62
|
+
const sub = node[keyword];
|
|
63
|
+
if (sub === undefined)
|
|
64
|
+
continue;
|
|
65
|
+
let branches = [sub];
|
|
66
|
+
if (Array.isArray(sub))
|
|
67
|
+
branches = sub;
|
|
68
|
+
else if (mappedSubschemas.has(keyword))
|
|
69
|
+
branches = Object.values(record(sub) ?? {});
|
|
70
|
+
for (const branch of branches) {
|
|
71
|
+
const failure = visit(branch, [], false);
|
|
72
|
+
if (failure)
|
|
73
|
+
return failure;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
};
|
|
78
|
+
const reason = visit(schema, [], true);
|
|
79
|
+
return reason ? { valid: false, reason } : { valid: true, declarations };
|
|
80
|
+
}
|
|
81
|
+
function argumentAtPath(args, path) {
|
|
82
|
+
let value = args;
|
|
83
|
+
for (const name of path) {
|
|
84
|
+
const parent = record(value);
|
|
85
|
+
if (!parent || !Object.hasOwn(parent, name))
|
|
86
|
+
return undefined;
|
|
87
|
+
value = parent[name];
|
|
88
|
+
}
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
function primitiveValue(value, type) {
|
|
92
|
+
if (type === 'string')
|
|
93
|
+
return typeof value === 'string' ? value : undefined;
|
|
94
|
+
if (type === 'boolean')
|
|
95
|
+
return typeof value === 'boolean' ? String(value) : undefined;
|
|
96
|
+
if (typeof value !== 'number')
|
|
97
|
+
return undefined;
|
|
98
|
+
if (!Number.isSafeInteger(value))
|
|
99
|
+
throw createGatewayFailure({
|
|
100
|
+
kind: 'protocol',
|
|
101
|
+
code: '-32602',
|
|
102
|
+
message: 'Header integer parameter must be a safe integer',
|
|
103
|
+
});
|
|
104
|
+
return String(value);
|
|
105
|
+
}
|
|
106
|
+
function hasUnsafeFieldCharacter(value) {
|
|
107
|
+
for (let index = 0; index < value.length; index++) {
|
|
108
|
+
const code = value.charCodeAt(index);
|
|
109
|
+
if (code === 9)
|
|
110
|
+
continue;
|
|
111
|
+
if (code < 32 || code > 126)
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
function encodeValue(value) {
|
|
117
|
+
if (value.length === 0 ||
|
|
118
|
+
value !== value.trim() ||
|
|
119
|
+
hasUnsafeFieldCharacter(value) ||
|
|
120
|
+
(value.startsWith('=?base64?') && value.endsWith('?='))) {
|
|
121
|
+
return `=?base64?${Buffer.from(value, 'utf8').toString('base64')}?=`;
|
|
122
|
+
}
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
export function createMcpParamHeaders(declarations, args) {
|
|
126
|
+
const headers = {};
|
|
127
|
+
for (const declaration of declarations) {
|
|
128
|
+
const value = primitiveValue(argumentAtPath(args, declaration.path), declaration.type);
|
|
129
|
+
if (value !== undefined)
|
|
130
|
+
headers[`Mcp-Param-${declaration.name}`] = encodeValue(value);
|
|
131
|
+
}
|
|
132
|
+
return headers;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=mcpParamHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpParamHeaders.js","sourceRoot":"","sources":["../../../src/sdk/contracts/mcpParamHeaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAahF,MAAM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G,cAAc,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACvF,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,CAAC,aAAa,WAAW,CAAC,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface RequestProgressNotification {
|
|
2
|
+
readonly method: 'notifications/progress';
|
|
3
|
+
readonly params: {
|
|
4
|
+
progressToken: string | number;
|
|
5
|
+
progress: number;
|
|
6
|
+
total?: number;
|
|
7
|
+
message?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface Owner {
|
|
11
|
+
accepting: boolean;
|
|
12
|
+
active: boolean;
|
|
13
|
+
pending: number;
|
|
14
|
+
bytes: number;
|
|
15
|
+
tail: Promise<void>;
|
|
16
|
+
failure?: unknown;
|
|
17
|
+
readonly token: string | number;
|
|
18
|
+
readonly signal?: AbortSignal;
|
|
19
|
+
readonly assertCurrent?: () => void;
|
|
20
|
+
readonly send: (notification: RequestProgressNotification) => Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/** Retain an opaque scalar token exactly; it never becomes an upstream request token. */
|
|
23
|
+
export declare function requestProgressToken(value: unknown): string | number | undefined;
|
|
24
|
+
/** One inbound exchange owns a bounded delivery queue, independently of any SDK request id. */
|
|
25
|
+
export declare function withRequestProgress<T>(token: unknown, send: Owner['send'], operation: () => Promise<T>, signal?: AbortSignal, assertCurrent?: () => void): Promise<T>;
|
|
26
|
+
/** SDK onprogress already correlates a private SDK token; never accept raw notifications here. */
|
|
27
|
+
export declare function currentRequestProgress(): ((progress: unknown) => void) | undefined;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=requestProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CA8ClF"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const progressSchema = z.object({
|
|
4
|
+
progress: z.number().finite(),
|
|
5
|
+
total: z.number().finite().optional(),
|
|
6
|
+
message: z.string().max(4096).optional(),
|
|
7
|
+
});
|
|
8
|
+
const maxPending = 64;
|
|
9
|
+
const maxPendingBytes = 256 * 1024;
|
|
10
|
+
const owners = new AsyncLocalStorage();
|
|
11
|
+
async function drain(owner) {
|
|
12
|
+
if (owner.signal?.aborted)
|
|
13
|
+
return;
|
|
14
|
+
let timer;
|
|
15
|
+
let abort;
|
|
16
|
+
try {
|
|
17
|
+
await Promise.race([
|
|
18
|
+
owner.tail,
|
|
19
|
+
new Promise((resolve) => {
|
|
20
|
+
timer = setTimeout(resolve, 1000);
|
|
21
|
+
abort = resolve;
|
|
22
|
+
owner.signal?.addEventListener('abort', abort, { once: true });
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
if (timer)
|
|
28
|
+
clearTimeout(timer);
|
|
29
|
+
if (abort)
|
|
30
|
+
owner.signal?.removeEventListener('abort', abort);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Retain an opaque scalar token exactly; it never becomes an upstream request token. */
|
|
34
|
+
export function requestProgressToken(value) {
|
|
35
|
+
if (typeof value === 'number')
|
|
36
|
+
return Number.isFinite(value) ? value : undefined;
|
|
37
|
+
if (typeof value !== 'string' || Buffer.byteLength(value) > 1024)
|
|
38
|
+
return undefined;
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
/** One inbound exchange owns a bounded delivery queue, independently of any SDK request id. */
|
|
42
|
+
export async function withRequestProgress(token, send, operation, signal, assertCurrent) {
|
|
43
|
+
const validated = requestProgressToken(token);
|
|
44
|
+
if (validated === undefined)
|
|
45
|
+
return owners.run(undefined, operation);
|
|
46
|
+
const owner = {
|
|
47
|
+
accepting: true,
|
|
48
|
+
active: true,
|
|
49
|
+
pending: 0,
|
|
50
|
+
bytes: 0,
|
|
51
|
+
tail: Promise.resolve(),
|
|
52
|
+
token: validated,
|
|
53
|
+
send,
|
|
54
|
+
signal,
|
|
55
|
+
assertCurrent,
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
return await owners.run(owner, async () => {
|
|
59
|
+
signal?.throwIfAborted();
|
|
60
|
+
const result = await operation();
|
|
61
|
+
owner.accepting = false;
|
|
62
|
+
// Optional progress cannot change an already completed operation's outcome.
|
|
63
|
+
await drain(owner);
|
|
64
|
+
return result;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
owner.accepting = false;
|
|
69
|
+
owner.active = false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** SDK onprogress already correlates a private SDK token; never accept raw notifications here. */
|
|
73
|
+
export function currentRequestProgress() {
|
|
74
|
+
const owner = owners.getStore();
|
|
75
|
+
if (!owner?.active)
|
|
76
|
+
return undefined;
|
|
77
|
+
return (progress) => {
|
|
78
|
+
if (!owner.accepting || !owner.active || owner.signal?.aborted || owner.failure !== undefined)
|
|
79
|
+
return;
|
|
80
|
+
if (typeof progress !== 'object' || progress === null)
|
|
81
|
+
return;
|
|
82
|
+
let parsed;
|
|
83
|
+
try {
|
|
84
|
+
const values = Object.fromEntries(['progress', 'total', 'message'].flatMap((key) => {
|
|
85
|
+
const descriptor = Object.getOwnPropertyDescriptor(progress, key);
|
|
86
|
+
if (!descriptor)
|
|
87
|
+
return [];
|
|
88
|
+
if (!('value' in descriptor))
|
|
89
|
+
throw new Error('Invalid progress field');
|
|
90
|
+
return [[key, descriptor.value]];
|
|
91
|
+
}));
|
|
92
|
+
parsed = progressSchema.safeParse(values);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (!parsed.success)
|
|
98
|
+
return;
|
|
99
|
+
const notification = {
|
|
100
|
+
method: 'notifications/progress',
|
|
101
|
+
params: { ...parsed.data, progressToken: owner.token },
|
|
102
|
+
};
|
|
103
|
+
const bytes = Buffer.byteLength(JSON.stringify(notification));
|
|
104
|
+
if (owner.pending >= maxPending || owner.bytes + bytes > maxPendingBytes) {
|
|
105
|
+
owner.failure = new Error('Request progress delivery capacity exceeded');
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
owner.pending++;
|
|
109
|
+
owner.bytes += bytes;
|
|
110
|
+
owner.tail = owner.tail
|
|
111
|
+
.then(async () => {
|
|
112
|
+
if (!owner.active || owner.signal?.aborted || owner.failure !== undefined)
|
|
113
|
+
return;
|
|
114
|
+
owner.assertCurrent?.();
|
|
115
|
+
await owner.send(notification);
|
|
116
|
+
})
|
|
117
|
+
.catch((error) => {
|
|
118
|
+
owner.failure ??= error;
|
|
119
|
+
})
|
|
120
|
+
.finally(() => {
|
|
121
|
+
owner.pending--;
|
|
122
|
+
owner.bytes -= bytes;
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=requestProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestProgress.js","sourceRoot":"","sources":["../../../src/sdk/contracts/requestProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE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C,6CAA6C,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC;QACrB,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;aACpB,IAAI,CAAC,KAAK,IAAI,EAAE;YACf,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;gBAAE,OAAO;YAClF,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC;YACxB,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACjC,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACxB,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC;QAC1B,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,KAAK,CAAC,OAAO,EAAE,CAAC;YAChB,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,98 +1,91 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
* OAuth client configuration for connecting to downstream MCP servers
|
|
5
|
-
*/
|
|
1
|
+
import { type OAuthAuthorityContext } from '../../../auth/oauthAuthority.js';
|
|
2
|
+
import type { OAuthClientProvider, OAuthDiscoveryState } from '../client/auth.js';
|
|
3
|
+
import { type OAuthClientInformationFull, type OAuthClientMetadata, type OAuthTokens } from '../shared/auth.js';
|
|
6
4
|
export interface OAuthClientConfig {
|
|
7
5
|
clientId?: string;
|
|
8
6
|
clientSecret?: string;
|
|
9
7
|
scopes?: string[];
|
|
10
8
|
redirectUrl: string;
|
|
9
|
+
issuer?: string;
|
|
10
|
+
clientMetadataUrl?: string;
|
|
11
|
+
autoRegister?: boolean;
|
|
12
|
+
credentialAuthority?: string;
|
|
13
|
+
authority?: OAuthAuthorityContext;
|
|
14
|
+
legacy?: boolean;
|
|
11
15
|
}
|
|
12
|
-
/**
|
|
13
|
-
* SDK-compatible OAuth client provider that replaces the custom implementation.
|
|
14
|
-
*
|
|
15
|
-
* This provider implements the OAuth 2.1 Authorization Code Grant flow using
|
|
16
|
-
* the SDK's OAuthClientProvider interface while maintaining compatibility with
|
|
17
|
-
* the existing session storage system.
|
|
18
|
-
*/
|
|
16
|
+
/** Shared by the released modern and legacy SDK adapters. SDK cache objects are never authority. */
|
|
19
17
|
export declare class SDKOAuthClientProvider implements OAuthClientProvider {
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private
|
|
18
|
+
private readonly serverName;
|
|
19
|
+
private readonly config;
|
|
20
|
+
private readonly sessionRepository;
|
|
21
|
+
private readonly fileStorage;
|
|
22
|
+
private readonly context?;
|
|
23
|
+
private readonly slot?;
|
|
24
|
+
private record?;
|
|
25
|
+
private readonly verifiers;
|
|
26
|
+
private readonly callbacks;
|
|
27
|
+
private authorizationAttempt?;
|
|
28
|
+
private callbackTail;
|
|
29
|
+
private readonly operations;
|
|
30
|
+
private sseEndpoint?;
|
|
31
|
+
private readonly tokenRequests;
|
|
32
|
+
private readonly tokenResponses;
|
|
33
|
+
private readonly registrationResponses;
|
|
34
|
+
private readonly discoveryResponses;
|
|
35
|
+
private readonly responseKey;
|
|
36
|
+
private readonly migration;
|
|
37
|
+
private readonly shutdownSignal;
|
|
38
|
+
private claim?;
|
|
39
|
+
readonly fetch: typeof fetch;
|
|
30
40
|
constructor(serverName: string, config: OAuthClientConfig, sessionStoragePath?: string);
|
|
31
41
|
get redirectUrl(): string;
|
|
42
|
+
get clientMetadataUrl(): string | undefined;
|
|
32
43
|
get clientMetadata(): OAuthClientMetadata;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
tokens
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
invalidateCredentials(scope: 'all' | 'client' | 'tokens' | 'verifier' | 'discovery'): void;
|
|
53
|
-
/**
|
|
54
|
-
* Stores authorization URL instead of prompting user in console
|
|
55
|
-
*/
|
|
56
|
-
redirectToAuthorization(authorizationUrl: URL): void;
|
|
57
|
-
/**
|
|
58
|
-
* Gets the current authorization URL
|
|
59
|
-
*/
|
|
44
|
+
clientInformation(ctx?: {
|
|
45
|
+
issuer: string;
|
|
46
|
+
}): (OAuthClientInformationFull & {
|
|
47
|
+
issuer?: string;
|
|
48
|
+
}) | undefined;
|
|
49
|
+
saveClientInformation(clientInfo: OAuthClientInformationFull, ctx?: {
|
|
50
|
+
issuer: string;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
tokens(ctx?: {
|
|
53
|
+
issuer: string;
|
|
54
|
+
}): OAuthTokens | undefined;
|
|
55
|
+
saveTokens(tokens: OAuthTokens, ctx?: {
|
|
56
|
+
issuer: string;
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
invalidateCredentials(scope: 'all' | 'client' | 'tokens' | 'verifier' | 'discovery'): Promise<void>;
|
|
59
|
+
state(): string;
|
|
60
|
+
saveCodeVerifier(verifier: string): void;
|
|
61
|
+
codeVerifier(): string;
|
|
62
|
+
redirectToAuthorization(url: URL): Promise<void>;
|
|
60
63
|
getAuthorizationUrl(): string | undefined;
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
*/
|
|
64
|
+
/** Only a live, unconsumed attempt owned by this provider can be resumed. */
|
|
65
|
+
getPendingAuthorizationUrl(): string | undefined;
|
|
64
66
|
clearAuthorizationUrl(): void;
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
private
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
private persistAllData;
|
|
89
|
-
/**
|
|
90
|
-
* Check if OAuth tokens are expired
|
|
91
|
-
*/
|
|
92
|
-
private isTokenExpired;
|
|
93
|
-
/**
|
|
94
|
-
* Clean up resources
|
|
95
|
-
*/
|
|
96
|
-
shutdown(): void;
|
|
67
|
+
/** Validation and durable consumption happen before the SDK can see a code, for both eras. */
|
|
68
|
+
withAuthorizationCallback<T>(response: URLSearchParams, operation: () => Promise<T>): Promise<T>;
|
|
69
|
+
bindAdminReturn(state: string, origin: string): Promise<void>;
|
|
70
|
+
getAdminReturn(state: string): string | undefined;
|
|
71
|
+
validateResourceURL(serverUrl: string | URL, resource?: string): Promise<URL>;
|
|
72
|
+
private selectResourceURL;
|
|
73
|
+
discoveryState(): OAuthDiscoveryState | undefined;
|
|
74
|
+
saveDiscoveryState(state: OAuthDiscoveryState): Promise<void>;
|
|
75
|
+
private current;
|
|
76
|
+
private requireCurrent;
|
|
77
|
+
private checkIssuer;
|
|
78
|
+
private assertScopes;
|
|
79
|
+
private validateMetadata;
|
|
80
|
+
private prepareFetch;
|
|
81
|
+
private responseMap;
|
|
82
|
+
private advanceOperation;
|
|
83
|
+
private rejectOperation;
|
|
84
|
+
private assertOperation;
|
|
85
|
+
private reserveRequest;
|
|
86
|
+
private responseDigest;
|
|
87
|
+
private discoveryKey;
|
|
88
|
+
private recordResponse;
|
|
89
|
+
shutdown(): Promise<void>;
|
|
97
90
|
}
|
|
98
91
|
//# sourceMappingURL=sdkOAuthClientProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkOAuthClientProvider.d.ts","sourceRoot":"","sources":["../../../../src/sdk/legacy/auth/sdkOAuthClientProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sdkOAuthClientProvider.d.ts","sourceRoot":"","sources":["../../../../src/sdk/legacy/auth/sdkOAuthClientProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,qBAAqB,EAK3B,MAAM,6BAA6B,CAAC;AAMrC,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,OAAO,EACL,KAAK,0BAA0B,EAE/B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEjB,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AASD,oGAAoG;AACpG,qBAAa,sBAAuB,YAAW,mBAAmB;IA+B9D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IA/BzB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA0B;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAwB;IACjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAC/B,OAAO,CAAC,MAAM,CAAC,CAAqB;IACpC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