imcp 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -45
- package/dist/core/installers/clients/BaseClientInstaller.d.ts +1 -5
- package/dist/core/installers/clients/BaseClientInstaller.js +40 -38
- package/dist/core/installers/clients/ClientInstaller.d.ts +9 -9
- package/dist/core/installers/clients/ClientInstaller.js +105 -99
- package/dist/core/installers/requirements/BaseInstaller.d.ts +9 -1
- package/dist/core/installers/requirements/CommandInstaller.d.ts +9 -1
- package/dist/core/installers/requirements/CommandInstaller.js +46 -12
- package/dist/core/installers/requirements/GeneralInstaller.d.ts +11 -1
- package/dist/core/installers/requirements/GeneralInstaller.js +46 -10
- package/dist/core/installers/requirements/InstallerFactory.d.ts +3 -1
- package/dist/core/installers/requirements/InstallerFactory.js +3 -2
- package/dist/core/installers/requirements/NpmInstaller.d.ts +4 -2
- package/dist/core/installers/requirements/NpmInstaller.js +38 -22
- package/dist/core/installers/requirements/PipInstaller.d.ts +3 -1
- package/dist/core/installers/requirements/PipInstaller.js +58 -36
- package/dist/core/installers/requirements/RequirementInstaller.d.ts +4 -1
- package/dist/core/loaders/InstallOperationManager.d.ts +115 -0
- package/dist/core/loaders/InstallOperationManager.js +311 -0
- package/dist/core/loaders/SystemSettingsManager.d.ts +54 -0
- package/dist/core/loaders/SystemSettingsManager.js +257 -0
- package/dist/core/metadatas/recordingConstants.d.ts +44 -0
- package/dist/core/metadatas/recordingConstants.js +45 -0
- package/dist/core/metadatas/types.d.ts +21 -0
- package/dist/core/onboard/InstallOperationManager.d.ts +23 -0
- package/dist/core/onboard/InstallOperationManager.js +144 -0
- package/dist/core/onboard/OnboardStatusManager.js +2 -1
- package/dist/core/validators/StdioServerValidator.js +4 -3
- package/dist/services/InstallationService.d.ts +2 -37
- package/dist/services/InstallationService.js +45 -313
- package/dist/services/MCPManager.d.ts +1 -1
- package/dist/services/MCPManager.js +4 -58
- package/dist/services/RequirementService.d.ts +85 -12
- package/dist/services/RequirementService.js +488 -49
- package/dist/services/ServerService.d.ts +0 -6
- package/dist/services/ServerService.js +0 -74
- package/dist/utils/adoUtils.js +6 -3
- package/dist/utils/logger.js +1 -1
- package/dist/utils/macroExpressionUtils.js +3 -25
- package/dist/utils/osUtils.d.ts +22 -1
- package/dist/utils/osUtils.js +92 -1
- package/dist/utils/versionUtils.d.ts +20 -1
- package/dist/utils/versionUtils.js +51 -4
- package/dist/web/public/css/modal.css +292 -1
- package/dist/web/public/css/serverDetails.css +14 -1
- package/dist/web/public/index.html +122 -20
- package/dist/web/public/js/flights/flights.js +1 -0
- package/dist/web/public/js/modal/index.js +8 -14
- package/dist/web/public/js/modal/installModal.js +3 -4
- package/dist/web/public/js/modal/installation.js +122 -137
- package/dist/web/public/js/modal/loadingModal.js +155 -25
- package/dist/web/public/js/modal/messageQueue.js +45 -101
- package/dist/web/public/js/modal/modalSetup.js +125 -43
- package/dist/web/public/js/modal/modalUtils.js +0 -12
- package/dist/web/public/js/modal.js +23 -10
- package/dist/web/public/js/onboard/publishHandler.js +22 -20
- package/dist/web/public/js/serverCategoryDetails.js +60 -11
- package/dist/web/public/js/serverCategoryList.js +2 -2
- package/dist/web/public/js/settings.js +314 -0
- package/dist/web/public/settings.html +135 -0
- package/dist/web/public/styles.css +32 -0
- package/dist/web/server.js +82 -0
- package/memory-bank/activeContext.md +13 -1
- package/memory-bank/decisionLog.md +63 -0
- package/memory-bank/progress.md +30 -0
- package/memory-bank/systemPatterns.md +7 -0
- package/package.json +1 -1
- package/src/cli/index.ts +1 -48
- package/src/core/installers/clients/BaseClientInstaller.ts +64 -50
- package/src/core/installers/clients/ClientInstaller.ts +130 -130
- package/src/core/installers/requirements/BaseInstaller.ts +9 -1
- package/src/core/installers/requirements/CommandInstaller.ts +47 -13
- package/src/core/installers/requirements/GeneralInstaller.ts +48 -10
- package/src/core/installers/requirements/InstallerFactory.ts +4 -3
- package/src/core/installers/requirements/NpmInstaller.ts +90 -68
- package/src/core/installers/requirements/PipInstaller.ts +81 -55
- package/src/core/installers/requirements/RequirementInstaller.ts +4 -3
- package/src/core/loaders/InstallOperationManager.ts +367 -0
- package/src/core/loaders/SystemSettingsManager.ts +278 -0
- package/src/core/metadatas/recordingConstants.ts +62 -0
- package/src/core/metadatas/types.ts +23 -0
- package/src/core/onboard/OnboardStatusManager.ts +2 -1
- package/src/core/validators/StdioServerValidator.ts +4 -3
- package/src/services/InstallationService.ts +54 -399
- package/src/services/MCPManager.ts +4 -77
- package/src/services/RequirementService.ts +564 -67
- package/src/services/ServerService.ts +0 -90
- package/src/utils/adoUtils.ts +6 -4
- package/src/utils/logger.ts +1 -1
- package/src/utils/macroExpressionUtils.ts +4 -21
- package/src/utils/osUtils.ts +92 -1
- package/src/utils/versionUtils.ts +71 -19
- package/src/web/public/css/modal.css +292 -1
- package/src/web/public/css/serverDetails.css +14 -1
- package/src/web/public/index.html +122 -20
- package/src/web/public/js/flights/flights.js +1 -1
- package/src/web/public/js/modal/index.js +8 -14
- package/src/web/public/js/modal/installModal.js +3 -4
- package/src/web/public/js/modal/installation.js +122 -137
- package/src/web/public/js/modal/loadingModal.js +155 -25
- package/src/web/public/js/modal/modalSetup.js +125 -43
- package/src/web/public/js/modal/modalUtils.js +0 -12
- package/src/web/public/js/modal.js +23 -10
- package/src/web/public/js/onboard/publishHandler.js +22 -20
- package/src/web/public/js/serverCategoryDetails.js +60 -11
- package/src/web/public/js/serverCategoryList.js +2 -2
- package/src/web/public/js/settings.js +314 -0
- package/src/web/public/settings.html +135 -0
- package/src/web/public/styles.css +32 -0
- package/src/web/server.ts +85 -0
- package/src/web/public/js/modal/messageQueue.js +0 -112
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Step name constants for InstallOperationManager and step recording.
|
|
3
|
+
*
|
|
4
|
+
* This file defines all static step names and documents dynamic step name patterns
|
|
5
|
+
* used throughout the installation and onboarding process.
|
|
6
|
+
*
|
|
7
|
+
* Dynamic step names are documented as template string patterns.
|
|
8
|
+
*/
|
|
9
|
+
/** Step for processing all requirement updates in a batch operation. */
|
|
10
|
+
export const STEP_PROCESS_REQUIREMENT_UPDATES = 'Processing all requirement updates';
|
|
11
|
+
/** Step for checking the status of a specific requirement. */
|
|
12
|
+
export const STEP_CHECKING_REQUIREMENT_STATUS = 'Checking the status of requirement';
|
|
13
|
+
/** Step for installing requirements in the background process. */
|
|
14
|
+
export const STEP_INSTALLING_REQUIREMENTS_IN_BACKGROUND = 'Installing requirements in the background';
|
|
15
|
+
/** Step for checking and installing all requirements as needed. */
|
|
16
|
+
export const STEP_CHECK_AND_INSTALL_REQUIREMENTS = 'Checking and installing all requirements';
|
|
17
|
+
/** Step for running the install logic in the CommandInstaller. */
|
|
18
|
+
export const STEP_COMMAND_INSTALLER_INSTALL = 'Running install in CommandInstaller';
|
|
19
|
+
/** Step for running the install logic in the GeneralInstaller. */
|
|
20
|
+
export const STEP_GENERAL_INSTALLER_INSTALL = 'Running install in GeneralInstaller';
|
|
21
|
+
/** Step for executing the actual installation command (npm, pip, etc.). */
|
|
22
|
+
export const STEP_INSTALLATION_COMMAND_EXECUTION = 'Executing installation command for requirement';
|
|
23
|
+
/** Step for running the install logic in the PipInstaller. */
|
|
24
|
+
export const STEP_PIP_INSTALLER_INSTALL = 'Running install in PipInstaller';
|
|
25
|
+
/** Step for processing requirement updates in the RequirementService. */
|
|
26
|
+
export const STEP_PROCESS_REQUIREMENT_UPDATES_SERVICE = 'Processing requirement updates in RequirementService';
|
|
27
|
+
/** Step for checking if the server is ready after installation. */
|
|
28
|
+
export const STEP_CHECK_SERVER_READINESS = 'Checking server readiness after installation';
|
|
29
|
+
/** Step for running the install logic in the NpmInstaller. */
|
|
30
|
+
export const STEP_NPM_INSTALLER_INSTALL = 'Running install in NpmInstaller';
|
|
31
|
+
/** Prefix for steps that update a specific requirement. */
|
|
32
|
+
export const STEP_INSTALL_REQUIREMENT_PREFIX = 'Updating requirement:';
|
|
33
|
+
/** Prefix for steps that execute an installation command for a requirement. */
|
|
34
|
+
export const STEP_INSTALL_COMMAND_PREFIX = 'Executing installation command for:';
|
|
35
|
+
/** Step for checking and installing the VS Code extension for the client. */
|
|
36
|
+
export const STEP_CHECK_VSCODE_AND_INSTALL_EXTENSION = 'Checking and installing VS Code extension for client';
|
|
37
|
+
/** Step for setting up the installation configuration (env, args, etc.). */
|
|
38
|
+
export const STEP_SETUP_INSTALLATION_CONFIG = 'Setting up installation configuration';
|
|
39
|
+
/** Step for updating VS Code settings for the client/server. */
|
|
40
|
+
export const STEP_UPDATE_VSCODE_SETTINGS = 'Updating VS Code settings for client/server';
|
|
41
|
+
/** Step for the overall installation process of a client or server. */
|
|
42
|
+
export const STEP_INSTALLATION = 'Running overall installation process';
|
|
43
|
+
/** Step for marking the initiation of an onboarding or installation process. */
|
|
44
|
+
export const STEP_INITIATED = 'Initiating onboarding or installation process';
|
|
45
|
+
//# sourceMappingURL=recordingConstants.js.map
|
|
@@ -165,3 +165,24 @@ export interface MCPEventData {
|
|
|
165
165
|
configuration: MCPConfiguration;
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
+
export interface InstallOperationStep {
|
|
169
|
+
name: string;
|
|
170
|
+
status: 'pending' | 'in-progress' | 'completed' | 'failed' | 'canceled';
|
|
171
|
+
message?: string;
|
|
172
|
+
isCritical?: boolean;
|
|
173
|
+
timestamp: string;
|
|
174
|
+
}
|
|
175
|
+
export interface InstallOperationDetails {
|
|
176
|
+
currentStep: string;
|
|
177
|
+
steps: InstallOperationStep[];
|
|
178
|
+
lastUpdated: string;
|
|
179
|
+
error?: string;
|
|
180
|
+
overallStatus: 'pending' | 'in-progress' | 'completed' | 'failed';
|
|
181
|
+
}
|
|
182
|
+
export interface SystemSettings {
|
|
183
|
+
pythonEnvs?: Record<string, string>;
|
|
184
|
+
nodePath?: string;
|
|
185
|
+
browserPath?: string;
|
|
186
|
+
systemEnvironments?: Record<string, string>;
|
|
187
|
+
userConfigurations?: Record<string, string>;
|
|
188
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InstallOperationDetails } from '../metadatas/types.js';
|
|
2
|
+
export declare class InstallOperationManager {
|
|
3
|
+
private static instance;
|
|
4
|
+
private installOperationStatus;
|
|
5
|
+
private statusLock;
|
|
6
|
+
private constructor();
|
|
7
|
+
static getInstance(): InstallOperationManager;
|
|
8
|
+
private withLock;
|
|
9
|
+
private loadStatuses;
|
|
10
|
+
private saveStatuses;
|
|
11
|
+
private createOperationKey;
|
|
12
|
+
recordStep(categoryName: string, serverName: string, stepName: string, isSucceeded: boolean, message?: string): Promise<InstallOperationDetails>;
|
|
13
|
+
/**
|
|
14
|
+
* Resets (deletes) the operation status for a given category and server.
|
|
15
|
+
* This is useful to call before starting a new installation attempt.
|
|
16
|
+
* @param categoryName The name of the category.
|
|
17
|
+
* @param serverName The name of the server.
|
|
18
|
+
*/
|
|
19
|
+
resetOperation(categoryName: string, serverName: string): Promise<void>;
|
|
20
|
+
getDetails(categoryName: string, serverName: string): Promise<InstallOperationDetails | undefined>;
|
|
21
|
+
getAllDetails(): Promise<Record<string, InstallOperationDetails>>;
|
|
22
|
+
}
|
|
23
|
+
export declare const installOperationManager: InstallOperationManager;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { SETTINGS_DIR } from '../metadatas/constants.js';
|
|
4
|
+
import { Logger } from '../../utils/logger.js';
|
|
5
|
+
const INSTALL_STATUS_DIR = path.join(SETTINGS_DIR, 'install');
|
|
6
|
+
const INSTALL_OPERATION_STATUS_FILE = path.join(INSTALL_STATUS_DIR, 'InstallOperationStatus.json');
|
|
7
|
+
export class InstallOperationManager {
|
|
8
|
+
static instance;
|
|
9
|
+
installOperationStatus = {};
|
|
10
|
+
statusLock = Promise.resolve();
|
|
11
|
+
constructor() {
|
|
12
|
+
this.loadStatuses().catch(error => Logger.error('Failed to initialize InstallOperationManager:', error));
|
|
13
|
+
}
|
|
14
|
+
static getInstance() {
|
|
15
|
+
if (!InstallOperationManager.instance) {
|
|
16
|
+
InstallOperationManager.instance = new InstallOperationManager();
|
|
17
|
+
}
|
|
18
|
+
return InstallOperationManager.instance;
|
|
19
|
+
}
|
|
20
|
+
async withLock(operation) {
|
|
21
|
+
const current = this.statusLock;
|
|
22
|
+
let resolve;
|
|
23
|
+
this.statusLock = new Promise(r => resolve = r);
|
|
24
|
+
try {
|
|
25
|
+
await current;
|
|
26
|
+
return await operation();
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
resolve();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async loadStatuses() {
|
|
33
|
+
await this.withLock(async () => {
|
|
34
|
+
try {
|
|
35
|
+
await fs.mkdir(INSTALL_STATUS_DIR, { recursive: true });
|
|
36
|
+
const data = await fs.readFile(INSTALL_OPERATION_STATUS_FILE, 'utf-8');
|
|
37
|
+
this.installOperationStatus = JSON.parse(data);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error.code === 'ENOENT') {
|
|
41
|
+
this.installOperationStatus = {};
|
|
42
|
+
await this.saveStatuses(); // Create the file if it doesn't exist
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
Logger.error('Failed to load install operation statuses:', error);
|
|
46
|
+
this.installOperationStatus = {}; // Initialize with empty statuses in case of other errors
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
async saveStatuses() {
|
|
52
|
+
await fs.mkdir(INSTALL_STATUS_DIR, { recursive: true });
|
|
53
|
+
await fs.writeFile(INSTALL_OPERATION_STATUS_FILE, JSON.stringify(this.installOperationStatus, null, 2));
|
|
54
|
+
}
|
|
55
|
+
createOperationKey(categoryName, serverName) {
|
|
56
|
+
return `${categoryName}-${serverName}`;
|
|
57
|
+
}
|
|
58
|
+
async recordStep(categoryName, serverName, stepName, isSucceeded, message) {
|
|
59
|
+
return await this.withLock(async () => {
|
|
60
|
+
const operationKey = this.createOperationKey(categoryName, serverName);
|
|
61
|
+
let operationDetails = this.installOperationStatus[operationKey];
|
|
62
|
+
const newStep = {
|
|
63
|
+
name: stepName,
|
|
64
|
+
isSucceeded,
|
|
65
|
+
message,
|
|
66
|
+
timestamp: new Date().toISOString(),
|
|
67
|
+
};
|
|
68
|
+
if (!operationDetails) {
|
|
69
|
+
operationDetails = {
|
|
70
|
+
currentStep: stepName,
|
|
71
|
+
steps: [newStep],
|
|
72
|
+
lastUpdated: new Date().toISOString(),
|
|
73
|
+
error: !isSucceeded ? message : undefined,
|
|
74
|
+
overallStatus: isSucceeded ? 'in-progress' : 'failed',
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
operationDetails.steps.push(newStep);
|
|
79
|
+
operationDetails.currentStep = stepName;
|
|
80
|
+
operationDetails.lastUpdated = new Date().toISOString();
|
|
81
|
+
if (!isSucceeded) {
|
|
82
|
+
operationDetails.overallStatus = 'failed';
|
|
83
|
+
if (!operationDetails.error) { // Store the first error
|
|
84
|
+
operationDetails.error = message;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// If this step succeeded, check if all previous steps also succeeded.
|
|
89
|
+
// If a previous step failed, the overall status remains 'failed'.
|
|
90
|
+
// If all steps are successful so far, it's 'in-progress' unless it's a known completion step.
|
|
91
|
+
if (operationDetails.overallStatus !== 'failed') {
|
|
92
|
+
if (stepName.toLowerCase().includes('completed') || stepName.toLowerCase().includes('succeeded')) {
|
|
93
|
+
// Check if this is a "final" success step
|
|
94
|
+
const isFinalSuccess = operationDetails.steps.every(s => s.isSucceeded);
|
|
95
|
+
operationDetails.overallStatus = isFinalSuccess ? 'completed' : 'in-progress';
|
|
96
|
+
if (isFinalSuccess)
|
|
97
|
+
operationDetails.error = undefined; // Clear error on final success
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
operationDetails.overallStatus = 'in-progress';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Special handling for the "InstallCompleted" step or similar final step names
|
|
106
|
+
if (stepName === 'InstallCompleted') {
|
|
107
|
+
operationDetails.overallStatus = isSucceeded ? 'completed' : 'failed';
|
|
108
|
+
if (isSucceeded)
|
|
109
|
+
operationDetails.error = undefined;
|
|
110
|
+
}
|
|
111
|
+
this.installOperationStatus[operationKey] = operationDetails;
|
|
112
|
+
await this.saveStatuses();
|
|
113
|
+
return operationDetails;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Resets (deletes) the operation status for a given category and server.
|
|
118
|
+
* This is useful to call before starting a new installation attempt.
|
|
119
|
+
* @param categoryName The name of the category.
|
|
120
|
+
* @param serverName The name of the server.
|
|
121
|
+
*/
|
|
122
|
+
async resetOperation(categoryName, serverName) {
|
|
123
|
+
await this.withLock(async () => {
|
|
124
|
+
const operationKey = this.createOperationKey(categoryName, serverName);
|
|
125
|
+
if (this.installOperationStatus[operationKey]) {
|
|
126
|
+
delete this.installOperationStatus[operationKey];
|
|
127
|
+
Logger.info(`Reset installation operation status for ${operationKey}`);
|
|
128
|
+
await this.saveStatuses();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
async getDetails(categoryName, serverName) {
|
|
133
|
+
await this.loadStatuses(); // Ensure latest statuses are loaded
|
|
134
|
+
const operationKey = this.createOperationKey(categoryName, serverName);
|
|
135
|
+
return this.installOperationStatus[operationKey];
|
|
136
|
+
}
|
|
137
|
+
async getAllDetails() {
|
|
138
|
+
await this.loadStatuses();
|
|
139
|
+
return this.installOperationStatus;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Export singleton instance
|
|
143
|
+
export const installOperationManager = InstallOperationManager.getInstance();
|
|
144
|
+
//# sourceMappingURL=InstallOperationManager.js.map
|
|
@@ -3,6 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import { SETTINGS_DIR } from '../metadatas/constants.js';
|
|
4
4
|
import { OnboardingProcessStatus } from './OnboardStatus.js';
|
|
5
5
|
import { Logger } from '../../utils/logger.js';
|
|
6
|
+
import * as RecordingConstants from '../metadatas/recordingConstants.js';
|
|
6
7
|
const ONBOARD_STATUS_DIR = path.join(SETTINGS_DIR, 'onboard');
|
|
7
8
|
const CATEGORY_OPERATIONS_STATUS_FILE = path.join(ONBOARD_STATUS_DIR, 'OnboardStatus.json');
|
|
8
9
|
const FEED_CONFIG_DIR = path.join(ONBOARD_STATUS_DIR, 'feed_configs'); // Staging for feed configs during operation
|
|
@@ -267,7 +268,7 @@ export class OnboardStatusManager {
|
|
|
267
268
|
feedName: categoryName,
|
|
268
269
|
serverName,
|
|
269
270
|
status: OnboardingProcessStatus.PENDING,
|
|
270
|
-
steps: [{ stepName:
|
|
271
|
+
steps: [{ stepName: RecordingConstants.STEP_INITIATED, timestamp: new Date().toISOString() }],
|
|
271
272
|
lastUpdated: new Date().toISOString(),
|
|
272
273
|
operationType,
|
|
273
274
|
errorMessage: undefined,
|
|
@@ -6,6 +6,7 @@ import { MACRO_EXPRESSIONS, resolveNpmModulePath } from "../../utils/macroExpres
|
|
|
6
6
|
import { getSystemPythonPackageDirectory } from "../../utils/osUtils.js";
|
|
7
7
|
import { SETTINGS_DIR } from "../metadatas/constants.js";
|
|
8
8
|
import path from "path";
|
|
9
|
+
import { InstallOperationManager } from "../loaders/InstallOperationManager.js";
|
|
9
10
|
const execPromise = util.promisify(exec);
|
|
10
11
|
/**
|
|
11
12
|
* Validates MCP server configurations for stdio mode
|
|
@@ -45,7 +46,7 @@ export class StdioServerValidator {
|
|
|
45
46
|
* @param requirement The requirement config to validate and install
|
|
46
47
|
* @returns true if requirement is successfully installed/validated
|
|
47
48
|
*/
|
|
48
|
-
async validateRequirement(requirement) {
|
|
49
|
+
async validateRequirement(requirement, recorder) {
|
|
49
50
|
try {
|
|
50
51
|
Logger.debug(`Validating/installing requirement: ${requirement.name}`);
|
|
51
52
|
const installer = this.installerFactory.getInstaller(requirement);
|
|
@@ -55,7 +56,7 @@ export class StdioServerValidator {
|
|
|
55
56
|
throw new Error(msg);
|
|
56
57
|
}
|
|
57
58
|
const targetDir = this._getRequirementFolderPath(requirement);
|
|
58
|
-
const status = await installer.install(requirement, { settings: { folderName: targetDir } });
|
|
59
|
+
const status = await installer.install(requirement, recorder, { settings: { folderName: targetDir } });
|
|
59
60
|
if (!status.installed) {
|
|
60
61
|
const msg = `Failed to install requirement ${requirement.name}: ${status.error || 'Unknown error'}`;
|
|
61
62
|
Logger.error(msg);
|
|
@@ -257,7 +258,7 @@ export class StdioServerValidator {
|
|
|
257
258
|
version: req.version,
|
|
258
259
|
type: 'npm' // Default to npm if not specified
|
|
259
260
|
};
|
|
260
|
-
const isValid = await this.validateRequirement(reqConfig);
|
|
261
|
+
const isValid = await this.validateRequirement(reqConfig, InstallOperationManager.getInstance(config.name, server.name));
|
|
261
262
|
if (!isValid) {
|
|
262
263
|
throw new Error(`Dependency validation failed for: ${req.name}`);
|
|
263
264
|
}
|
|
@@ -3,48 +3,13 @@ import { ServerInstallOptions, ServerOperationResult } from '../core/metadatas/t
|
|
|
3
3
|
* Handles the actual installation process for an MCP server.
|
|
4
4
|
*/
|
|
5
5
|
export declare class InstallationService {
|
|
6
|
-
private activeInstallations;
|
|
7
|
-
private installerFactory;
|
|
8
6
|
constructor();
|
|
9
|
-
private generateOperationId;
|
|
10
7
|
/**
|
|
11
|
-
* Installs a server based on the provided options
|
|
8
|
+
* Installs a server based on the provided options.
|
|
9
|
+
* @param categoryName The category name of the server.
|
|
12
10
|
* @param serverName The name of the server to install.
|
|
13
11
|
* @param options The installation options.
|
|
14
12
|
* @returns A result object indicating success or failure.
|
|
15
13
|
*/
|
|
16
14
|
install(categoryName: string, serverName: string, options: ServerInstallOptions): Promise<ServerOperationResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Process requirement updates specified in serverInstallOptions
|
|
19
|
-
* All updates are processed in parallel for maximum efficiency
|
|
20
|
-
* @param categoryName The category name
|
|
21
|
-
* @param serverName The server name
|
|
22
|
-
* @param requirements The requirements to update
|
|
23
|
-
*/
|
|
24
|
-
private processRequirementUpdates;
|
|
25
|
-
/**
|
|
26
|
-
* Checks and installs requirements for a server if needed
|
|
27
|
-
* @param categoryName The category name
|
|
28
|
-
* @param serverName The server name
|
|
29
|
-
* @param options The installation options
|
|
30
|
-
* @returns A failure result if requirements check fails, null if requirements are satisfied
|
|
31
|
-
*/
|
|
32
|
-
private checkAndInstallRequirements;
|
|
33
|
-
/**
|
|
34
|
-
* Installs requirements in background without blocking the main thread
|
|
35
|
-
* Requirements with the same order are installed in parallel
|
|
36
|
-
*/
|
|
37
|
-
private installRequirementsInBackground;
|
|
38
|
-
/**
|
|
39
|
-
* Helper to update requirement status for failure case
|
|
40
|
-
*/
|
|
41
|
-
private updateRequirementFailureStatus;
|
|
42
|
-
/**
|
|
43
|
-
* Helper to update requirement status for in-progress case
|
|
44
|
-
*/
|
|
45
|
-
private updateRequirementProgressStatus;
|
|
46
|
-
/**
|
|
47
|
-
* Helper to update requirement status for completion case
|
|
48
|
-
*/
|
|
49
|
-
private updateRequirementCompletionStatus;
|
|
50
15
|
}
|