@1mcp/agent 0.38.2 → 0.39.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/admin/assets/{admin-OAuthServicesWorkspace-BnEBXa_2.js → admin-OAuthServicesWorkspace-Bmets2jv.js} +1 -1
- package/build/admin/assets/{admin-console-5rVJC_G2.js → admin-console-DyzxXXr5.js} +3 -3
- package/build/admin/index.html +1 -1
- package/build/commands/run/run.d.ts.map +1 -1
- package/build/commands/run/run.js +35 -14
- package/build/commands/run/run.js.map +1 -1
- package/build/commands/run/runUtils.d.ts +2 -3
- package/build/commands/run/runUtils.d.ts.map +1 -1
- package/build/commands/run/runUtils.js +12 -11
- package/build/commands/run/runUtils.js.map +1 -1
- package/build/commands/serve/cooperativeRuntime.d.ts +18 -0
- package/build/commands/serve/cooperativeRuntime.d.ts.map +1 -0
- package/build/commands/serve/cooperativeRuntime.js +588 -0
- package/build/commands/serve/cooperativeRuntime.js.map +1 -0
- package/build/commands/serve/index.d.ts +10 -0
- package/build/commands/serve/index.d.ts.map +1 -1
- package/build/commands/serve/index.js +10 -0
- package/build/commands/serve/index.js.map +1 -1
- package/build/commands/serve/serveStatus.d.ts +2 -0
- package/build/commands/serve/serveStatus.d.ts.map +1 -1
- package/build/commands/serve/serveStatus.js +37 -9
- package/build/commands/serve/serveStatus.js.map +1 -1
- package/build/commands/serve/serveStop.d.ts.map +1 -1
- package/build/commands/serve/serveStop.js +14 -9
- package/build/commands/serve/serveStop.js.map +1 -1
- package/build/commands/shared/apiClient.d.ts.map +1 -1
- package/build/commands/shared/apiClient.js +13 -9
- package/build/commands/shared/apiClient.js.map +1 -1
- package/build/commands/shared/clientSurfaceAttachment.d.ts.map +1 -1
- package/build/commands/shared/clientSurfaceAttachment.js +33 -7
- package/build/commands/shared/clientSurfaceAttachment.js.map +1 -1
- package/build/config/configLoader.d.ts.map +1 -1
- package/build/config/configLoader.js +9 -1
- package/build/config/configLoader.js.map +1 -1
- package/build/config/configManager.d.ts +4 -0
- package/build/config/configManager.d.ts.map +1 -1
- package/build/config/configManager.js +48 -1
- 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 +6 -5
- package/build/config/envProcessor.js.map +1 -1
- package/build/config/mcpConfigManager.d.ts +4 -0
- package/build/config/mcpConfigManager.d.ts.map +1 -1
- package/build/config/mcpConfigManager.js +48 -1
- package/build/config/mcpConfigManager.js.map +1 -1
- package/build/config/runtimeBootstrap.d.ts +15 -0
- package/build/config/runtimeBootstrap.d.ts.map +1 -0
- package/build/config/runtimeBootstrap.js +35 -0
- package/build/config/runtimeBootstrap.js.map +1 -0
- package/build/config/runtimeScopeEnv.d.ts.map +1 -1
- package/build/config/runtimeScopeEnv.js +4 -0
- package/build/config/runtimeScopeEnv.js.map +1 -1
- package/build/config/runtimeTargetFingerprint.d.ts.map +1 -1
- package/build/config/runtimeTargetFingerprint.js +5 -2
- package/build/config/runtimeTargetFingerprint.js.map +1 -1
- package/build/constants/mcp.d.ts +1 -1
- package/build/constants/mcp.d.ts.map +1 -1
- package/build/constants/mcp.js +1 -1
- package/build/constants/mcp.js.map +1 -1
- package/build/core/capabilities/asyncLoadingOrchestrator.d.ts +2 -1
- package/build/core/capabilities/asyncLoadingOrchestrator.d.ts.map +1 -1
- package/build/core/capabilities/asyncLoadingOrchestrator.js +2 -21
- package/build/core/capabilities/asyncLoadingOrchestrator.js.map +1 -1
- package/build/core/capabilities/capabilityAggregator.d.ts.map +1 -1
- package/build/core/capabilities/capabilityAggregator.js +12 -4
- package/build/core/capabilities/capabilityAggregator.js.map +1 -1
- package/build/core/capabilities/capabilityCatalog.d.ts +2 -1
- package/build/core/capabilities/capabilityCatalog.d.ts.map +1 -1
- package/build/core/capabilities/capabilityCatalog.js +94 -17
- package/build/core/capabilities/capabilityCatalog.js.map +1 -1
- package/build/core/capabilities/capabilityPagination.d.ts +11 -0
- package/build/core/capabilities/capabilityPagination.d.ts.map +1 -1
- package/build/core/capabilities/capabilityPagination.js +158 -40
- package/build/core/capabilities/capabilityPagination.js.map +1 -1
- package/build/core/capabilities/catalogGeneration.d.ts.map +1 -1
- package/build/core/capabilities/catalogGeneration.js +8 -2
- package/build/core/capabilities/catalogGeneration.js.map +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts.map +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.js +8 -8
- package/build/core/capabilities/lazyLoadingOrchestrator.js.map +1 -1
- package/build/core/capabilities/metaToolProvider.d.ts +2 -2
- package/build/core/capabilities/metaToolProvider.d.ts.map +1 -1
- package/build/core/capabilities/metaToolProvider.js +20 -30
- package/build/core/capabilities/metaToolProvider.js.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts +8 -0
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.js +249 -64
- package/build/core/capabilities/runtimeCapabilityCatalog.js.map +1 -1
- package/build/core/capabilities/schemaCache.d.ts +6 -2
- package/build/core/capabilities/schemaCache.d.ts.map +1 -1
- package/build/core/capabilities/schemaCache.js +101 -19
- package/build/core/capabilities/schemaCache.js.map +1 -1
- package/build/core/client/legacyAdapterRequest.d.ts.map +1 -1
- package/build/core/client/legacyAdapterRequest.js +25 -21
- package/build/core/client/legacyAdapterRequest.js.map +1 -1
- package/build/core/client/postAuthOAuthRecovery.d.ts.map +1 -1
- package/build/core/client/postAuthOAuthRecovery.js +3 -1
- package/build/core/client/postAuthOAuthRecovery.js.map +1 -1
- package/build/core/configChangeHandler.d.ts.map +1 -1
- package/build/core/configChangeHandler.js +11 -2
- package/build/core/configChangeHandler.js.map +1 -1
- package/build/core/context/templateContextTrust.d.ts +3 -1
- package/build/core/context/templateContextTrust.d.ts.map +1 -1
- package/build/core/context/templateContextTrust.js +22 -6
- package/build/core/context/templateContextTrust.js.map +1 -1
- package/build/core/loading/mcpLoadingManager.d.ts +3 -0
- package/build/core/loading/mcpLoadingManager.d.ts.map +1 -1
- package/build/core/loading/mcpLoadingManager.js +11 -1
- package/build/core/loading/mcpLoadingManager.js.map +1 -1
- package/build/core/protocol/resourceTemplateRouting.d.ts +2 -0
- package/build/core/protocol/resourceTemplateRouting.d.ts.map +1 -0
- package/build/core/protocol/resourceTemplateRouting.js +2 -0
- package/build/core/protocol/resourceTemplateRouting.js.map +1 -0
- package/build/core/server/backgroundRuntimeSupervisor.d.ts +2 -0
- package/build/core/server/backgroundRuntimeSupervisor.d.ts.map +1 -1
- package/build/core/server/backgroundRuntimeSupervisor.js +11 -2
- package/build/core/server/backgroundRuntimeSupervisor.js.map +1 -1
- package/build/core/server/backgroundRuntimeSupervisorState.d.ts +2 -1
- package/build/core/server/backgroundRuntimeSupervisorState.d.ts.map +1 -1
- package/build/core/server/backgroundRuntimeSupervisorState.js +3 -2
- package/build/core/server/backgroundRuntimeSupervisorState.js.map +1 -1
- package/build/core/server/pidFileManager.d.ts +35 -0
- package/build/core/server/pidFileManager.d.ts.map +1 -1
- package/build/core/server/pidFileManager.js +16 -5
- package/build/core/server/pidFileManager.js.map +1 -1
- package/build/core/server/processIdentity.d.ts +3 -0
- package/build/core/server/processIdentity.d.ts.map +1 -1
- package/build/core/server/processIdentity.js +69 -17
- package/build/core/server/processIdentity.js.map +1 -1
- package/build/core/server/runtimeControl.d.ts +31 -0
- package/build/core/server/runtimeControl.d.ts.map +1 -0
- package/build/core/server/runtimeControl.js +288 -0
- package/build/core/server/runtimeControl.js.map +1 -0
- package/build/core/server/runtimeDrain.d.ts +68 -0
- package/build/core/server/runtimeDrain.d.ts.map +1 -0
- package/build/core/server/runtimeDrain.js +248 -0
- package/build/core/server/runtimeDrain.js.map +1 -0
- package/build/core/server/runtimeLaunchIpc.d.ts +285 -0
- package/build/core/server/runtimeLaunchIpc.d.ts.map +1 -0
- package/build/core/server/runtimeLaunchIpc.js +146 -0
- package/build/core/server/runtimeLaunchIpc.js.map +1 -0
- package/build/core/server/runtimeLifecycle.d.ts +3 -1
- package/build/core/server/runtimeLifecycle.d.ts.map +1 -1
- package/build/core/server/runtimeLifecycle.js +7 -8
- package/build/core/server/runtimeLifecycle.js.map +1 -1
- package/build/core/server/runtimeReplacementConfig.d.ts +295 -0
- package/build/core/server/runtimeReplacementConfig.d.ts.map +1 -0
- package/build/core/server/runtimeReplacementConfig.js +187 -0
- package/build/core/server/runtimeReplacementConfig.js.map +1 -0
- 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 +23 -4
- package/build/core/server/runtimeScopeOwnership.js.map +1 -1
- package/build/core/tools/internal/discoveryHandlers.d.ts.map +1 -1
- package/build/core/tools/internal/discoveryHandlers.js +8 -6
- package/build/core/tools/internal/discoveryHandlers.js.map +1 -1
- package/build/core/tools/internal/installationHandlers.d.ts.map +1 -1
- package/build/core/tools/internal/installationHandlers.js +46 -39
- package/build/core/tools/internal/installationHandlers.js.map +1 -1
- package/build/core/types/server.d.ts +2 -0
- package/build/core/types/server.d.ts.map +1 -1
- package/build/core/types/transport.d.ts +1 -1
- package/build/core/validation/schemaBoundary.d.ts +51 -0
- package/build/core/validation/schemaBoundary.d.ts.map +1 -0
- package/build/core/validation/schemaBoundary.js +237 -0
- package/build/core/validation/schemaBoundary.js.map +1 -0
- package/build/core/validation/schemaPolicy.d.ts +38 -0
- package/build/core/validation/schemaPolicy.d.ts.map +1 -0
- package/build/core/validation/schemaPolicy.js +127 -0
- package/build/core/validation/schemaPolicy.js.map +1 -0
- package/build/core/validation/schemaWorker.d.ts +2 -0
- package/build/core/validation/schemaWorker.d.ts.map +1 -0
- package/build/core/validation/schemaWorker.js +222 -0
- package/build/core/validation/schemaWorker.js.map +1 -0
- package/build/core/validation/toolSchemaBoundary.d.ts +19 -0
- package/build/core/validation/toolSchemaBoundary.d.ts.map +1 -0
- package/build/core/validation/toolSchemaBoundary.js +51 -0
- package/build/core/validation/toolSchemaBoundary.js.map +1 -0
- package/build/domains/admin/adminOperationService.d.ts +1 -0
- package/build/domains/admin/adminOperationService.d.ts.map +1 -1
- package/build/domains/admin/adminOperationService.js +4 -0
- package/build/domains/admin/adminOperationService.js.map +1 -1
- package/build/domains/config-change/configChange.d.ts.map +1 -1
- package/build/domains/config-change/configChange.js +36 -8
- package/build/domains/config-change/configChange.js.map +1 -1
- package/build/domains/installation/serverInstallationWorkflow.d.ts.map +1 -1
- package/build/domains/installation/serverInstallationWorkflow.js +21 -12
- package/build/domains/installation/serverInstallationWorkflow.js.map +1 -1
- package/build/domains/preset/manager/presetManager.d.ts.map +1 -1
- package/build/domains/preset/manager/presetManager.js +2 -1
- package/build/domains/preset/manager/presetManager.js.map +1 -1
- package/build/domains/registry/mcpRegistryClient.d.ts.map +1 -1
- package/build/domains/registry/mcpRegistryClient.js +10 -3
- package/build/domains/registry/mcpRegistryClient.js.map +1 -1
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.d.ts +2 -1
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.d.ts.map +1 -1
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.js +77 -3
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.js.map +1 -1
- package/build/gateway/contracts/gatewayFailure.d.ts +38 -0
- package/build/gateway/contracts/gatewayFailure.d.ts.map +1 -1
- package/build/gateway/contracts/gatewayFailure.js +137 -20
- package/build/gateway/contracts/gatewayFailure.js.map +1 -1
- package/build/gateway/core/gatewayDispatcher.d.ts +4 -0
- package/build/gateway/core/gatewayDispatcher.d.ts.map +1 -1
- package/build/gateway/core/gatewayDispatcher.js +35 -3
- package/build/gateway/core/gatewayDispatcher.js.map +1 -1
- package/build/gateway/interactions/interactionBroker.d.ts +29 -0
- package/build/gateway/interactions/interactionBroker.d.ts.map +1 -0
- package/build/gateway/interactions/interactionBroker.js +244 -0
- package/build/gateway/interactions/interactionBroker.js.map +1 -0
- package/build/gateway/interactions/interactionCapabilities.d.ts +4 -0
- package/build/gateway/interactions/interactionCapabilities.d.ts.map +1 -0
- package/build/gateway/interactions/interactionCapabilities.js +36 -0
- package/build/gateway/interactions/interactionCapabilities.js.map +1 -0
- package/build/gateway/interactions/interactionOwner.d.ts +45 -0
- package/build/gateway/interactions/interactionOwner.d.ts.map +1 -0
- package/build/gateway/interactions/interactionOwner.js +203 -0
- package/build/gateway/interactions/interactionOwner.js.map +1 -0
- package/build/gateway/interactions/interactionRoute.d.ts +16 -0
- package/build/gateway/interactions/interactionRoute.d.ts.map +1 -0
- package/build/gateway/interactions/interactionRoute.js +41 -0
- package/build/gateway/interactions/interactionRoute.js.map +1 -0
- package/build/gateway/interactions/validateInteractionResponse.d.ts +6 -0
- package/build/gateway/interactions/validateInteractionResponse.d.ts.map +1 -0
- package/build/gateway/interactions/validateInteractionResponse.js +175 -0
- package/build/gateway/interactions/validateInteractionResponse.js.map +1 -0
- package/build/gateway/ports/outboundEraAdapter.d.ts +10 -1
- package/build/gateway/ports/outboundEraAdapter.d.ts.map +1 -1
- package/build/sdk/contracts/legacySdkAdapter.d.ts +5 -0
- package/build/sdk/contracts/legacySdkAdapter.d.ts.map +1 -1
- package/build/sdk/contracts/protocol.d.ts +3 -3
- package/build/sdk/contracts/protocol.d.ts.map +1 -1
- package/build/sdk/contracts/protocol.js +3 -2
- package/build/sdk/contracts/protocol.js.map +1 -1
- package/build/sdk/legacy/client/runtime/backendDispatchLifetime.d.ts +8 -0
- package/build/sdk/legacy/client/runtime/backendDispatchLifetime.d.ts.map +1 -0
- package/build/sdk/legacy/client/runtime/backendDispatchLifetime.js +63 -0
- package/build/sdk/legacy/client/runtime/backendDispatchLifetime.js.map +1 -0
- package/build/sdk/legacy/client/runtime/clientFactory.d.ts +4 -1
- package/build/sdk/legacy/client/runtime/clientFactory.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/clientFactory.js +41 -14
- package/build/sdk/legacy/client/runtime/clientFactory.js.map +1 -1
- package/build/sdk/legacy/client/runtime/clientManager.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/clientManager.js +20 -7
- package/build/sdk/legacy/client/runtime/clientManager.js.map +1 -1
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.d.ts +8 -0
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.d.ts.map +1 -0
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.js +44 -0
- package/build/sdk/legacy/client/runtime/legacyInteractionLease.js.map +1 -0
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts +4 -0
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js +20 -0
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js.map +1 -1
- package/build/sdk/legacy/client/runtime/legacyTransport.d.ts +2 -0
- package/build/sdk/legacy/client/runtime/legacyTransport.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts +3 -0
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js +98 -4
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js.map +1 -1
- package/build/sdk/legacy/commands/serve.d.ts +2 -0
- package/build/sdk/legacy/commands/serve.d.ts.map +1 -1
- package/build/sdk/legacy/commands/serve.js +40 -9
- 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 +19 -47
- package/build/sdk/legacy/server/protocol/notificationHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.d.ts +7 -0
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.d.ts.map +1 -0
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.js +134 -0
- package/build/sdk/legacy/server/protocol/privateInteractionConnection.js.map +1 -0
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.js +4 -3
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/requestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/requestHandlers.js +5 -47
- package/build/sdk/legacy/server/protocol/requestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/requestInteractionScope.d.ts +17 -0
- package/build/sdk/legacy/server/protocol/requestInteractionScope.d.ts.map +1 -0
- package/build/sdk/legacy/server/protocol/requestInteractionScope.js +223 -0
- package/build/sdk/legacy/server/protocol/requestInteractionScope.js.map +1 -0
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js +3 -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 +72 -17
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.js +3 -0
- package/build/sdk/legacy/server/runtime/connectionManager.js.map +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.d.ts +2 -0
- package/build/sdk/legacy/server/runtime/serverManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.js +35 -8
- package/build/sdk/legacy/server/runtime/serverManager.js.map +1 -1
- package/build/sdk/legacy/shared/capabilityListCapture.d.ts.map +1 -1
- package/build/sdk/legacy/shared/capabilityListCapture.js +3 -0
- package/build/sdk/legacy/shared/capabilityListCapture.js.map +1 -1
- package/build/sdk/legacy/shared/schemaProjection.d.ts +11 -0
- package/build/sdk/legacy/shared/schemaProjection.d.ts.map +1 -0
- package/build/sdk/legacy/shared/schemaProjection.js +45 -0
- package/build/sdk/legacy/shared/schemaProjection.js.map +1 -0
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.d.ts +2 -0
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js +31 -0
- package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js.map +1 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts +7 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js +29 -4
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js.map +1 -1
- package/build/sdk/legacy/transport/http/server.d.ts +1 -1
- package/build/sdk/legacy/transport/http/server.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/server.js +2 -1
- 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 +4 -3
- package/build/sdk/legacy/transport/transportFactory.js.map +1 -1
- package/build/sdk/legacy/validation/CustomJsonSchemaValidator.d.ts +4 -52
- package/build/sdk/legacy/validation/CustomJsonSchemaValidator.d.ts.map +1 -1
- package/build/sdk/legacy/validation/CustomJsonSchemaValidator.js +5 -311
- package/build/sdk/legacy/validation/CustomJsonSchemaValidator.js.map +1 -1
- package/build/server.d.ts +2 -2
- package/build/server.d.ts.map +1 -1
- package/build/server.js +8 -6
- package/build/server.js.map +1 -1
- package/build/transport/http/routes/adminRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/adminRoutes.js +37 -0
- package/build/transport/http/routes/adminRoutes.js.map +1 -1
- package/build/transport/http/routes/inspectRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/inspectRoutes.js +77 -85
- package/build/transport/http/routes/inspectRoutes.js.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.d.ts +7 -1
- package/build/transport/http/routes/modernHttpRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.js +121 -16
- package/build/transport/http/routes/modernHttpRoutes.js.map +1 -1
- package/build/transport/http/routes/modernInteractionBinding.d.ts +14 -0
- package/build/transport/http/routes/modernInteractionBinding.d.ts.map +1 -0
- package/build/transport/http/routes/modernInteractionBinding.js +142 -0
- package/build/transport/http/routes/modernInteractionBinding.js.map +1 -0
- package/build/transport/http/routes/toolRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/toolRoutes.js +123 -27
- package/build/transport/http/routes/toolRoutes.js.map +1 -1
- package/build/transport/http/utils/contextExtractor.d.ts.map +1 -1
- package/build/transport/http/utils/contextExtractor.js +29 -0
- package/build/transport/http/utils/contextExtractor.js.map +1 -1
- package/build/utils/core/errorHandling.d.ts.map +1 -1
- package/build/utils/core/errorHandling.js +19 -4
- package/build/utils/core/errorHandling.js.map +1 -1
- package/build/utils/filePermissions.d.ts +3 -0
- package/build/utils/filePermissions.d.ts.map +1 -1
- package/build/utils/filePermissions.js +10 -0
- package/build/utils/filePermissions.js.map +1 -1
- package/build/utils/validation/urlDetection.d.ts.map +1 -1
- package/build/utils/validation/urlDetection.js +42 -2
- package/build/utils/validation/urlDetection.js.map +1 -1
- package/build/utils/watchPath.d.ts +3 -0
- package/build/utils/watchPath.d.ts.map +1 -0
- package/build/utils/watchPath.js +7 -0
- package/build/utils/watchPath.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { loadRuntimeScopeEnvironment } from '../../config/runtimeScopeEnv.js';
|
|
6
|
+
import { MCP_SERVER_VERSION } from '../../constants.js';
|
|
7
|
+
import { RuntimeIdentityService } from '../../core/runtime/runtimeIdentityService.js';
|
|
8
|
+
import { runBackgroundRuntimeSupervisor, } from '../../core/server/backgroundRuntimeSupervisor.js';
|
|
9
|
+
import { cleanupBackgroundSupervisorState, readBackgroundSupervisorState, } from '../../core/server/backgroundRuntimeSupervisorState.js';
|
|
10
|
+
import { cleanupPidFileIfMatches, readPidFile, serverPidInfoSchema, } from '../../core/server/pidFileManager.js';
|
|
11
|
+
import { connectRuntimeControl, startRuntimeControl, } from '../../core/server/runtimeControl.js';
|
|
12
|
+
import { admissionSnapshotSchema, runtimeAdmission, RuntimeReplacementDrain, } from '../../core/server/runtimeDrain.js';
|
|
13
|
+
import { receiveRuntimeBootstrap, requestWorker, sendChild, sendRuntimeParent, waitForChildActivation, } from '../../core/server/runtimeLaunchIpc.js';
|
|
14
|
+
import { probeLoadingSummary, probeReadiness } from '../../core/server/runtimeLifecycle.js';
|
|
15
|
+
import { activateRuntimeReplacementConfig, captureExplicitLaunchInputs, digestRuntimeReplacementConfig, explicitLaunchInputsSchema, installRuntimeReplacementConfig, prepareRuntimeReplacementConfig, } from '../../core/server/runtimeReplacementConfig.js';
|
|
16
|
+
import { claimRuntimeScope, getRuntimeScopeOwnershipPath, readRuntimeScopeOwnership, } from '../../core/server/runtimeScopeOwnership.js';
|
|
17
|
+
import { mcpServerConfigSchema } from '../../core/types/transport.js';
|
|
18
|
+
import { normalizedArgv } from '../../utils/cli/normalizedArgv.js';
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
import { resolveServeConfigPaths } from './runtimeScope.js';
|
|
21
|
+
import { defaultBackgroundLogFile, resolveSelfInvocation } from './serveBackground.js';
|
|
22
|
+
import { parseInternalToolsList } from './serveOptions.js';
|
|
23
|
+
import { resolveTemplateContextTrust } from './templateContextTrust.js';
|
|
24
|
+
const activationSchema = z.object({
|
|
25
|
+
type: z.literal('runtime-activated'),
|
|
26
|
+
nonce: z.string().uuid(),
|
|
27
|
+
claimId: z.string().uuid(),
|
|
28
|
+
digest: z.string(),
|
|
29
|
+
version: z.string(),
|
|
30
|
+
runtime: serverPidInfoSchema,
|
|
31
|
+
});
|
|
32
|
+
function matchesSupervisorActivation(activation, bootstrap, owner, supervisorPid) {
|
|
33
|
+
if (activation.nonce !== bootstrap.nonce)
|
|
34
|
+
return false;
|
|
35
|
+
if (activation.digest !== bootstrap.digest)
|
|
36
|
+
return false;
|
|
37
|
+
if (activation.version !== MCP_SERVER_VERSION)
|
|
38
|
+
return false;
|
|
39
|
+
if (owner?.claimId !== activation.claimId)
|
|
40
|
+
return false;
|
|
41
|
+
return owner.pid === supervisorPid;
|
|
42
|
+
}
|
|
43
|
+
function matchesRunningActivation(description, activation, claimId) {
|
|
44
|
+
if (!description)
|
|
45
|
+
return false;
|
|
46
|
+
if (description.runtime?.pid !== activation.runtime.pid)
|
|
47
|
+
return false;
|
|
48
|
+
if (description.digest !== activation.digest)
|
|
49
|
+
return false;
|
|
50
|
+
if (description.version !== activation.version)
|
|
51
|
+
return false;
|
|
52
|
+
return claimId === activation.claimId;
|
|
53
|
+
}
|
|
54
|
+
function matchesWorkerActivation(activation, launch, workerPid) {
|
|
55
|
+
if (activation.nonce !== launch.nonce)
|
|
56
|
+
return false;
|
|
57
|
+
if (activation.claimId !== launch.claimId)
|
|
58
|
+
return false;
|
|
59
|
+
if (activation.digest !== launch.digest)
|
|
60
|
+
return false;
|
|
61
|
+
if (activation.version !== MCP_SERVER_VERSION)
|
|
62
|
+
return false;
|
|
63
|
+
return activation.runtime.pid === workerPid;
|
|
64
|
+
}
|
|
65
|
+
function isCooperativeParent(owner, claimId) {
|
|
66
|
+
if (!claimId)
|
|
67
|
+
return false;
|
|
68
|
+
if (owner?.claimId !== claimId)
|
|
69
|
+
return false;
|
|
70
|
+
if (owner.kind !== 'background-supervisor')
|
|
71
|
+
return false;
|
|
72
|
+
if (owner.pid !== process.ppid)
|
|
73
|
+
return false;
|
|
74
|
+
return owner.cooperative === true;
|
|
75
|
+
}
|
|
76
|
+
const prepareSchema = z
|
|
77
|
+
.object({ digest: z.string().regex(/^[a-f0-9]{64}$/), timeoutMs: z.number().int().positive().max(86400000) })
|
|
78
|
+
.strict();
|
|
79
|
+
const commitSchema = prepareSchema.pick({ digest: true });
|
|
80
|
+
const statusSchema = z.object({
|
|
81
|
+
operationId: z.string(),
|
|
82
|
+
digest: z.string(),
|
|
83
|
+
state: z.enum(['preparing', 'draining', 'drained', 'committing', 'aborted']),
|
|
84
|
+
deadlineUnixMs: z.number(),
|
|
85
|
+
active: z.number().int().nonnegative(),
|
|
86
|
+
});
|
|
87
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
88
|
+
function assertEmptyScope(scope) {
|
|
89
|
+
for (const name of [
|
|
90
|
+
'runtime.owner',
|
|
91
|
+
'runtime.stop',
|
|
92
|
+
'server.pid',
|
|
93
|
+
'background-runtime.json',
|
|
94
|
+
'background-launch.json',
|
|
95
|
+
'runtime-control.json',
|
|
96
|
+
]) {
|
|
97
|
+
if (fs.existsSync(path.join(scope, name)))
|
|
98
|
+
throw new Error('A runtime already owns this Runtime Scope or ownership is uncertain. Use serve --status and the original CLI or service manager for explicit migration/recovery; no takeover was attempted.');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function prepare(options, previous = { version: 1, values: {} }) {
|
|
102
|
+
const { configFilePath, runtimeScope } = resolveServeConfigPaths(options);
|
|
103
|
+
const prepared = prepareRuntimeReplacementConfig({
|
|
104
|
+
configFilePath,
|
|
105
|
+
runtimeScope,
|
|
106
|
+
previousExplicitInputs: explicitLaunchInputsSchema.parse(previous),
|
|
107
|
+
invocationExplicitInputs: captureExplicitLaunchInputs(normalizedArgv),
|
|
108
|
+
});
|
|
109
|
+
const effective = { ...options, ...prepared.effectiveOptions };
|
|
110
|
+
const app = prepared.snapshot.appConfig;
|
|
111
|
+
if ((effective.transport ?? app.transport) === 'stdio')
|
|
112
|
+
throw new Error('Background runtime requires HTTP transport');
|
|
113
|
+
resolveTemplateContextTrust({
|
|
114
|
+
cliTrust: effective['template-context-trust'],
|
|
115
|
+
configTrust: app.templateContext?.trust,
|
|
116
|
+
host: effective.host ?? app.host ?? '127.0.0.1',
|
|
117
|
+
confirmUntrusted: effective['confirm-untrusted-template-context'] ?? false,
|
|
118
|
+
transport: 'http',
|
|
119
|
+
});
|
|
120
|
+
parseInternalToolsList(effective['internal-tools']);
|
|
121
|
+
return prepared;
|
|
122
|
+
}
|
|
123
|
+
/** Only an empty scope can be launched; the spawned supervisor still performs the atomic claim. */
|
|
124
|
+
export async function launchCooperativeRuntime(options, prepared) {
|
|
125
|
+
const paths = resolveServeConfigPaths(options);
|
|
126
|
+
const runtimeScope = paths.runtimeScope;
|
|
127
|
+
const configFilePath = prepared?.snapshot.configFilePath ?? paths.configFilePath;
|
|
128
|
+
assertEmptyScope(runtimeScope);
|
|
129
|
+
fs.mkdirSync(runtimeScope, { recursive: true, mode: 0o700 });
|
|
130
|
+
if (!fs.existsSync(configFilePath))
|
|
131
|
+
fs.writeFileSync(configFilePath, '{"mcpServers":{}}\n', { flag: 'wx', mode: 0o600 });
|
|
132
|
+
prepared ??= prepare(options);
|
|
133
|
+
const effective = { ...options, ...prepared.effectiveOptions, config: configFilePath, 'config-dir': runtimeScope };
|
|
134
|
+
if ((effective.transport ?? prepared.snapshot.appConfig.transport) === 'stdio')
|
|
135
|
+
throw new Error('Background runtime requires HTTP transport');
|
|
136
|
+
effective.transport = 'http';
|
|
137
|
+
effective['log-file'] ??=
|
|
138
|
+
prepared.snapshot.appConfig.logging?.file ??
|
|
139
|
+
prepared.snapshot.appConfig.logFile ??
|
|
140
|
+
defaultBackgroundLogFile(runtimeScope);
|
|
141
|
+
fs.mkdirSync(path.dirname(effective['log-file']), { recursive: true, mode: 0o700 });
|
|
142
|
+
const { command, baseArgs } = resolveSelfInvocation();
|
|
143
|
+
const child = spawn(command, [...baseArgs, 'serve', '--cooperative-bootstrap=supervisor', '--config', configFilePath], { detached: true, stdio: ['ignore', 'ignore', 'ignore', 'ipc'] });
|
|
144
|
+
const bootstrap = {
|
|
145
|
+
type: 'runtime-bootstrap',
|
|
146
|
+
nonce: randomUUID(),
|
|
147
|
+
digest: prepared.digest,
|
|
148
|
+
snapshot: prepared.snapshot,
|
|
149
|
+
options: effective,
|
|
150
|
+
};
|
|
151
|
+
process.stderr.write(`Starting background runtime supervisor (PID ${child.pid ?? 'pending'})…\n`);
|
|
152
|
+
try {
|
|
153
|
+
const activated = activationSchema.parse(await waitForChildActivation(child, bootstrap));
|
|
154
|
+
const owner = readRuntimeScopeOwnership(runtimeScope);
|
|
155
|
+
if (!matchesSupervisorActivation(activated, bootstrap, owner, child.pid))
|
|
156
|
+
throw new Error('Runtime activation did not match the spawned generation');
|
|
157
|
+
if (child.exitCode !== null || child.signalCode !== null)
|
|
158
|
+
throw new Error('Supervisor exited during activation');
|
|
159
|
+
const summary = await probeLoadingSummary(activated.runtime);
|
|
160
|
+
const control = await connectRuntimeControl(runtimeScope);
|
|
161
|
+
const current = await control?.request('describe');
|
|
162
|
+
if (!matchesRunningActivation(current, activated, control?.descriptor.claimId))
|
|
163
|
+
throw new Error('Worker exited or changed during activation verification');
|
|
164
|
+
if (child.exitCode !== null || child.signalCode !== null)
|
|
165
|
+
throw new Error('Supervisor exited during activation verification');
|
|
166
|
+
process.stdout.write(`Runtime activated (version ${activated.version}).\nBackground runtime started.\nSupervisor PID: ${child.pid}\nRuntime PID: ${activated.runtime.pid}\nGeneration: ${activated.claimId}\nConfiguration: ${activated.digest}\nURL: ${activated.runtime.url}\nBackend health: ${summary ? JSON.stringify(summary) : 'loading or unavailable; see serve --status'}\n`);
|
|
167
|
+
process.exitCode = 0;
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
if (child.connected)
|
|
171
|
+
child.disconnect();
|
|
172
|
+
child.unref();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/** Preflight precedes the first mutation. Lost commit responses are reconciled, never resent. */
|
|
176
|
+
export async function restartCooperativeRuntime(options) {
|
|
177
|
+
const { runtimeScope } = resolveServeConfigPaths(options);
|
|
178
|
+
const client = await connectRuntimeControl(runtimeScope);
|
|
179
|
+
if (!client) {
|
|
180
|
+
assertEmptyScope(runtimeScope);
|
|
181
|
+
await launchCooperativeRuntime(options);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const description = await client.request('describe');
|
|
185
|
+
if (!explicitLaunchInputsSchema.safeParse(description.explicitInputs).success)
|
|
186
|
+
throw new Error('Incompatible runtime: explicit launch provenance is missing. Stop with the original CLI or service manager before activating this installation.');
|
|
187
|
+
const prepared = prepare(options, description.explicitInputs);
|
|
188
|
+
const timeoutMs = (options['drain-timeout'] ?? 30) * 1000;
|
|
189
|
+
prepareSchema.parse({ digest: prepared.digest, timeoutMs });
|
|
190
|
+
const operationId = randomUUID();
|
|
191
|
+
process.stderr.write('Draining background runtime before activation…\n');
|
|
192
|
+
let operation;
|
|
193
|
+
try {
|
|
194
|
+
operation = statusSchema.parse(await client.request('prepare-replacement', { digest: prepared.digest, timeoutMs }, operationId));
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
operation = statusSchema.parse(await client.request('operation-status', {}, operationId));
|
|
198
|
+
}
|
|
199
|
+
while (operation.state === 'draining' || operation.state === 'preparing') {
|
|
200
|
+
await sleep(100);
|
|
201
|
+
operation = statusSchema.parse(await client.request('operation-status', {}, operationId));
|
|
202
|
+
}
|
|
203
|
+
if (operation.state === 'aborted')
|
|
204
|
+
throw new Error('Runtime upgrade aborted at the drain deadline; the old runtime resumed admission');
|
|
205
|
+
if (operation.state !== 'drained')
|
|
206
|
+
throw new Error('Runtime replacement is not ready to commit');
|
|
207
|
+
try {
|
|
208
|
+
await client.request('commit-replacement', { digest: prepared.digest }, operationId);
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// An unreachable control endpoint is not proof of retirement. Exclusive ownership below is authoritative.
|
|
212
|
+
let reconciled;
|
|
213
|
+
try {
|
|
214
|
+
reconciled = statusSchema.parse(await client.request('operation-status', {}, operationId));
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
process.stderr.write('Commit response unavailable; waiting for observed owner retirement.\n');
|
|
218
|
+
}
|
|
219
|
+
if (reconciled && reconciled.state !== 'committing')
|
|
220
|
+
throw new Error('Runtime commit was not accepted; existing owner retained');
|
|
221
|
+
}
|
|
222
|
+
const until = Date.now() + 30_000;
|
|
223
|
+
while (fs.existsSync(getRuntimeScopeOwnershipPath(runtimeScope)) && Date.now() < until) {
|
|
224
|
+
if (readRuntimeScopeOwnership(runtimeScope)?.claimId !== client.descriptor.claimId)
|
|
225
|
+
throw new Error('Another runtime won ownership; replacement not started');
|
|
226
|
+
await sleep(100);
|
|
227
|
+
}
|
|
228
|
+
if (fs.existsSync(getRuntimeScopeOwnershipPath(runtimeScope)))
|
|
229
|
+
throw new Error('Old runtime has not retired. Ownership retained; inspect status for explicit recovery');
|
|
230
|
+
try {
|
|
231
|
+
await launchCooperativeRuntime(options, prepared);
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
throw new Error(`Runtime activation failed after retirement; no rollback was attempted. Retry serve --restart after resolving the cause: ${error instanceof Error ? error.message : 'launch failure'}`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function readCurrentBackendSnapshot(snapshot) {
|
|
238
|
+
try {
|
|
239
|
+
return {
|
|
240
|
+
...snapshot,
|
|
241
|
+
mcpConfig: mcpServerConfigSchema.parse(JSON.parse(fs.readFileSync(snapshot.configFilePath, 'utf8'))),
|
|
242
|
+
runtimeEnvironment: loadRuntimeScopeEnvironment(snapshot.configFilePath),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
throw new Error('Runtime backend configuration is invalid; correct the selected scope before restarting');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
export async function runCooperativeSupervisor() {
|
|
250
|
+
const bootstrap = await receiveRuntimeBootstrap();
|
|
251
|
+
const scope = bootstrap.snapshot.runtimeScope;
|
|
252
|
+
installRuntimeReplacementConfig(bootstrap.snapshot, bootstrap.digest, scope);
|
|
253
|
+
assertEmptyScope(scope);
|
|
254
|
+
const ownership = claimRuntimeScope(scope, { kind: 'background-supervisor', cooperative: true });
|
|
255
|
+
let worker;
|
|
256
|
+
const spawnedWorkerPids = new Set();
|
|
257
|
+
let runtime = null;
|
|
258
|
+
let activated = false;
|
|
259
|
+
let runtimeDigest = bootstrap.digest;
|
|
260
|
+
let stopping = false;
|
|
261
|
+
let failed = false;
|
|
262
|
+
let admissionClosed = false;
|
|
263
|
+
let stop;
|
|
264
|
+
const stopped = new Promise((resolve) => {
|
|
265
|
+
stop = resolve;
|
|
266
|
+
});
|
|
267
|
+
const requestStop = () => {
|
|
268
|
+
stopping = true;
|
|
269
|
+
stop();
|
|
270
|
+
};
|
|
271
|
+
for (const signal of ['SIGTERM', 'SIGINT', 'SIGHUP'])
|
|
272
|
+
process.once(signal, requestStop);
|
|
273
|
+
const requireWorker = () => {
|
|
274
|
+
if (!worker || worker.exitCode !== null || !worker.connected)
|
|
275
|
+
throw new Error('Runtime worker unavailable; ownership retained');
|
|
276
|
+
return worker;
|
|
277
|
+
};
|
|
278
|
+
const activations = new WeakMap();
|
|
279
|
+
const controlWorker = async (action) => {
|
|
280
|
+
const child = requireWorker();
|
|
281
|
+
try {
|
|
282
|
+
const activation = activations.get(child);
|
|
283
|
+
if (!activation)
|
|
284
|
+
throw new Error('Worker private launch authorization is unavailable');
|
|
285
|
+
await activation;
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
if (action === 'resume' && worker !== child)
|
|
289
|
+
return;
|
|
290
|
+
throw error;
|
|
291
|
+
}
|
|
292
|
+
if (worker !== child) {
|
|
293
|
+
if (action === 'resume')
|
|
294
|
+
return;
|
|
295
|
+
throw new Error('Worker changed during replacement preparation');
|
|
296
|
+
}
|
|
297
|
+
return requestWorker(child, action);
|
|
298
|
+
};
|
|
299
|
+
const drain = new RuntimeReplacementDrain({
|
|
300
|
+
close: async () => {
|
|
301
|
+
admissionClosed = true;
|
|
302
|
+
if (!worker)
|
|
303
|
+
return { closed: true, active: 0, committed: false };
|
|
304
|
+
return admissionSnapshotSchema.parse(await controlWorker('close'));
|
|
305
|
+
},
|
|
306
|
+
resume: async () => {
|
|
307
|
+
admissionClosed = false;
|
|
308
|
+
if (worker)
|
|
309
|
+
await controlWorker('resume');
|
|
310
|
+
},
|
|
311
|
+
commit: async () => {
|
|
312
|
+
if (!worker)
|
|
313
|
+
return { closed: admissionClosed, active: 0, committed: true };
|
|
314
|
+
return admissionSnapshotSchema.parse(await controlWorker('commit'));
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
const currentState = () => {
|
|
318
|
+
if (stopping)
|
|
319
|
+
return 'stopping';
|
|
320
|
+
if (failed)
|
|
321
|
+
return 'crash-loop';
|
|
322
|
+
if (admissionClosed)
|
|
323
|
+
return 'draining';
|
|
324
|
+
return readBackgroundSupervisorState(scope)?.status ?? 'starting';
|
|
325
|
+
};
|
|
326
|
+
const control = await startRuntimeControl(scope, ownership.record.claimId, async (method, payload, operationId) => {
|
|
327
|
+
switch (method) {
|
|
328
|
+
case 'describe':
|
|
329
|
+
return {
|
|
330
|
+
runtime,
|
|
331
|
+
runtimeScopeId: new RuntimeIdentityService({ storageDir: scope }).getRuntimeScopeId(),
|
|
332
|
+
version: MCP_SERVER_VERSION,
|
|
333
|
+
explicitInputs: bootstrap.snapshot.explicitInputs,
|
|
334
|
+
digest: runtimeDigest,
|
|
335
|
+
supervisorPid: process.pid,
|
|
336
|
+
state: currentState(),
|
|
337
|
+
};
|
|
338
|
+
case 'prepare-replacement': {
|
|
339
|
+
const input = prepareSchema.parse(payload);
|
|
340
|
+
if (stopping)
|
|
341
|
+
throw new Error('Runtime is retiring');
|
|
342
|
+
return drain.prepare(operationId, input.digest, input.timeoutMs);
|
|
343
|
+
}
|
|
344
|
+
case 'operation-status':
|
|
345
|
+
return drain.status(operationId);
|
|
346
|
+
case 'commit-replacement': {
|
|
347
|
+
const input = commitSchema.parse(payload);
|
|
348
|
+
const result = await drain.commit(operationId, input.digest);
|
|
349
|
+
if (!stopping)
|
|
350
|
+
setImmediate(requestStop);
|
|
351
|
+
return result;
|
|
352
|
+
}
|
|
353
|
+
case 'stop':
|
|
354
|
+
if (!stopping)
|
|
355
|
+
setImmediate(requestStop);
|
|
356
|
+
return { accepted: true };
|
|
357
|
+
}
|
|
358
|
+
}).catch((error) => {
|
|
359
|
+
// No worker has been spawned, so this process can safely release its own failed launch.
|
|
360
|
+
ownership.release();
|
|
361
|
+
throw error;
|
|
362
|
+
});
|
|
363
|
+
const { command, baseArgs } = resolveSelfInvocation();
|
|
364
|
+
try {
|
|
365
|
+
try {
|
|
366
|
+
await runBackgroundRuntimeSupervisor({
|
|
367
|
+
configDir: scope,
|
|
368
|
+
claimId: ownership.record.claimId,
|
|
369
|
+
workerCommand: command,
|
|
370
|
+
workerArgs: [
|
|
371
|
+
...baseArgs,
|
|
372
|
+
'serve',
|
|
373
|
+
'--cooperative-bootstrap=worker',
|
|
374
|
+
'--config',
|
|
375
|
+
bootstrap.snapshot.configFilePath,
|
|
376
|
+
],
|
|
377
|
+
}, {
|
|
378
|
+
waitForStop: () => stopped,
|
|
379
|
+
beforeSpawn: async () => {
|
|
380
|
+
while (admissionClosed && !stopping)
|
|
381
|
+
await sleep(50);
|
|
382
|
+
},
|
|
383
|
+
spawnWorker: (cmd, args) => {
|
|
384
|
+
if (stopping)
|
|
385
|
+
throw new Error('Supervisor is retiring; worker restart refused');
|
|
386
|
+
runtime = null;
|
|
387
|
+
// A later crash restart reads current backend files, as ordinary supervised workers do.
|
|
388
|
+
// Preserve the supervisor's launch options and app settings; only activation freezes backend files.
|
|
389
|
+
const snapshot = activated ? readCurrentBackendSnapshot(bootstrap.snapshot) : bootstrap.snapshot;
|
|
390
|
+
const launch = {
|
|
391
|
+
...bootstrap,
|
|
392
|
+
snapshot,
|
|
393
|
+
digest: digestRuntimeReplacementConfig(snapshot),
|
|
394
|
+
nonce: randomUUID(),
|
|
395
|
+
claimId: ownership.record.claimId,
|
|
396
|
+
};
|
|
397
|
+
const child = spawn(cmd, [...args], { stdio: ['ignore', 'ignore', 'ignore', 'ipc'] });
|
|
398
|
+
worker = child;
|
|
399
|
+
if (child.pid)
|
|
400
|
+
spawnedWorkerPids.add(child.pid);
|
|
401
|
+
const ready = waitForChildActivation(child, launch).then((message) => {
|
|
402
|
+
const value = activationSchema.parse(message);
|
|
403
|
+
if (!matchesWorkerActivation(value, launch, child.pid))
|
|
404
|
+
throw new Error('Worker activation binding failed');
|
|
405
|
+
runtime = value.runtime;
|
|
406
|
+
runtimeDigest = launch.digest;
|
|
407
|
+
if (!activated) {
|
|
408
|
+
if (process.connected)
|
|
409
|
+
sendRuntimeParent({ ...value, nonce: bootstrap.nonce });
|
|
410
|
+
activateRuntimeReplacementConfig(bootstrap.digest);
|
|
411
|
+
activated = true;
|
|
412
|
+
}
|
|
413
|
+
sendChild(child, { type: 'runtime-activation-recorded', digest: launch.digest });
|
|
414
|
+
return true;
|
|
415
|
+
});
|
|
416
|
+
// Keep a rejection handled while the supervisor installs its readiness race.
|
|
417
|
+
void ready.catch(() => undefined);
|
|
418
|
+
activations.set(child, ready);
|
|
419
|
+
child.on('message', (message) => {
|
|
420
|
+
if (worker !== child)
|
|
421
|
+
return;
|
|
422
|
+
if (!message || typeof message !== 'object')
|
|
423
|
+
return;
|
|
424
|
+
if (!('type' in message) || message.type !== 'runtime-admission')
|
|
425
|
+
return;
|
|
426
|
+
if (!('snapshot' in message))
|
|
427
|
+
return;
|
|
428
|
+
const parsed = admissionSnapshotSchema.safeParse(message.snapshot);
|
|
429
|
+
if (parsed.success)
|
|
430
|
+
drain.update(parsed.data);
|
|
431
|
+
});
|
|
432
|
+
child.once('exit', () => {
|
|
433
|
+
if (worker !== child)
|
|
434
|
+
return;
|
|
435
|
+
worker = undefined;
|
|
436
|
+
runtime = null;
|
|
437
|
+
if (drain.workerExited())
|
|
438
|
+
requestStop();
|
|
439
|
+
});
|
|
440
|
+
return child;
|
|
441
|
+
},
|
|
442
|
+
waitForReady: (child) => activations.get(child),
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
// The supervisor loop observes tracked worker close before rejecting. Keep explicit stop available.
|
|
447
|
+
failed = true;
|
|
448
|
+
worker = undefined;
|
|
449
|
+
runtime = null;
|
|
450
|
+
if (drain.workerExited())
|
|
451
|
+
requestStop();
|
|
452
|
+
if (process.connected)
|
|
453
|
+
sendRuntimeParent({ type: 'runtime-failed' });
|
|
454
|
+
await stopped;
|
|
455
|
+
}
|
|
456
|
+
await control.close();
|
|
457
|
+
const retiredRuntime = readPidFile(scope);
|
|
458
|
+
if (retiredRuntime) {
|
|
459
|
+
if (retiredRuntime.ownerClaimId !== ownership.record.claimId || !spawnedWorkerPids.has(retiredRuntime.pid))
|
|
460
|
+
throw new Error('Runtime metadata changed during retirement; ownership retained');
|
|
461
|
+
if (!cleanupPidFileIfMatches(scope, retiredRuntime))
|
|
462
|
+
throw new Error('Runtime metadata cleanup failed; ownership retained');
|
|
463
|
+
}
|
|
464
|
+
if (!cleanupBackgroundSupervisorState(scope, process.pid, ownership.record.claimId))
|
|
465
|
+
throw new Error('Supervisor generation changed during retirement; ownership retained');
|
|
466
|
+
ownership.release();
|
|
467
|
+
}
|
|
468
|
+
finally {
|
|
469
|
+
// Do not release ownership in a failure path unless the tracked worker has retired.
|
|
470
|
+
if (process.connected)
|
|
471
|
+
process.disconnect?.();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
let activationRecorded = false;
|
|
475
|
+
let initialLoadingSettled = false;
|
|
476
|
+
let workerBootstrapDigest;
|
|
477
|
+
function releaseWorkerBootstrap() {
|
|
478
|
+
if (!activationRecorded)
|
|
479
|
+
return;
|
|
480
|
+
if (!initialLoadingSettled)
|
|
481
|
+
return;
|
|
482
|
+
if (!workerBootstrapDigest)
|
|
483
|
+
return;
|
|
484
|
+
const digest = workerBootstrapDigest;
|
|
485
|
+
workerBootstrapDigest = undefined;
|
|
486
|
+
activateRuntimeReplacementConfig(digest);
|
|
487
|
+
}
|
|
488
|
+
export function settleCooperativeInitialLoading() {
|
|
489
|
+
initialLoadingSettled = true;
|
|
490
|
+
releaseWorkerBootstrap();
|
|
491
|
+
}
|
|
492
|
+
export async function authorizeCooperativeWorker() {
|
|
493
|
+
const bootstrap = await receiveRuntimeBootstrap();
|
|
494
|
+
const owner = readRuntimeScopeOwnership(bootstrap.snapshot.runtimeScope);
|
|
495
|
+
if (!isCooperativeParent(owner, bootstrap.claimId))
|
|
496
|
+
throw new Error('Private worker launch does not match scope ownership');
|
|
497
|
+
installRuntimeReplacementConfig(bootstrap.snapshot, bootstrap.digest, bootstrap.snapshot.runtimeScope);
|
|
498
|
+
workerBootstrapDigest = bootstrap.digest;
|
|
499
|
+
const requestSchema = z.object({
|
|
500
|
+
type: z.literal('runtime-request'),
|
|
501
|
+
id: z.string().uuid(),
|
|
502
|
+
action: z.enum(['close', 'resume', 'commit']),
|
|
503
|
+
});
|
|
504
|
+
runtimeAdmission.subscribe((snapshot) => {
|
|
505
|
+
if (process.connected)
|
|
506
|
+
sendRuntimeParent({ type: 'runtime-admission', snapshot });
|
|
507
|
+
});
|
|
508
|
+
process.on('message', (message) => {
|
|
509
|
+
if (!message || typeof message !== 'object')
|
|
510
|
+
return;
|
|
511
|
+
if (!('type' in message))
|
|
512
|
+
return;
|
|
513
|
+
if (message.type === 'runtime-activation-recorded') {
|
|
514
|
+
if (!('digest' in message))
|
|
515
|
+
return;
|
|
516
|
+
if (message.digest !== bootstrap.digest)
|
|
517
|
+
return;
|
|
518
|
+
activationRecorded = true;
|
|
519
|
+
releaseWorkerBootstrap();
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
const parsed = requestSchema.safeParse(message);
|
|
523
|
+
if (!parsed.success)
|
|
524
|
+
return;
|
|
525
|
+
const { id, action } = parsed.data;
|
|
526
|
+
try {
|
|
527
|
+
if (action === 'close')
|
|
528
|
+
runtimeAdmission.close();
|
|
529
|
+
if (action === 'resume')
|
|
530
|
+
runtimeAdmission.resume();
|
|
531
|
+
if (action === 'commit')
|
|
532
|
+
runtimeAdmission.commit();
|
|
533
|
+
sendRuntimeParent({ type: 'runtime-reply', id, value: runtimeAdmission.snapshot() });
|
|
534
|
+
}
|
|
535
|
+
catch {
|
|
536
|
+
sendRuntimeParent({ type: 'runtime-reply', id, value: null, error: 'Runtime admission transition rejected' });
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
// A lost supervisor cannot authorize new work or a competing owner. Keep evidence for explicit recovery.
|
|
540
|
+
process.once('disconnect', () => {
|
|
541
|
+
runtimeAdmission.close();
|
|
542
|
+
});
|
|
543
|
+
return bootstrap;
|
|
544
|
+
}
|
|
545
|
+
export function acknowledgeCooperativeWorker(bootstrap) {
|
|
546
|
+
const runtime = readPidFile(bootstrap.snapshot.runtimeScope);
|
|
547
|
+
if (runtime?.pid !== process.pid || runtime.ownerClaimId !== bootstrap.claimId)
|
|
548
|
+
throw new Error('Worker metadata does not match activation');
|
|
549
|
+
sendRuntimeParent({
|
|
550
|
+
type: 'runtime-activated',
|
|
551
|
+
nonce: bootstrap.nonce,
|
|
552
|
+
claimId: bootstrap.claimId,
|
|
553
|
+
digest: bootstrap.digest,
|
|
554
|
+
version: MCP_SERVER_VERSION,
|
|
555
|
+
runtime,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
export async function stopCooperativeRuntime(scope) {
|
|
559
|
+
const client = await connectRuntimeControl(scope);
|
|
560
|
+
if (!client)
|
|
561
|
+
return false;
|
|
562
|
+
await client.request('describe');
|
|
563
|
+
try {
|
|
564
|
+
await client.request('stop');
|
|
565
|
+
}
|
|
566
|
+
catch {
|
|
567
|
+
/* Verify retirement below even if the response was lost. */
|
|
568
|
+
}
|
|
569
|
+
const until = Date.now() + 30_000;
|
|
570
|
+
while (Date.now() < until) {
|
|
571
|
+
const owner = readRuntimeScopeOwnership(scope);
|
|
572
|
+
if (!owner || owner.claimId !== client.descriptor.claimId) {
|
|
573
|
+
process.stdout.write('Stopped supervised background runtime.\n');
|
|
574
|
+
process.exitCode = 0;
|
|
575
|
+
return true;
|
|
576
|
+
}
|
|
577
|
+
await sleep(100);
|
|
578
|
+
}
|
|
579
|
+
throw new Error('Runtime did not retire; ownership retained. Use explicit recovery after inspecting status');
|
|
580
|
+
}
|
|
581
|
+
export async function cooperativeRuntimeStatus(scope) {
|
|
582
|
+
const client = await connectRuntimeControl(scope);
|
|
583
|
+
if (!client)
|
|
584
|
+
return null;
|
|
585
|
+
const description = await client.request('describe');
|
|
586
|
+
return { description, ready: description.runtime ? await probeReadiness(description.runtime) : false };
|
|
587
|
+
}
|
|
588
|
+
//# sourceMappingURL=cooperativeRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cooperativeRuntime.js","sourceRoot":"","sources":["../../../src/commands/serve/cooperativeRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EACL,8BAA8B,GAE/B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,WAAW,EAEX,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;A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AAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YAC1D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;YACjE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;AAC/G,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,OAAO,CAA4B,UAAU,CAAC,CAAC;IAChF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AACzG,CAAC"}
|
|
@@ -25,6 +25,16 @@ export declare const serverOptions: {
|
|
|
25
25
|
type: "boolean";
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
|
+
'drain-timeout': {
|
|
29
|
+
describe: string;
|
|
30
|
+
type: "number";
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
33
|
+
'cooperative-bootstrap': {
|
|
34
|
+
type: "string";
|
|
35
|
+
choices: readonly ["supervisor", "worker"];
|
|
36
|
+
hidden: boolean;
|
|
37
|
+
};
|
|
28
38
|
'background-bootstrap': {
|
|
29
39
|
type: "boolean";
|
|
30
40
|
default: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC;;;;GAIG;AAGH,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC;;;;GAIG;AAGH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyTzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAsFnD"}
|