imcp 0.1.7 → 0.1.8-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/install.js +1 -106
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/list.js +1 -90
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/pull.js +1 -16
- package/dist/cli/commands/pull.js.map +1 -0
- package/dist/cli/commands/serve.js +1 -33
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/uninstall.js +1 -46
- package/dist/cli/commands/uninstall.js.map +1 -0
- package/dist/cli/index.js +1 -65
- package/dist/cli/index.js.map +1 -0
- package/dist/core/installers/clients/BaseClientInstaller.js +1 -282
- package/dist/core/installers/clients/BaseClientInstaller.js.map +1 -0
- package/dist/core/installers/clients/ClientInstaller.js +1 -163
- package/dist/core/installers/clients/ClientInstaller.js.map +1 -0
- package/dist/core/installers/clients/ClientInstallerFactory.js +1 -36
- package/dist/core/installers/clients/ClientInstallerFactory.js.map +1 -0
- package/dist/core/installers/clients/ClineInstaller.js +1 -30
- package/dist/core/installers/clients/ClineInstaller.js.map +1 -0
- package/dist/core/installers/clients/ExtensionInstaller.js +1 -151
- package/dist/core/installers/clients/ExtensionInstaller.js.map +1 -0
- package/dist/core/installers/clients/GithubCopilotInstaller.js +1 -68
- package/dist/core/installers/clients/GithubCopilotInstaller.js.map +1 -0
- package/dist/core/installers/clients/MSRooCodeInstaller.js +1 -28
- package/dist/core/installers/clients/MSRooCodeInstaller.js.map +1 -0
- package/dist/core/installers/index.js +1 -8
- package/dist/core/installers/index.js.map +1 -0
- package/dist/core/installers/requirements/BaseInstaller.js +1 -56
- package/dist/core/installers/requirements/BaseInstaller.js.map +1 -0
- package/dist/core/installers/requirements/CommandInstaller.js +1 -213
- package/dist/core/installers/requirements/CommandInstaller.js.map +1 -0
- package/dist/core/installers/requirements/GeneralInstaller.js +1 -126
- package/dist/core/installers/requirements/GeneralInstaller.js.map +1 -0
- package/dist/core/installers/requirements/InstallerFactory.js +1 -99
- package/dist/core/installers/requirements/InstallerFactory.js.map +1 -0
- package/dist/core/installers/requirements/NpmInstaller.js +1 -235
- package/dist/core/installers/requirements/NpmInstaller.js.map +1 -0
- package/dist/core/installers/requirements/NugetInstaller.js +1 -188
- package/dist/core/installers/requirements/NugetInstaller.js.map +1 -0
- package/dist/core/installers/requirements/PipInstaller.js +1 -192
- package/dist/core/installers/requirements/PipInstaller.js.map +1 -0
- package/dist/core/installers/requirements/RequirementInstaller.js +1 -2
- package/dist/core/installers/requirements/RequirementInstaller.js.map +1 -0
- package/dist/core/loaders/ConfigurationLoader.js +1 -256
- package/dist/core/loaders/ConfigurationLoader.js.map +1 -0
- package/dist/core/loaders/ConfigurationProvider.js +1 -383
- package/dist/core/loaders/ConfigurationProvider.js.map +1 -0
- package/dist/core/loaders/InstallOperationManager.js +1 -310
- package/dist/core/loaders/InstallOperationManager.js.map +1 -0
- package/dist/core/loaders/ServerSchemaLoader.js +1 -108
- package/dist/core/loaders/ServerSchemaLoader.js.map +1 -0
- package/dist/core/loaders/ServerSchemaProvider.js +1 -89
- package/dist/core/loaders/ServerSchemaProvider.js.map +1 -0
- package/dist/core/loaders/SystemSettingsManager.js +1 -256
- package/dist/core/loaders/SystemSettingsManager.js.map +1 -0
- package/dist/core/metadatas/constants.js +1 -100
- package/dist/core/metadatas/constants.js.map +1 -0
- package/dist/core/metadatas/recordingConstants.js +1 -46
- package/dist/core/metadatas/recordingConstants.js.map +1 -0
- package/dist/core/metadatas/types.js +1 -15
- package/dist/core/metadatas/types.js.map +1 -0
- package/dist/core/onboard/FeedOnboardService.js +1 -422
- package/dist/core/onboard/FeedOnboardService.js.map +1 -0
- package/dist/core/onboard/OnboardProcessor.js +1 -333
- package/dist/core/onboard/OnboardProcessor.js.map +1 -0
- package/dist/core/onboard/OnboardStatus.js +1 -9
- package/dist/core/onboard/OnboardStatus.js.map +1 -0
- package/dist/core/onboard/OnboardStatusManager.js +1 -360
- package/dist/core/onboard/OnboardStatusManager.js.map +1 -0
- package/dist/core/validators/FeedValidator.js +1 -133
- package/dist/core/validators/FeedValidator.js.map +1 -0
- package/dist/core/validators/IServerValidator.js +1 -1
- package/dist/core/validators/IServerValidator.js.map +1 -0
- package/dist/core/validators/SSEServerValidator.js +1 -38
- package/dist/core/validators/SSEServerValidator.js.map +1 -0
- package/dist/core/validators/ServerValidatorFactory.js +1 -44
- package/dist/core/validators/ServerValidatorFactory.js.map +1 -0
- package/dist/core/validators/StdioServerValidator.js +1 -281
- package/dist/core/validators/StdioServerValidator.js.map +1 -0
- package/dist/index.js +1 -18
- package/dist/index.js.map +1 -0
- package/dist/services/InstallationService.js +1 -81
- package/dist/services/InstallationService.js.map +1 -0
- package/dist/services/MCPManager.js +1 -197
- package/dist/services/MCPManager.js.map +1 -0
- package/dist/services/RequirementService.js +1 -548
- package/dist/services/RequirementService.js.map +1 -0
- package/dist/services/ServerService.js +1 -127
- package/dist/services/ServerService.js.map +1 -0
- package/dist/services/TelemetryService.js +1 -53
- package/dist/services/TelemetryService.js.map +1 -0
- package/dist/utils/UpdateCheckTracker.js +1 -79
- package/dist/utils/UpdateCheckTracker.js.map +1 -0
- package/dist/utils/adoUtils.js +1 -254
- package/dist/utils/adoUtils.js.map +1 -0
- package/dist/utils/clientUtils.js +1 -65
- package/dist/utils/clientUtils.js.map +1 -0
- package/dist/utils/feedUtils.js +1 -28
- package/dist/utils/feedUtils.js.map +1 -0
- package/dist/utils/githubAuth.js +1 -177
- package/dist/utils/githubAuth.js.map +1 -0
- package/dist/utils/githubUtils.js +1 -125
- package/dist/utils/githubUtils.js.map +1 -0
- package/dist/utils/logger.js +1 -176
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/macroExpressionUtils.js +1 -93
- package/dist/utils/macroExpressionUtils.js.map +1 -0
- package/dist/utils/osUtils.js +1 -664
- package/dist/utils/osUtils.js.map +1 -0
- package/dist/utils/versionUtils.js +1 -101
- package/dist/utils/versionUtils.js.map +1 -0
- package/dist/web/contract/serverContract.js +1 -1
- package/dist/web/contract/serverContract.js.map +1 -0
- package/dist/web/public/js/api.js +2 -132
- package/dist/web/public/js/api.js.map +1 -0
- package/dist/web/public/js/detailsWidget.js +2 -264
- package/dist/web/public/js/detailsWidget.js.map +1 -0
- package/dist/web/public/js/flights/flights.js +2 -127
- package/dist/web/public/js/flights/flights.js.map +1 -0
- package/dist/web/public/js/modal/index.js +2 -52
- package/dist/web/public/js/modal/index.js.map +1 -0
- package/dist/web/public/js/modal/installModal.js +2 -162
- package/dist/web/public/js/modal/installModal.js.map +1 -0
- package/dist/web/public/js/modal/installation.js +2 -266
- package/dist/web/public/js/modal/installation.js.map +1 -0
- package/dist/web/public/js/modal/loadingModal.js +2 -182
- package/dist/web/public/js/modal/loadingModal.js.map +1 -0
- package/dist/web/public/js/modal/modalSetup.js +2 -595
- package/dist/web/public/js/modal/modalSetup.js.map +1 -0
- package/dist/web/public/js/modal/modalUtils.js +2 -37
- package/dist/web/public/js/modal/modalUtils.js.map +1 -0
- package/dist/web/public/js/modal/versionUtils.js +2 -20
- package/dist/web/public/js/modal/versionUtils.js.map +1 -0
- package/dist/web/public/js/modal.js +2 -42
- package/dist/web/public/js/modal.js.map +1 -0
- package/dist/web/public/js/notifications.js +2 -137
- package/dist/web/public/js/notifications.js.map +1 -0
- package/dist/web/public/js/onboard/formProcessor.js +2 -1037
- package/dist/web/public/js/onboard/formProcessor.js.map +1 -0
- package/dist/web/public/js/onboard/index.js +2 -374
- package/dist/web/public/js/onboard/index.js.map +1 -0
- package/dist/web/public/js/onboard/publishHandler.js +2 -172
- package/dist/web/public/js/onboard/publishHandler.js.map +1 -0
- package/dist/web/public/js/onboard/state.js +2 -76
- package/dist/web/public/js/onboard/state.js.map +1 -0
- package/dist/web/public/js/onboard/templates.js +2 -342
- package/dist/web/public/js/onboard/templates.js.map +1 -0
- package/dist/web/public/js/onboard/uiHandlers.js +2 -1076
- package/dist/web/public/js/onboard/uiHandlers.js.map +1 -0
- package/dist/web/public/js/onboard/validationHandlers.js +2 -493
- package/dist/web/public/js/onboard/validationHandlers.js.map +1 -0
- package/dist/web/public/js/serverCategoryDetails.js +2 -364
- package/dist/web/public/js/serverCategoryDetails.js.map +1 -0
- package/dist/web/public/js/serverCategoryList.js +2 -241
- package/dist/web/public/js/serverCategoryList.js.map +1 -0
- package/dist/web/public/js/settings.js +2 -314
- package/dist/web/public/js/settings.js.map +1 -0
- package/dist/web/server.js +1 -404
- package/dist/web/server.js.map +1 -0
- package/package.json +8 -2
- package/.github/ISSUE_TEMPLATE/JitAccess.yml +0 -28
- package/.github/acl/access.yml +0 -20
- package/.github/compliance/inventory.yml +0 -5
- package/.github/policies/jit.yml +0 -19
- package/.github/workflows/build.yml +0 -28
- package/.roo/rules-code/rules.md +0 -88
- package/dist/cli/commands/start.d.ts +0 -2
- package/dist/cli/commands/start.js +0 -32
- package/dist/cli/commands/sync.d.ts +0 -2
- package/dist/cli/commands/sync.js +0 -17
- package/dist/core/ConfigurationLoader.d.ts +0 -32
- package/dist/core/ConfigurationLoader.js +0 -236
- package/dist/core/ConfigurationProvider.d.ts +0 -35
- package/dist/core/ConfigurationProvider.js +0 -375
- package/dist/core/InstallationService.d.ts +0 -50
- package/dist/core/InstallationService.js +0 -350
- package/dist/core/MCPManager.d.ts +0 -28
- package/dist/core/MCPManager.js +0 -188
- package/dist/core/RequirementService.d.ts +0 -40
- package/dist/core/RequirementService.js +0 -110
- package/dist/core/ServerSchemaLoader.d.ts +0 -11
- package/dist/core/ServerSchemaLoader.js +0 -43
- package/dist/core/ServerSchemaProvider.d.ts +0 -17
- package/dist/core/ServerSchemaProvider.js +0 -120
- package/dist/core/constants.d.ts +0 -47
- package/dist/core/constants.js +0 -94
- package/dist/core/installers/BaseInstaller.d.ts +0 -74
- package/dist/core/installers/BaseInstaller.js +0 -253
- package/dist/core/installers/ClientInstaller.d.ts +0 -23
- package/dist/core/installers/ClientInstaller.js +0 -564
- package/dist/core/installers/CommandInstaller.d.ts +0 -37
- package/dist/core/installers/CommandInstaller.js +0 -173
- package/dist/core/installers/GeneralInstaller.d.ts +0 -33
- package/dist/core/installers/GeneralInstaller.js +0 -85
- package/dist/core/installers/InstallerFactory.d.ts +0 -54
- package/dist/core/installers/InstallerFactory.js +0 -97
- package/dist/core/installers/NpmInstaller.d.ts +0 -26
- package/dist/core/installers/NpmInstaller.js +0 -127
- package/dist/core/installers/PipInstaller.d.ts +0 -28
- package/dist/core/installers/PipInstaller.js +0 -127
- package/dist/core/installers/RequirementInstaller.d.ts +0 -33
- package/dist/core/installers/RequirementInstaller.js +0 -3
- package/dist/core/types.d.ts +0 -166
- package/dist/core/types.js +0 -16
- package/dist/services/InstallRequestValidator.d.ts +0 -21
- package/dist/services/InstallRequestValidator.js +0 -99
- package/dist/web/public/js/modal/installHandler.js +0 -227
- package/dist/web/public/js/modal/loadingUI.js +0 -74
- package/dist/web/public/js/modal/messageQueue.js +0 -112
- package/dist/web/public/js/modal/modalUI.js +0 -214
- package/dist/web/public/js/modal/version.js +0 -20
- package/dist/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +0 -370
- package/docs/ONBOARDING_PAGE_DESIGN.md +0 -260
- package/docs/Telemetry.md +0 -136
- package/memory-bank/activeContext.md +0 -26
- package/memory-bank/decisionLog.md +0 -91
- package/memory-bank/productContext.md +0 -41
- package/memory-bank/progress.md +0 -35
- package/memory-bank/systemPatterns.md +0 -10
- package/src/cli/commands/install.ts +0 -139
- package/src/cli/commands/list.ts +0 -113
- package/src/cli/commands/pull.ts +0 -16
- package/src/cli/commands/serve.ts +0 -39
- package/src/cli/commands/uninstall.ts +0 -64
- package/src/cli/index.ts +0 -82
- package/src/core/installers/clients/BaseClientInstaller.ts +0 -341
- package/src/core/installers/clients/ClientInstaller.ts +0 -222
- package/src/core/installers/clients/ClientInstallerFactory.ts +0 -43
- package/src/core/installers/clients/ClineInstaller.ts +0 -35
- package/src/core/installers/clients/ExtensionInstaller.ts +0 -165
- package/src/core/installers/clients/GithubCopilotInstaller.ts +0 -79
- package/src/core/installers/clients/MSRooCodeInstaller.ts +0 -32
- package/src/core/installers/index.ts +0 -11
- package/src/core/installers/requirements/BaseInstaller.ts +0 -85
- package/src/core/installers/requirements/CommandInstaller.ts +0 -231
- package/src/core/installers/requirements/GeneralInstaller.ts +0 -133
- package/src/core/installers/requirements/InstallerFactory.ts +0 -114
- package/src/core/installers/requirements/NpmInstaller.ts +0 -271
- package/src/core/installers/requirements/NugetInstaller.ts +0 -203
- package/src/core/installers/requirements/PipInstaller.ts +0 -207
- package/src/core/installers/requirements/RequirementInstaller.ts +0 -42
- package/src/core/loaders/ConfigurationLoader.ts +0 -298
- package/src/core/loaders/ConfigurationProvider.ts +0 -462
- package/src/core/loaders/InstallOperationManager.ts +0 -367
- package/src/core/loaders/ServerSchemaLoader.ts +0 -117
- package/src/core/loaders/ServerSchemaProvider.ts +0 -99
- package/src/core/loaders/SystemSettingsManager.ts +0 -278
- package/src/core/metadatas/constants.ts +0 -122
- package/src/core/metadatas/recordingConstants.ts +0 -65
- package/src/core/metadatas/types.ts +0 -202
- package/src/core/onboard/FeedOnboardService.ts +0 -501
- package/src/core/onboard/OnboardProcessor.ts +0 -356
- package/src/core/onboard/OnboardStatus.ts +0 -60
- package/src/core/onboard/OnboardStatusManager.ts +0 -416
- package/src/core/validators/FeedValidator.ts +0 -135
- package/src/core/validators/IServerValidator.ts +0 -21
- package/src/core/validators/SSEServerValidator.ts +0 -43
- package/src/core/validators/ServerValidatorFactory.ts +0 -51
- package/src/core/validators/StdioServerValidator.ts +0 -313
- package/src/index.ts +0 -44
- package/src/services/InstallationService.ts +0 -102
- package/src/services/MCPManager.ts +0 -249
- package/src/services/RequirementService.ts +0 -627
- package/src/services/ServerService.ts +0 -161
- package/src/services/TelemetryService.ts +0 -59
- package/src/utils/UpdateCheckTracker.ts +0 -86
- package/src/utils/adoUtils.ts +0 -293
- package/src/utils/clientUtils.ts +0 -72
- package/src/utils/feedUtils.ts +0 -31
- package/src/utils/githubAuth.ts +0 -212
- package/src/utils/githubUtils.ts +0 -164
- package/src/utils/logger.ts +0 -195
- package/src/utils/macroExpressionUtils.ts +0 -104
- package/src/utils/osUtils.ts +0 -700
- package/src/utils/versionUtils.ts +0 -114
- package/src/web/contract/serverContract.ts +0 -74
- package/src/web/public/css/detailsWidget.css +0 -235
- package/src/web/public/css/modal.css +0 -757
- package/src/web/public/css/notifications.css +0 -101
- package/src/web/public/css/onboard.css +0 -107
- package/src/web/public/css/serverCategoryList.css +0 -120
- package/src/web/public/css/serverDetails.css +0 -139
- package/src/web/public/index.html +0 -359
- package/src/web/public/js/api.js +0 -132
- package/src/web/public/js/detailsWidget.js +0 -264
- package/src/web/public/js/flights/flights.js +0 -127
- package/src/web/public/js/modal/index.js +0 -52
- package/src/web/public/js/modal/installModal.js +0 -162
- package/src/web/public/js/modal/installation.js +0 -266
- package/src/web/public/js/modal/loadingModal.js +0 -182
- package/src/web/public/js/modal/modalSetup.js +0 -595
- package/src/web/public/js/modal/modalUtils.js +0 -37
- package/src/web/public/js/modal/versionUtils.js +0 -20
- package/src/web/public/js/modal.js +0 -42
- package/src/web/public/js/notifications.js +0 -137
- package/src/web/public/js/onboard/formProcessor.js +0 -1037
- package/src/web/public/js/onboard/index.js +0 -374
- package/src/web/public/js/onboard/publishHandler.js +0 -172
- package/src/web/public/js/onboard/state.js +0 -76
- package/src/web/public/js/onboard/templates.js +0 -342
- package/src/web/public/js/onboard/uiHandlers.js +0 -1076
- package/src/web/public/js/onboard/validationHandlers.js +0 -493
- package/src/web/public/js/serverCategoryDetails.js +0 -364
- package/src/web/public/js/serverCategoryList.js +0 -241
- package/src/web/public/js/settings.js +0 -314
- package/src/web/public/modal.html +0 -84
- package/src/web/public/onboard.html +0 -296
- package/src/web/public/settings.html +0 -135
- package/src/web/public/styles.css +0 -277
- package/src/web/server.ts +0 -478
- package/tsconfig.json +0 -18
- package/wiki/Installation.md +0 -3
- package/wiki/Publish.md +0 -3
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
import { exec } from 'child_process';
|
|
4
|
-
import util from 'util';
|
|
5
|
-
import { createInstallerFactory } from './installers/index.js';
|
|
6
|
-
import { SUPPORTED_CLIENTS } from './constants.js';
|
|
7
|
-
import { ClientInstaller } from './installers/clients/ClientInstaller.js';
|
|
8
|
-
import { ConfigurationProvider } from './ConfigurationProvider.js';
|
|
9
|
-
import { Logger } from '../utils/logger.js';
|
|
10
|
-
const execPromise = util.promisify(exec);
|
|
11
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
/**
|
|
13
|
-
* Handles the actual installation process for an MCP server.
|
|
14
|
-
*/
|
|
15
|
-
export class InstallationService {
|
|
16
|
-
activeInstallations = new Map();
|
|
17
|
-
installerFactory;
|
|
18
|
-
constructor() {
|
|
19
|
-
this.installerFactory = createInstallerFactory();
|
|
20
|
-
}
|
|
21
|
-
generateOperationId() {
|
|
22
|
-
return `install-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Installs a server based on the provided options and feed configuration.
|
|
26
|
-
* @param serverName The name of the server to install.
|
|
27
|
-
* @param options The installation options.
|
|
28
|
-
* @returns A result object indicating success or failure.
|
|
29
|
-
*/
|
|
30
|
-
async install(categoryName, serverName, options) {
|
|
31
|
-
const configProvider = ConfigurationProvider.getInstance();
|
|
32
|
-
const clients = options.targetClients || Object.keys(SUPPORTED_CLIENTS);
|
|
33
|
-
// Process updates for requirements if specified in options
|
|
34
|
-
// Fire off requirement updates in the background without awaiting completion
|
|
35
|
-
if (options.requirements && options.requirements.length > 0) {
|
|
36
|
-
// Start the process but don't await it - it will run in the background
|
|
37
|
-
this.processRequirementUpdates(categoryName, serverName, options)
|
|
38
|
-
.catch(error => {
|
|
39
|
-
console.error(`Error in background requirement updates: ${error instanceof Error ? error.message : String(error)}`);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
// Check if server is already ready
|
|
43
|
-
const isReady = await configProvider.isServerReady(categoryName, serverName, clients);
|
|
44
|
-
if (isReady) {
|
|
45
|
-
return {
|
|
46
|
-
success: true,
|
|
47
|
-
message: 'Server and clients are already installed and ready',
|
|
48
|
-
status: [{
|
|
49
|
-
status: 'completed',
|
|
50
|
-
type: 'install',
|
|
51
|
-
target: 'server',
|
|
52
|
-
message: 'Server and clients are already installed and ready'
|
|
53
|
-
}]
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
// Create new ClientInstaller instance for handling installation
|
|
57
|
-
const clientInstaller = new ClientInstaller(categoryName, serverName, clients);
|
|
58
|
-
const requirementsResult = await this.checkAndInstallRequirements(categoryName, serverName, options);
|
|
59
|
-
if (requirementsResult) {
|
|
60
|
-
return requirementsResult;
|
|
61
|
-
}
|
|
62
|
-
// Process client installation regardless of requirements state
|
|
63
|
-
// Each client installer will check requirements before actual installation
|
|
64
|
-
return await clientInstaller.install(options);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Process requirement updates specified in serverInstallOptions
|
|
68
|
-
* All updates are processed in parallel for maximum efficiency
|
|
69
|
-
* @param categoryName The category name
|
|
70
|
-
* @param serverName The server name
|
|
71
|
-
* @param requirements The requirements to update
|
|
72
|
-
*/
|
|
73
|
-
async processRequirementUpdates(categoryName, serverName, options) {
|
|
74
|
-
// Use UpdateCheckTracker to prevent concurrent updates
|
|
75
|
-
const updateCheckTracker = await import('../utils/UpdateCheckTracker.js').then(m => m.updateCheckTracker);
|
|
76
|
-
const operationKey = `requirement-updates-${categoryName}-${serverName}`;
|
|
77
|
-
// Check if there's already an update operation in progress for this server
|
|
78
|
-
const canProceed = await updateCheckTracker.startOperation(operationKey);
|
|
79
|
-
if (!canProceed) {
|
|
80
|
-
console.log(`Requirement updates for ${categoryName}/${serverName} already in progress, skipping`);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
try {
|
|
84
|
-
const configProvider = ConfigurationProvider.getInstance();
|
|
85
|
-
const feedConfig = await configProvider.getFeedConfiguration(categoryName);
|
|
86
|
-
if (!feedConfig) {
|
|
87
|
-
console.error(`Feed configuration not found for category: ${categoryName}`);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
// Import the RequirementService
|
|
91
|
-
const { requirementService } = await import('./RequirementService.js');
|
|
92
|
-
// Create an array of promises to update all requirements in parallel
|
|
93
|
-
const updatePromises = options.requirements?.map(async (reqToUpdate) => {
|
|
94
|
-
try {
|
|
95
|
-
// Find the full requirement config
|
|
96
|
-
const reqConfig = feedConfig.requirements?.find((r) => r.name === reqToUpdate.name);
|
|
97
|
-
if (!reqConfig) {
|
|
98
|
-
console.error(`Requirement configuration not found for: ${reqToUpdate.name}`);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
// Get current status
|
|
102
|
-
const currentStatus = await configProvider.getRequirementStatus(categoryName, reqToUpdate.name);
|
|
103
|
-
if (!currentStatus) {
|
|
104
|
-
console.error(`No current status found for requirement: ${reqToUpdate.name}`);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
// Update requirement status to indicate update in progress
|
|
108
|
-
await configProvider.updateRequirementStatus(categoryName, reqToUpdate.name, {
|
|
109
|
-
...currentStatus,
|
|
110
|
-
name: reqToUpdate.name,
|
|
111
|
-
type: currentStatus.type || 'unknown',
|
|
112
|
-
installed: currentStatus.installed || false,
|
|
113
|
-
inProgress: true,
|
|
114
|
-
operationStatus: {
|
|
115
|
-
status: 'in-progress',
|
|
116
|
-
type: 'update',
|
|
117
|
-
target: 'requirement',
|
|
118
|
-
message: `Updating ${reqToUpdate.name} from ${currentStatus.version || 'unknown'} to ${reqToUpdate.version}`
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
// For pip requirements, check if we have a stored pythonEnv
|
|
122
|
-
if (reqConfig.type === 'pip' && currentStatus.pythonEnv && !options?.settings?.pythonEnv) {
|
|
123
|
-
options = {
|
|
124
|
-
...options,
|
|
125
|
-
settings: { ...options?.settings, pythonEnv: currentStatus.pythonEnv }
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
// Update the requirement with options for pip environment
|
|
129
|
-
const updatedStatus = await requirementService.updateRequirement(reqConfig, reqToUpdate.version, options);
|
|
130
|
-
// Update requirement status
|
|
131
|
-
await configProvider.updateRequirementStatus(categoryName, reqToUpdate.name, {
|
|
132
|
-
...updatedStatus,
|
|
133
|
-
name: reqToUpdate.name,
|
|
134
|
-
type: updatedStatus.type || currentStatus.type || 'unknown',
|
|
135
|
-
installed: updatedStatus.installed,
|
|
136
|
-
inProgress: false,
|
|
137
|
-
operationStatus: {
|
|
138
|
-
status: updatedStatus.installed ? 'completed' : 'failed',
|
|
139
|
-
type: 'update',
|
|
140
|
-
target: 'requirement',
|
|
141
|
-
message: updatedStatus.installed
|
|
142
|
-
? `Successfully updated ${reqToUpdate.name} to version ${reqToUpdate.version}`
|
|
143
|
-
: `Failed to update ${reqToUpdate.name} to version ${reqToUpdate.version}`
|
|
144
|
-
},
|
|
145
|
-
availableUpdate: updatedStatus.installed ? undefined : currentStatus.availableUpdate
|
|
146
|
-
});
|
|
147
|
-
console.log(`Requirement ${reqToUpdate.name} updated to version ${reqToUpdate.version}`);
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
console.error(`Error updating requirement ${reqToUpdate.name}:`, error);
|
|
151
|
-
// Update status to indicate failure
|
|
152
|
-
await configProvider.updateRequirementStatus(categoryName, reqToUpdate.name, {
|
|
153
|
-
name: reqToUpdate.name,
|
|
154
|
-
type: 'unknown',
|
|
155
|
-
installed: false,
|
|
156
|
-
inProgress: false,
|
|
157
|
-
error: error instanceof Error ? error.message : String(error),
|
|
158
|
-
operationStatus: {
|
|
159
|
-
status: 'failed',
|
|
160
|
-
type: 'update',
|
|
161
|
-
target: 'requirement',
|
|
162
|
-
message: `Error updating requirement: ${error instanceof Error ? error.message : String(error)}`
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
// Wait for all updates to complete in parallel if there are any
|
|
168
|
-
if (updatePromises) {
|
|
169
|
-
await Promise.all(updatePromises);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
finally {
|
|
173
|
-
// Always release the lock when done, even if there was an error
|
|
174
|
-
await updateCheckTracker.endOperation(operationKey);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Checks and installs requirements for a server if needed
|
|
179
|
-
* @param categoryName The category name
|
|
180
|
-
* @param serverName The server name
|
|
181
|
-
* @param options The installation options
|
|
182
|
-
* @returns A failure result if requirements check fails, null if requirements are satisfied
|
|
183
|
-
*/
|
|
184
|
-
async checkAndInstallRequirements(categoryName, serverName, options) {
|
|
185
|
-
const configProvider = ConfigurationProvider.getInstance();
|
|
186
|
-
// Get feed configuration to get requirements
|
|
187
|
-
const feedConfig = await configProvider.getFeedConfiguration(categoryName);
|
|
188
|
-
if (!feedConfig) {
|
|
189
|
-
return {
|
|
190
|
-
success: false,
|
|
191
|
-
message: 'Feed configuration not found',
|
|
192
|
-
status: [{
|
|
193
|
-
status: 'failed',
|
|
194
|
-
type: 'install',
|
|
195
|
-
target: 'server',
|
|
196
|
-
message: 'Feed configuration not found'
|
|
197
|
-
}]
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
// Find server config and verify requirements
|
|
201
|
-
const serverConfig = feedConfig.mcpServers.find((s) => s.name === serverName);
|
|
202
|
-
if (!serverConfig?.dependencies?.requirements) {
|
|
203
|
-
Logger.debug(`No requirements for ${serverName}`);
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
|
-
// Check all requirements installation status
|
|
207
|
-
const requirementStatuses = await Promise.all(serverConfig.dependencies.requirements.map(async (req) => {
|
|
208
|
-
const reqConfig = feedConfig.requirements?.find((r) => r.name === req.name) || {
|
|
209
|
-
name: req.name,
|
|
210
|
-
version: req.version,
|
|
211
|
-
type: 'npm'
|
|
212
|
-
};
|
|
213
|
-
return await this.installerFactory.checkInstallation(reqConfig, options);
|
|
214
|
-
}));
|
|
215
|
-
// If all requirements are installed and ready, no need to proceed with installation
|
|
216
|
-
if (requirementStatuses.every(status => status.installed)) {
|
|
217
|
-
// Check if requirements are ready via ConfigurationProvider
|
|
218
|
-
const requirementsReady = await configProvider.isRequirementsReady(categoryName, serverName);
|
|
219
|
-
// Update requirement status if not ready
|
|
220
|
-
if (!requirementsReady) {
|
|
221
|
-
for (const status of requirementStatuses) {
|
|
222
|
-
await configProvider.updateRequirementStatus(categoryName, status.name, status);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return null;
|
|
226
|
-
}
|
|
227
|
-
// Sort requirements by order for installation
|
|
228
|
-
const sortedRequirements = [...serverConfig.dependencies.requirements].sort((a, b) => {
|
|
229
|
-
const orderA = a.order ?? Infinity;
|
|
230
|
-
const orderB = b.order ?? Infinity;
|
|
231
|
-
return orderA - orderB;
|
|
232
|
-
});
|
|
233
|
-
// Start requirements installation in background
|
|
234
|
-
this.installRequirementsInBackground(categoryName, sortedRequirements, options)
|
|
235
|
-
.catch(error => {
|
|
236
|
-
Logger.error(`Error in background requirement installations: ${error instanceof Error ? error.message : String(error)}`);
|
|
237
|
-
});
|
|
238
|
-
// Return immediately while installation continues in background
|
|
239
|
-
return null;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Installs requirements in background without blocking the main thread
|
|
243
|
-
* Requirements with the same order are installed in parallel
|
|
244
|
-
*/
|
|
245
|
-
async installRequirementsInBackground(categoryName, sortedRequirements, options) {
|
|
246
|
-
const configProvider = ConfigurationProvider.getInstance();
|
|
247
|
-
const requirementGroups = sortedRequirements.reduce((groups, req) => {
|
|
248
|
-
const order = req.order ?? Infinity;
|
|
249
|
-
if (!groups[order]) {
|
|
250
|
-
groups[order] = [];
|
|
251
|
-
}
|
|
252
|
-
groups[order].push(req);
|
|
253
|
-
return groups;
|
|
254
|
-
}, {});
|
|
255
|
-
// Process each group in sequence, but requirements within group in parallel
|
|
256
|
-
const orderKeys = Object.keys(requirementGroups).map(Number).sort((a, b) => a - b);
|
|
257
|
-
for (const order of orderKeys) {
|
|
258
|
-
const group = requirementGroups[order];
|
|
259
|
-
await Promise.all(group.map(async (requirement) => {
|
|
260
|
-
try {
|
|
261
|
-
const feeds = await configProvider.getFeedConfiguration(categoryName);
|
|
262
|
-
const requirementConfig = feeds?.requirements?.find((r) => r.name === requirement.name) || {
|
|
263
|
-
name: requirement.name,
|
|
264
|
-
version: requirement.version,
|
|
265
|
-
type: 'npm'
|
|
266
|
-
};
|
|
267
|
-
// For pip requirements, check if we need to use stored pythonEnv
|
|
268
|
-
const currentStatus = await configProvider.getRequirementStatus(categoryName, requirement.name);
|
|
269
|
-
if (requirementConfig.type === 'pip' && currentStatus?.pythonEnv && !options?.settings?.pythonEnv) {
|
|
270
|
-
options = {
|
|
271
|
-
...options,
|
|
272
|
-
settings: { ...options?.settings, pythonEnv: currentStatus.pythonEnv }
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
const installer = this.installerFactory.getInstaller(requirementConfig);
|
|
276
|
-
if (!installer) {
|
|
277
|
-
await this.updateRequirementFailureStatus(categoryName, requirement.name, requirementConfig.type, `No installer found for requirement type: ${requirementConfig.type}`);
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
const operationId = this.generateOperationId();
|
|
281
|
-
await this.updateRequirementProgressStatus(categoryName, requirement.name, requirementConfig.type, operationId);
|
|
282
|
-
const installStatus = await installer.install(requirementConfig, options);
|
|
283
|
-
await this.updateRequirementCompletionStatus(categoryName, requirement.name, installStatus, operationId);
|
|
284
|
-
}
|
|
285
|
-
catch (error) {
|
|
286
|
-
await this.updateRequirementFailureStatus(categoryName, requirement.name, 'unknown', error instanceof Error ? error.message : String(error));
|
|
287
|
-
}
|
|
288
|
-
}));
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Helper to update requirement status for failure case
|
|
293
|
-
*/
|
|
294
|
-
async updateRequirementFailureStatus(categoryName, requirementName, requirementType, errorMessage) {
|
|
295
|
-
const configProvider = ConfigurationProvider.getInstance();
|
|
296
|
-
await configProvider.updateRequirementStatus(categoryName, requirementName, {
|
|
297
|
-
name: requirementName,
|
|
298
|
-
type: requirementType,
|
|
299
|
-
installed: false,
|
|
300
|
-
error: errorMessage,
|
|
301
|
-
operationStatus: {
|
|
302
|
-
status: 'failed',
|
|
303
|
-
type: 'install',
|
|
304
|
-
target: 'requirement',
|
|
305
|
-
message: `Error installing requirement: ${errorMessage}`,
|
|
306
|
-
operationId: this.generateOperationId()
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Helper to update requirement status for in-progress case
|
|
312
|
-
*/
|
|
313
|
-
async updateRequirementProgressStatus(categoryName, requirementName, requirementType, operationId) {
|
|
314
|
-
const configProvider = ConfigurationProvider.getInstance();
|
|
315
|
-
await configProvider.updateRequirementStatus(categoryName, requirementName, {
|
|
316
|
-
name: requirementName,
|
|
317
|
-
type: requirementType,
|
|
318
|
-
installed: false,
|
|
319
|
-
inProgress: true,
|
|
320
|
-
operationStatus: {
|
|
321
|
-
status: 'in-progress',
|
|
322
|
-
type: 'install',
|
|
323
|
-
target: 'requirement',
|
|
324
|
-
message: `Installing requirement: ${requirementName}`,
|
|
325
|
-
operationId
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Helper to update requirement status for completion case
|
|
331
|
-
*/
|
|
332
|
-
async updateRequirementCompletionStatus(categoryName, requirementName, installStatus, operationId) {
|
|
333
|
-
const configProvider = ConfigurationProvider.getInstance();
|
|
334
|
-
await configProvider.updateRequirementStatus(categoryName, requirementName, {
|
|
335
|
-
...installStatus,
|
|
336
|
-
operationStatus: {
|
|
337
|
-
status: installStatus.installed ? 'completed' : 'failed',
|
|
338
|
-
type: 'install',
|
|
339
|
-
target: 'requirement',
|
|
340
|
-
message: installStatus.installed
|
|
341
|
-
? `Requirement ${requirementName} installed successfully`
|
|
342
|
-
: `Failed to install ${requirementName}`,
|
|
343
|
-
operationId
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
// Export a singleton instance (optional)
|
|
349
|
-
// export const installationService = new InstallationService();
|
|
350
|
-
//# sourceMappingURL=InstallationService.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
import { MCPEvent, MCPEventData, MCPServerCategory, ServerInstallOptions, ServerCategoryListOptions, ServerOperationResult, ServerUninstallOptions, FeedConfiguration } from './types.js';
|
|
3
|
-
import { OperationStatus } from './onboard/OnboardStatus.js';
|
|
4
|
-
export declare class MCPManager extends EventEmitter {
|
|
5
|
-
private installationService;
|
|
6
|
-
private configProvider;
|
|
7
|
-
private feedOnboardService;
|
|
8
|
-
constructor();
|
|
9
|
-
syncFeeds(): Promise<void>;
|
|
10
|
-
initialize(feedFile?: string): Promise<void>;
|
|
11
|
-
listServerCategories(options?: ServerCategoryListOptions): Promise<MCPServerCategory[]>;
|
|
12
|
-
getFeedConfiguration(categoryName: string): Promise<FeedConfiguration | undefined>;
|
|
13
|
-
getServerMcpConfig(categoryName: string, serverName: string): Promise<import("./types.js").McpConfig | undefined>;
|
|
14
|
-
installServer(categoryName: string, serverName: string, requestOptions?: ServerInstallOptions): Promise<ServerOperationResult>;
|
|
15
|
-
uninstallServer(categoryName: string, serverName: string, options?: ServerUninstallOptions): Promise<ServerOperationResult>;
|
|
16
|
-
updateRequirement(categoryName: string, serverName: string, requirementName: string, updateVersion: string): Promise<ServerOperationResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Onboards a new feed configuration
|
|
19
|
-
* @param config The feed configuration to onboard
|
|
20
|
-
*/
|
|
21
|
-
onboardFeed(config: FeedConfiguration): Promise<OperationStatus & {
|
|
22
|
-
feedConfiguration?: FeedConfiguration;
|
|
23
|
-
}>;
|
|
24
|
-
emit<E extends MCPEvent>(event: E, data: MCPEventData[E]): boolean;
|
|
25
|
-
on<E extends MCPEvent>(event: E, listener: (data: MCPEventData[E]) => void): this;
|
|
26
|
-
off<E extends MCPEvent>(event: E, listener: (data: MCPEventData[E]) => void): this;
|
|
27
|
-
}
|
|
28
|
-
export declare const mcpManager: MCPManager;
|
package/dist/core/MCPManager.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
import { ConfigurationProvider } from './ConfigurationProvider.js';
|
|
3
|
-
import { InstallationService } from './InstallationService.js';
|
|
4
|
-
import { MCPEvent, } from './types.js';
|
|
5
|
-
import { Logger } from '../utils/logger.js';
|
|
6
|
-
import { FeedOnboardService } from './onboard/FeedOnboardService.js';
|
|
7
|
-
export class MCPManager extends EventEmitter {
|
|
8
|
-
installationService;
|
|
9
|
-
configProvider;
|
|
10
|
-
feedOnboardService;
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
this.configProvider = ConfigurationProvider.getInstance();
|
|
14
|
-
this.installationService = new InstallationService();
|
|
15
|
-
this.feedOnboardService = new FeedOnboardService();
|
|
16
|
-
}
|
|
17
|
-
async syncFeeds() {
|
|
18
|
-
await this.configProvider.syncFeeds();
|
|
19
|
-
}
|
|
20
|
-
async initialize(feedFile) {
|
|
21
|
-
try {
|
|
22
|
-
await this.configProvider.initialize(feedFile);
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
console.error("Error during MCPManager initialization:", error);
|
|
26
|
-
throw error;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async listServerCategories(options = {}) {
|
|
30
|
-
const { local = true } = options;
|
|
31
|
-
if (local) {
|
|
32
|
-
return await this.configProvider.getServerCategories();
|
|
33
|
-
}
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
async getFeedConfiguration(categoryName) {
|
|
37
|
-
return this.configProvider.getFeedConfiguration(categoryName);
|
|
38
|
-
}
|
|
39
|
-
async getServerMcpConfig(categoryName, serverName) {
|
|
40
|
-
return this.configProvider.getServerMcpConfig(categoryName, serverName);
|
|
41
|
-
}
|
|
42
|
-
async installServer(categoryName, serverName, requestOptions = {}) {
|
|
43
|
-
try {
|
|
44
|
-
const server = await this.configProvider.getServerCategory(categoryName);
|
|
45
|
-
if (!server) {
|
|
46
|
-
return {
|
|
47
|
-
success: false,
|
|
48
|
-
message: `Server category ${categoryName} is not onboarded`,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const installResult = await this.installationService.install(categoryName, serverName, requestOptions);
|
|
52
|
-
if (!installResult.success) {
|
|
53
|
-
return installResult;
|
|
54
|
-
}
|
|
55
|
-
this.emit(MCPEvent.SERVER_INSTALLED, { server });
|
|
56
|
-
return installResult;
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
console.error(`Unexpected error during installServer for ${serverName}:`, error);
|
|
60
|
-
return {
|
|
61
|
-
success: false,
|
|
62
|
-
message: `Failed to install ${serverName}: ${error instanceof Error ? error.message : String(error)}`,
|
|
63
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async uninstallServer(categoryName, serverName, options = {}) {
|
|
68
|
-
try {
|
|
69
|
-
const serverCategory = await this.configProvider.getServerCategory(categoryName);
|
|
70
|
-
if (!serverCategory) {
|
|
71
|
-
return {
|
|
72
|
-
success: false,
|
|
73
|
-
message: `Server category ${categoryName} is not onboarded`,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const { targets = [], removeData = false } = options;
|
|
77
|
-
// Clear installation status for specified targets
|
|
78
|
-
const currentStatus = serverCategory.installationStatus || {
|
|
79
|
-
requirementsStatus: {},
|
|
80
|
-
serversStatus: {},
|
|
81
|
-
lastUpdated: new Date().toISOString()
|
|
82
|
-
};
|
|
83
|
-
const serversStatus = currentStatus.serversStatus || {};
|
|
84
|
-
const serverStatus = serversStatus[serverName] || { installedStatus: {}, name: serverName };
|
|
85
|
-
// Only reset installedStatus for specified targets
|
|
86
|
-
for (const target of targets) {
|
|
87
|
-
if (serverStatus.installedStatus) {
|
|
88
|
-
delete serverStatus.installedStatus[target];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (removeData) {
|
|
92
|
-
for (const target of targets) {
|
|
93
|
-
await this.configProvider.removeServerFromClientMCPSettings(serverName, target);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
// Update server status
|
|
97
|
-
serversStatus[serverName] = serverStatus;
|
|
98
|
-
// Update status keeping requirements
|
|
99
|
-
await this.configProvider.updateInstallationStatus(categoryName, currentStatus.requirementsStatus || {}, serversStatus);
|
|
100
|
-
this.emit(MCPEvent.SERVER_UNINSTALLED, { serverName, targets });
|
|
101
|
-
return {
|
|
102
|
-
success: true,
|
|
103
|
-
message: `Successfully uninstalled ${serverName} from ${targets.join(', ')}`,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
return {
|
|
108
|
-
success: false,
|
|
109
|
-
message: `Failed to uninstall ${serverName}`,
|
|
110
|
-
error: error,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async updateRequirement(categoryName, serverName, requirementName, updateVersion) {
|
|
115
|
-
try {
|
|
116
|
-
const { requirementService } = await import('./RequirementService.js');
|
|
117
|
-
const serverCategory = await this.configProvider.getServerCategory(categoryName);
|
|
118
|
-
if (!serverCategory) {
|
|
119
|
-
return {
|
|
120
|
-
success: false,
|
|
121
|
-
message: `Server category ${categoryName} is not onboarded`,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
if (!serverCategory.feedConfiguration) {
|
|
125
|
-
return {
|
|
126
|
-
success: false,
|
|
127
|
-
message: `Server category ${categoryName} has no feed configuration`,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
// Find the requirement
|
|
131
|
-
const requirement = serverCategory.feedConfiguration.requirements.find(r => r.name === requirementName);
|
|
132
|
-
if (!requirement) {
|
|
133
|
-
return {
|
|
134
|
-
success: false,
|
|
135
|
-
message: `Requirement ${requirementName} not found in category ${categoryName}`,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
// Update the requirement using requirementService
|
|
139
|
-
const updatedStatus = await requirementService.updateRequirement(requirement, updateVersion);
|
|
140
|
-
// Update the status in configuration
|
|
141
|
-
await this.configProvider.updateRequirementStatus(categoryName, requirementName, updatedStatus);
|
|
142
|
-
return {
|
|
143
|
-
success: true,
|
|
144
|
-
message: `Successfully updated ${requirementName} to version ${updateVersion}`,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
console.error(`Error updating requirement ${requirementName}:`, error);
|
|
149
|
-
return {
|
|
150
|
-
success: false,
|
|
151
|
-
message: `Failed to update ${requirementName}: ${error instanceof Error ? error.message : String(error)}`,
|
|
152
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Onboards a new feed configuration
|
|
158
|
-
* @param config The feed configuration to onboard
|
|
159
|
-
*/
|
|
160
|
-
async onboardFeed(config) {
|
|
161
|
-
try {
|
|
162
|
-
const result = await this.feedOnboardService.onboardFeed(config);
|
|
163
|
-
// After successful onboarding initiation, sync feeds to get the latest changes
|
|
164
|
-
// Syncing should ideally happen after the PR is merged, but for now,
|
|
165
|
-
// syncing here makes the new (pending) category available locally if needed.
|
|
166
|
-
// Consider if syncFeeds should be conditional based on operation status or handled differently.
|
|
167
|
-
await this.syncFeeds();
|
|
168
|
-
return result;
|
|
169
|
-
}
|
|
170
|
-
catch (error) {
|
|
171
|
-
Logger.error('Failed to onboard feed in MCPManager:', error);
|
|
172
|
-
throw error; // Rethrow or handle by returning a failed OperationStatus
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
// Type-safe event emitter methods
|
|
176
|
-
emit(event, data) {
|
|
177
|
-
return super.emit(event, data);
|
|
178
|
-
}
|
|
179
|
-
on(event, listener) {
|
|
180
|
-
return super.on(event, listener);
|
|
181
|
-
}
|
|
182
|
-
off(event, listener) {
|
|
183
|
-
return super.off(event, listener);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// Export a singleton instance
|
|
187
|
-
export const mcpManager = new MCPManager();
|
|
188
|
-
//# sourceMappingURL=MCPManager.js.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { RequirementConfig, RequirementStatus, ServerInstallOptions } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Service responsible for managing requirements installation and status
|
|
4
|
-
*/
|
|
5
|
-
export declare class RequirementService {
|
|
6
|
-
private static instance;
|
|
7
|
-
private installerFactory;
|
|
8
|
-
private constructor();
|
|
9
|
-
/**
|
|
10
|
-
* Get the singleton instance of RequirementService
|
|
11
|
-
* @returns The RequirementService instance
|
|
12
|
-
*/
|
|
13
|
-
static getInstance(): RequirementService;
|
|
14
|
-
/**
|
|
15
|
-
* Check the installation status of a requirement
|
|
16
|
-
* @param requirement The requirement to check
|
|
17
|
-
* @returns The installation status
|
|
18
|
-
*/
|
|
19
|
-
checkRequirementStatus(requirement: RequirementConfig, options?: ServerInstallOptions): Promise<RequirementStatus>;
|
|
20
|
-
/**
|
|
21
|
-
* Check if updates are available for a requirement
|
|
22
|
-
* @param requirement The requirement to check for updates
|
|
23
|
-
* @returns Updated status with available updates information
|
|
24
|
-
*/
|
|
25
|
-
checkRequirementForUpdates(requirement: RequirementConfig, currentStatus: RequirementStatus): Promise<RequirementStatus>;
|
|
26
|
-
/**
|
|
27
|
-
* Update a requirement to a new version
|
|
28
|
-
* @param requirement The requirement configuration
|
|
29
|
-
* @param updateVersion The version to update to
|
|
30
|
-
* @returns The updated requirement status
|
|
31
|
-
*/
|
|
32
|
-
updateRequirement(requirement: RequirementConfig, updateVersion: string, options?: ServerInstallOptions): Promise<RequirementStatus>;
|
|
33
|
-
/**
|
|
34
|
-
* Validate a requirement configuration
|
|
35
|
-
* @param requirement The requirement to validate
|
|
36
|
-
* @throws Error if the requirement is invalid
|
|
37
|
-
*/
|
|
38
|
-
private validateRequirement;
|
|
39
|
-
}
|
|
40
|
-
export declare const requirementService: RequirementService;
|