imcp 0.0.14 → 0.0.16
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/core/ConfigurationProvider.d.ts +1 -0
- package/dist/core/ConfigurationProvider.js +15 -0
- package/dist/core/InstallationService.js +2 -7
- package/dist/core/MCPManager.d.ts +11 -2
- package/dist/core/MCPManager.js +24 -1
- package/dist/core/RequirementService.js +2 -8
- package/dist/core/installers/clients/BaseClientInstaller.d.ts +51 -0
- package/dist/core/installers/clients/BaseClientInstaller.js +160 -0
- package/dist/core/installers/clients/ClientInstaller.d.ts +16 -9
- package/dist/core/installers/clients/ClientInstaller.js +80 -527
- package/dist/core/installers/clients/ClientInstallerFactory.d.ts +20 -0
- package/dist/core/installers/clients/ClientInstallerFactory.js +37 -0
- package/dist/core/installers/clients/ClineInstaller.d.ts +18 -0
- package/dist/core/installers/clients/ClineInstaller.js +124 -0
- package/dist/core/installers/clients/GithubCopilotInstaller.d.ts +34 -0
- package/dist/core/installers/clients/GithubCopilotInstaller.js +162 -0
- package/dist/core/installers/clients/MSRooCodeInstaller.d.ts +15 -0
- package/dist/core/installers/clients/MSRooCodeInstaller.js +122 -0
- package/dist/core/installers/requirements/BaseInstaller.d.ts +11 -34
- package/dist/core/installers/requirements/BaseInstaller.js +5 -116
- package/dist/core/installers/requirements/CommandInstaller.d.ts +6 -1
- package/dist/core/installers/requirements/CommandInstaller.js +7 -0
- package/dist/core/installers/requirements/GeneralInstaller.d.ts +6 -1
- package/dist/core/installers/requirements/GeneralInstaller.js +9 -4
- package/dist/core/installers/requirements/NpmInstaller.d.ts +46 -7
- package/dist/core/installers/requirements/NpmInstaller.js +150 -58
- package/dist/core/installers/requirements/PipInstaller.d.ts +9 -0
- package/dist/core/installers/requirements/PipInstaller.js +66 -28
- package/dist/core/onboard/FeedOnboardService.d.ts +50 -13
- package/dist/core/onboard/FeedOnboardService.js +263 -88
- package/dist/core/onboard/OnboardProcessor.d.ts +79 -0
- package/dist/core/onboard/OnboardProcessor.js +290 -0
- package/dist/core/onboard/OnboardStatus.d.ts +49 -0
- package/dist/core/onboard/OnboardStatus.js +10 -0
- package/dist/core/onboard/OnboardStatusManager.d.ts +57 -0
- package/dist/core/onboard/OnboardStatusManager.js +176 -0
- package/dist/core/types.d.ts +4 -5
- package/dist/core/validators/FeedValidator.d.ts +8 -1
- package/dist/core/validators/FeedValidator.js +60 -7
- package/dist/core/validators/IServerValidator.d.ts +19 -0
- package/dist/core/validators/IServerValidator.js +2 -0
- package/dist/core/validators/SSEServerValidator.d.ts +15 -0
- package/dist/core/validators/SSEServerValidator.js +39 -0
- package/dist/core/validators/ServerValidatorFactory.d.ts +24 -0
- package/dist/core/validators/ServerValidatorFactory.js +45 -0
- package/dist/core/validators/StdioServerValidator.d.ts +46 -0
- package/dist/core/validators/StdioServerValidator.js +229 -0
- package/dist/services/InstallRequestValidator.d.ts +1 -1
- package/dist/services/ServerService.d.ts +9 -6
- package/dist/services/ServerService.js +18 -7
- package/dist/utils/adoUtils.d.ts +29 -0
- package/dist/utils/adoUtils.js +252 -0
- package/dist/utils/clientUtils.d.ts +0 -7
- package/dist/utils/clientUtils.js +0 -42
- package/dist/utils/githubUtils.d.ts +10 -0
- package/dist/utils/githubUtils.js +22 -0
- package/dist/utils/macroExpressionUtils.d.ts +38 -0
- package/dist/utils/macroExpressionUtils.js +116 -0
- package/dist/utils/osUtils.d.ts +4 -20
- package/dist/utils/osUtils.js +78 -23
- package/dist/web/contract/serverContract.d.ts +3 -1
- package/dist/web/public/css/notifications.css +48 -17
- package/dist/web/public/css/onboard.css +66 -3
- package/dist/web/public/index.html +84 -16
- package/dist/web/public/js/api.js +3 -6
- package/dist/web/public/js/flights/flights.js +127 -0
- package/dist/web/public/js/modal/installation.js +5 -5
- package/dist/web/public/js/modal/modalSetup.js +3 -2
- package/dist/web/public/js/notifications.js +66 -27
- package/dist/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +338 -0
- package/dist/web/public/js/onboard/formProcessor.js +810 -255
- package/dist/web/public/js/onboard/index.js +328 -85
- package/dist/web/public/js/onboard/publishHandler.js +132 -0
- package/dist/web/public/js/onboard/state.js +61 -17
- package/dist/web/public/js/onboard/templates.js +217 -249
- package/dist/web/public/js/onboard/uiHandlers.js +679 -117
- package/dist/web/public/js/onboard/validationHandlers.js +378 -0
- package/dist/web/public/js/serverCategoryList.js +15 -2
- package/dist/web/public/onboard.html +191 -45
- package/dist/web/public/styles.css +91 -1
- package/dist/web/server.d.ts +0 -10
- package/dist/web/server.js +131 -22
- package/package.json +2 -2
- package/src/core/ConfigurationProvider.ts +15 -0
- package/src/core/InstallationService.ts +2 -7
- package/src/core/MCPManager.ts +26 -1
- package/src/core/RequirementService.ts +2 -9
- package/src/core/installers/clients/BaseClientInstaller.ts +196 -0
- package/src/core/installers/clients/ClientInstaller.ts +97 -608
- package/src/core/installers/clients/ClientInstallerFactory.ts +43 -0
- package/src/core/installers/clients/ClineInstaller.ts +135 -0
- package/src/core/installers/clients/GithubCopilotInstaller.ts +179 -0
- package/src/core/installers/clients/MSRooCodeInstaller.ts +133 -0
- package/src/core/installers/requirements/BaseInstaller.ts +13 -136
- package/src/core/installers/requirements/CommandInstaller.ts +9 -1
- package/src/core/installers/requirements/GeneralInstaller.ts +11 -4
- package/src/core/installers/requirements/NpmInstaller.ts +178 -61
- package/src/core/installers/requirements/PipInstaller.ts +68 -29
- package/src/core/onboard/FeedOnboardService.ts +346 -0
- package/src/core/onboard/OnboardProcessor.ts +305 -0
- package/src/core/onboard/OnboardStatus.ts +55 -0
- package/src/core/onboard/OnboardStatusManager.ts +188 -0
- package/src/core/types.ts +4 -5
- package/src/core/validators/FeedValidator.ts +79 -0
- package/src/core/validators/IServerValidator.ts +21 -0
- package/src/core/validators/SSEServerValidator.ts +43 -0
- package/src/core/validators/ServerValidatorFactory.ts +51 -0
- package/src/core/validators/StdioServerValidator.ts +259 -0
- package/src/services/InstallRequestValidator.ts +1 -1
- package/src/services/ServerService.ts +22 -7
- package/src/utils/adoUtils.ts +291 -0
- package/src/utils/clientUtils.ts +0 -44
- package/src/utils/githubUtils.ts +24 -0
- package/src/utils/macroExpressionUtils.ts +121 -0
- package/src/utils/osUtils.ts +89 -24
- package/src/web/contract/serverContract.ts +74 -0
- package/src/web/public/css/notifications.css +48 -17
- package/src/web/public/css/onboard.css +107 -0
- package/src/web/public/index.html +84 -16
- package/src/web/public/js/api.js +3 -6
- package/src/web/public/js/flights/flights.js +127 -0
- package/src/web/public/js/modal/installation.js +5 -5
- package/src/web/public/js/modal/modalSetup.js +3 -2
- package/src/web/public/js/notifications.js +66 -27
- package/src/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +338 -0
- package/src/web/public/js/onboard/formProcessor.js +864 -0
- package/src/web/public/js/onboard/index.js +374 -0
- package/src/web/public/js/onboard/publishHandler.js +132 -0
- package/src/web/public/js/onboard/state.js +76 -0
- package/src/web/public/js/onboard/templates.js +343 -0
- package/src/web/public/js/onboard/uiHandlers.js +758 -0
- package/src/web/public/js/onboard/validationHandlers.js +378 -0
- package/src/web/public/js/serverCategoryList.js +15 -2
- package/src/web/public/onboard.html +296 -0
- package/src/web/public/styles.css +91 -1
- package/src/web/server.ts +167 -58
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
+
/**
|
|
3
|
+
* Factory for creating client-specific installers
|
|
4
|
+
* Handles creation of appropriate installer based on client type
|
|
5
|
+
*/
|
|
6
|
+
export declare class ClientInstallerFactory {
|
|
7
|
+
private static readonly installerMap;
|
|
8
|
+
/**
|
|
9
|
+
* Get a client installer instance based on client type
|
|
10
|
+
* @param clientName Name of the client to get installer for
|
|
11
|
+
* @returns Client-specific installer instance or undefined if client not supported
|
|
12
|
+
*/
|
|
13
|
+
static getInstaller(clientName: string): BaseClientInstaller | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a client is supported
|
|
16
|
+
* @param clientName Name of the client to check
|
|
17
|
+
* @returns True if client is supported, false otherwise
|
|
18
|
+
*/
|
|
19
|
+
static isClientSupported(clientName: string): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MSRooCodeInstaller } from './MSRooCodeInstaller.js';
|
|
2
|
+
import { ClineInstaller } from './ClineInstaller.js';
|
|
3
|
+
import { GithubCopilotInstaller } from './GithubCopilotInstaller.js';
|
|
4
|
+
import { SUPPORTED_CLIENTS } from '../../constants.js';
|
|
5
|
+
/**
|
|
6
|
+
* Factory for creating client-specific installers
|
|
7
|
+
* Handles creation of appropriate installer based on client type
|
|
8
|
+
*/
|
|
9
|
+
export class ClientInstallerFactory {
|
|
10
|
+
static installerMap = {
|
|
11
|
+
[Object.keys(SUPPORTED_CLIENTS)[0]]: MSRooCodeInstaller,
|
|
12
|
+
[Object.keys(SUPPORTED_CLIENTS)[1]]: ClineInstaller,
|
|
13
|
+
[Object.keys(SUPPORTED_CLIENTS)[2]]: GithubCopilotInstaller
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Get a client installer instance based on client type
|
|
17
|
+
* @param clientName Name of the client to get installer for
|
|
18
|
+
* @returns Client-specific installer instance or undefined if client not supported
|
|
19
|
+
*/
|
|
20
|
+
static getInstaller(clientName) {
|
|
21
|
+
// Check if client is supported
|
|
22
|
+
if (!SUPPORTED_CLIENTS[clientName]) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
const InstallerClass = this.installerMap[clientName];
|
|
26
|
+
return InstallerClass ? new InstallerClass() : undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Check if a client is supported
|
|
30
|
+
* @param clientName Name of the client to check
|
|
31
|
+
* @returns True if client is supported, false otherwise
|
|
32
|
+
*/
|
|
33
|
+
static isClientSupported(clientName) {
|
|
34
|
+
return !!SUPPORTED_CLIENTS[clientName];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=ClientInstallerFactory.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
+
import { ServerInstallOptions, OperationStatus, McpConfig } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Cline client installer implementation
|
|
5
|
+
* Handles installation of Cline client including extension installation and settings configuration
|
|
6
|
+
*/
|
|
7
|
+
export declare class ClineInstaller extends BaseClientInstaller {
|
|
8
|
+
/**
|
|
9
|
+
* Install Cline client
|
|
10
|
+
* @param options Installation options including environment variables and arguments
|
|
11
|
+
*/
|
|
12
|
+
install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
|
|
13
|
+
/**
|
|
14
|
+
* Set up Cline client settings
|
|
15
|
+
* Updates VS Code settings with MCP server configuration
|
|
16
|
+
*/
|
|
17
|
+
setupClientSettings(settingPath: string, serverName: string, installConfig: any): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
+
import { Logger } from '../../../utils/logger.js';
|
|
3
|
+
import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
|
|
4
|
+
import { ExtensionInstaller } from './ExtensionInstaller.js';
|
|
5
|
+
import { SUPPORTED_CLIENTS } from '../../constants.js';
|
|
6
|
+
import { isCommandAvailable } from '../../../utils/osUtils.js';
|
|
7
|
+
/**
|
|
8
|
+
* Cline client installer implementation
|
|
9
|
+
* Handles installation of Cline client including extension installation and settings configuration
|
|
10
|
+
*/
|
|
11
|
+
export class ClineInstaller extends BaseClientInstaller {
|
|
12
|
+
/**
|
|
13
|
+
* Install Cline client
|
|
14
|
+
* @param options Installation options including environment variables and arguments
|
|
15
|
+
*/
|
|
16
|
+
async install(serverConfig, options) {
|
|
17
|
+
const operationId = this.generateOperationId();
|
|
18
|
+
try {
|
|
19
|
+
// Check if VS Code or VS Code Insiders is installed
|
|
20
|
+
const isVSCodeInstalled = await isCommandAvailable('code');
|
|
21
|
+
const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
|
|
22
|
+
if (!isVSCodeInstalled && !isVSCodeInsidersInstalled) {
|
|
23
|
+
return {
|
|
24
|
+
status: 'failed',
|
|
25
|
+
type: 'install',
|
|
26
|
+
target: 'server',
|
|
27
|
+
message: 'Neither VS Code nor VS Code Insiders are installed on this system',
|
|
28
|
+
operationId
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Install extension
|
|
32
|
+
const extensionResult = await ExtensionInstaller.installExtension('Cline');
|
|
33
|
+
if (!extensionResult) {
|
|
34
|
+
Logger.debug('Failed to install Cline extension');
|
|
35
|
+
return {
|
|
36
|
+
status: 'failed',
|
|
37
|
+
type: 'install',
|
|
38
|
+
target: 'server',
|
|
39
|
+
message: 'Failed to install Cline extension',
|
|
40
|
+
operationId
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const installConfig = await this.setupInstallConfig(serverConfig, options);
|
|
44
|
+
// Track success for both VS Code variants
|
|
45
|
+
const results = [];
|
|
46
|
+
// Update settings for VS Code if installed
|
|
47
|
+
if (isVSCodeInstalled) {
|
|
48
|
+
try {
|
|
49
|
+
const settingPath = SUPPORTED_CLIENTS['Cline'].codeSettingPath;
|
|
50
|
+
await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
|
|
51
|
+
results.push({ success: true, path: settingPath });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
results.push({
|
|
55
|
+
success: false,
|
|
56
|
+
path: SUPPORTED_CLIENTS['Cline'].codeSettingPath,
|
|
57
|
+
error: error instanceof Error ? error.message : String(error)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Update settings for VS Code Insiders if installed
|
|
62
|
+
if (isVSCodeInsidersInstalled) {
|
|
63
|
+
try {
|
|
64
|
+
const settingPath = SUPPORTED_CLIENTS['Cline'].codeInsiderSettingPath;
|
|
65
|
+
await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
|
|
66
|
+
results.push({ success: true, path: settingPath });
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
results.push({
|
|
70
|
+
success: false,
|
|
71
|
+
path: SUPPORTED_CLIENTS['Cline'].codeInsiderSettingPath,
|
|
72
|
+
error: error instanceof Error ? error.message : String(error)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Determine overall success
|
|
77
|
+
const anySuccess = results.some(r => r.success);
|
|
78
|
+
const successPaths = results.filter(r => r.success).map(r => r.path);
|
|
79
|
+
const errors = results.filter(r => !r.success).map(r => r.error);
|
|
80
|
+
return {
|
|
81
|
+
status: anySuccess ? 'completed' : 'failed',
|
|
82
|
+
type: 'install',
|
|
83
|
+
target: 'server',
|
|
84
|
+
message: anySuccess
|
|
85
|
+
? `Successfully installed Cline client. Updated settings in: ${successPaths.join(', ')}`
|
|
86
|
+
: `Failed to install Cline client. Errors: ${errors.join('; ')}`,
|
|
87
|
+
operationId,
|
|
88
|
+
error: anySuccess ? undefined : errors.join('; ')
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return {
|
|
93
|
+
status: 'failed',
|
|
94
|
+
type: 'install',
|
|
95
|
+
target: 'server',
|
|
96
|
+
message: `Unexpected error installing Cline client: ${error instanceof Error ? error.message : String(error)}`,
|
|
97
|
+
operationId,
|
|
98
|
+
error: error instanceof Error ? error.message : String(error)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Set up Cline client settings
|
|
104
|
+
* Updates VS Code settings with MCP server configuration
|
|
105
|
+
*/
|
|
106
|
+
async setupClientSettings(settingPath, serverName, installConfig) {
|
|
107
|
+
// Read existing settings
|
|
108
|
+
const settings = await readJsonFile(settingPath, true);
|
|
109
|
+
// Initialize settings with client-specific structure
|
|
110
|
+
this.initializeSettings(settings);
|
|
111
|
+
// Handle different modes
|
|
112
|
+
if (installConfig.mode === 'stdio') {
|
|
113
|
+
// Process config for Windows NPX if needed
|
|
114
|
+
const finalConfig = await this.handleWindowsNpx(installConfig);
|
|
115
|
+
await this.handleStdioMode(settings, serverName, finalConfig);
|
|
116
|
+
}
|
|
117
|
+
else if (installConfig.mode === 'sse') {
|
|
118
|
+
this.handleSseMode(settings, serverName, installConfig);
|
|
119
|
+
}
|
|
120
|
+
// Write updated settings
|
|
121
|
+
await writeJsonFile(settingPath, settings);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=ClineInstaller.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
+
import { ServerInstallOptions, OperationStatus, McpConfig } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Github Copilot client installer implementation
|
|
5
|
+
* Handles installation of Github Copilot client including extension installation and settings configuration
|
|
6
|
+
*/
|
|
7
|
+
export declare class GithubCopilotInstaller extends BaseClientInstaller {
|
|
8
|
+
/**
|
|
9
|
+
* Install Github Copilot client
|
|
10
|
+
* @param options Installation options including environment variables and arguments
|
|
11
|
+
*/
|
|
12
|
+
install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
|
|
13
|
+
/**
|
|
14
|
+
* Initialize settings with GithubCopilot-specific structure
|
|
15
|
+
* Overrides base method to provide custom initialization
|
|
16
|
+
*/
|
|
17
|
+
protected initializeSettings(settings: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* Handle stdio mode configuration for GithubCopilot
|
|
20
|
+
* Overrides base method to provide custom stdio configuration
|
|
21
|
+
*/
|
|
22
|
+
protected handleStdioMode(settings: any, serverName: string, finalConfig: any): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Handle SSE mode configuration for GithubCopilot
|
|
25
|
+
* Overrides base method to provide custom SSE configuration
|
|
26
|
+
*/
|
|
27
|
+
protected handleSseMode(settings: any, serverName: string, installConfig: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* Set up Github Copilot client settings
|
|
30
|
+
* Updates VS Code settings with MCP server configuration
|
|
31
|
+
* Note: GithubCopilot uses a different settings structure compared to other clients
|
|
32
|
+
*/
|
|
33
|
+
setupClientSettings(settingPath: string, serverName: string, installConfig: any): Promise<void>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
+
import { Logger } from '../../../utils/logger.js';
|
|
3
|
+
import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
|
|
4
|
+
import { ExtensionInstaller } from './ExtensionInstaller.js';
|
|
5
|
+
import { SUPPORTED_CLIENTS } from '../../constants.js';
|
|
6
|
+
import { isCommandAvailable } from '../../../utils/osUtils.js';
|
|
7
|
+
/**
|
|
8
|
+
* Github Copilot client installer implementation
|
|
9
|
+
* Handles installation of Github Copilot client including extension installation and settings configuration
|
|
10
|
+
*/
|
|
11
|
+
export class GithubCopilotInstaller extends BaseClientInstaller {
|
|
12
|
+
/**
|
|
13
|
+
* Install Github Copilot client
|
|
14
|
+
* @param options Installation options including environment variables and arguments
|
|
15
|
+
*/
|
|
16
|
+
async install(serverConfig, options) {
|
|
17
|
+
const operationId = this.generateOperationId();
|
|
18
|
+
try {
|
|
19
|
+
// Check if VS Code or VS Code Insiders is installed
|
|
20
|
+
const isVSCodeInstalled = await isCommandAvailable('code');
|
|
21
|
+
const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
|
|
22
|
+
if (!isVSCodeInstalled && !isVSCodeInsidersInstalled) {
|
|
23
|
+
return {
|
|
24
|
+
status: 'failed',
|
|
25
|
+
type: 'install',
|
|
26
|
+
target: 'server',
|
|
27
|
+
message: 'Neither VS Code nor VS Code Insiders are installed on this system',
|
|
28
|
+
operationId
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Install extension
|
|
32
|
+
const extensionResult = await ExtensionInstaller.installExtension('GithubCopilot');
|
|
33
|
+
if (!extensionResult) {
|
|
34
|
+
Logger.debug('Failed to install Github Copilot extension');
|
|
35
|
+
return {
|
|
36
|
+
status: 'failed',
|
|
37
|
+
type: 'install',
|
|
38
|
+
target: 'server',
|
|
39
|
+
message: 'Failed to install Github Copilot extension',
|
|
40
|
+
operationId
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const installConfig = await this.setupInstallConfig(serverConfig, options);
|
|
44
|
+
// Track success for both VS Code variants
|
|
45
|
+
const results = [];
|
|
46
|
+
// Update settings for VS Code if installed
|
|
47
|
+
if (isVSCodeInstalled) {
|
|
48
|
+
try {
|
|
49
|
+
const settingPath = SUPPORTED_CLIENTS['GithubCopilot'].codeSettingPath;
|
|
50
|
+
await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
|
|
51
|
+
results.push({ success: true, path: settingPath });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
results.push({
|
|
55
|
+
success: false,
|
|
56
|
+
path: SUPPORTED_CLIENTS['GithubCopilot'].codeSettingPath,
|
|
57
|
+
error: error instanceof Error ? error.message : String(error)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Update settings for VS Code Insiders if installed
|
|
62
|
+
if (isVSCodeInsidersInstalled) {
|
|
63
|
+
try {
|
|
64
|
+
const settingPath = SUPPORTED_CLIENTS['GithubCopilot'].codeInsiderSettingPath;
|
|
65
|
+
await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
|
|
66
|
+
results.push({ success: true, path: settingPath });
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
results.push({
|
|
70
|
+
success: false,
|
|
71
|
+
path: SUPPORTED_CLIENTS['GithubCopilot'].codeInsiderSettingPath,
|
|
72
|
+
error: error instanceof Error ? error.message : String(error)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Determine overall success
|
|
77
|
+
const anySuccess = results.some(r => r.success);
|
|
78
|
+
const successPaths = results.filter(r => r.success).map(r => r.path);
|
|
79
|
+
const errors = results.filter(r => !r.success).map(r => r.error);
|
|
80
|
+
return {
|
|
81
|
+
status: anySuccess ? 'completed' : 'failed',
|
|
82
|
+
type: 'install',
|
|
83
|
+
target: 'server',
|
|
84
|
+
message: anySuccess
|
|
85
|
+
? `Successfully installed Github Copilot client. Updated settings in: ${successPaths.join(', ')}`
|
|
86
|
+
: `Failed to install Github Copilot client. Errors: ${errors.join('; ')}`,
|
|
87
|
+
operationId,
|
|
88
|
+
error: anySuccess ? undefined : errors.join('; ')
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return {
|
|
93
|
+
status: 'failed',
|
|
94
|
+
type: 'install',
|
|
95
|
+
target: 'server',
|
|
96
|
+
message: `Unexpected error installing Github Copilot client: ${error instanceof Error ? error.message : String(error)}`,
|
|
97
|
+
operationId,
|
|
98
|
+
error: error instanceof Error ? error.message : String(error)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Initialize settings with GithubCopilot-specific structure
|
|
104
|
+
* Overrides base method to provide custom initialization
|
|
105
|
+
*/
|
|
106
|
+
initializeSettings(settings) {
|
|
107
|
+
if (!settings.mcp) {
|
|
108
|
+
settings.mcp = {
|
|
109
|
+
servers: {},
|
|
110
|
+
inputs: []
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (!settings.mcp.servers) {
|
|
114
|
+
settings.mcp.servers = {};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Handle stdio mode configuration for GithubCopilot
|
|
119
|
+
* Overrides base method to provide custom stdio configuration
|
|
120
|
+
*/
|
|
121
|
+
async handleStdioMode(settings, serverName, finalConfig) {
|
|
122
|
+
if (finalConfig.args) {
|
|
123
|
+
finalConfig.args = finalConfig.args.map((arg) => typeof arg === 'string' ? arg.replace(/\\/g, '/') : arg);
|
|
124
|
+
}
|
|
125
|
+
settings.mcp.servers[serverName] = {
|
|
126
|
+
command: finalConfig.command,
|
|
127
|
+
args: finalConfig.args,
|
|
128
|
+
env: finalConfig.env
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Handle SSE mode configuration for GithubCopilot
|
|
133
|
+
* Overrides base method to provide custom SSE configuration
|
|
134
|
+
*/
|
|
135
|
+
handleSseMode(settings, serverName, installConfig) {
|
|
136
|
+
settings.mcp.servers[serverName] = {
|
|
137
|
+
type: 'sse',
|
|
138
|
+
url: installConfig.url
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Set up Github Copilot client settings
|
|
143
|
+
* Updates VS Code settings with MCP server configuration
|
|
144
|
+
* Note: GithubCopilot uses a different settings structure compared to other clients
|
|
145
|
+
*/
|
|
146
|
+
async setupClientSettings(settingPath, serverName, installConfig) {
|
|
147
|
+
// Read existing settings
|
|
148
|
+
const settings = await readJsonFile(settingPath, true);
|
|
149
|
+
// Initialize settings with client-specific structure
|
|
150
|
+
this.initializeSettings(settings);
|
|
151
|
+
// Handle different modes
|
|
152
|
+
if (installConfig.mode === 'stdio') {
|
|
153
|
+
await this.handleStdioMode(settings, serverName, installConfig);
|
|
154
|
+
}
|
|
155
|
+
else if (installConfig.mode === 'sse') {
|
|
156
|
+
this.handleSseMode(settings, serverName, installConfig);
|
|
157
|
+
}
|
|
158
|
+
// Write updated settings
|
|
159
|
+
await writeJsonFile(settingPath, settings);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=GithubCopilotInstaller.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
+
import { ServerInstallOptions, OperationStatus, McpConfig } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* MSRooCode client installer implementation
|
|
5
|
+
*/
|
|
6
|
+
export declare class MSRooCodeInstaller extends BaseClientInstaller {
|
|
7
|
+
/**
|
|
8
|
+
* Install MSRooCode client
|
|
9
|
+
*/
|
|
10
|
+
install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
|
|
11
|
+
/**
|
|
12
|
+
* Set up MSRooCode client settings
|
|
13
|
+
*/
|
|
14
|
+
setupClientSettings(settingPath: string, serverName: string, installConfig: any): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
+
import { Logger } from '../../../utils/logger.js';
|
|
3
|
+
import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
|
|
4
|
+
import { ExtensionInstaller } from './ExtensionInstaller.js';
|
|
5
|
+
import { SUPPORTED_CLIENTS } from '../../constants.js';
|
|
6
|
+
import { isCommandAvailable } from '../../../utils/osUtils.js';
|
|
7
|
+
/**
|
|
8
|
+
* MSRooCode client installer implementation
|
|
9
|
+
*/
|
|
10
|
+
export class MSRooCodeInstaller extends BaseClientInstaller {
|
|
11
|
+
/**
|
|
12
|
+
* Install MSRooCode client
|
|
13
|
+
*/
|
|
14
|
+
async install(serverConfig, options) {
|
|
15
|
+
const operationId = this.generateOperationId();
|
|
16
|
+
try {
|
|
17
|
+
// Check if VS Code or VS Code Insiders is installed
|
|
18
|
+
const isVSCodeInstalled = await isCommandAvailable('code');
|
|
19
|
+
const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
|
|
20
|
+
if (!isVSCodeInstalled && !isVSCodeInsidersInstalled) {
|
|
21
|
+
return {
|
|
22
|
+
status: 'failed',
|
|
23
|
+
type: 'install',
|
|
24
|
+
target: 'server',
|
|
25
|
+
message: 'Neither VS Code nor VS Code Insiders are installed on this system',
|
|
26
|
+
operationId
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// Install extension
|
|
30
|
+
const extensionResult = await ExtensionInstaller.installExtension('MSRooCode');
|
|
31
|
+
if (!extensionResult) {
|
|
32
|
+
Logger.debug('Failed to install MSRooCode extension');
|
|
33
|
+
return {
|
|
34
|
+
status: 'failed',
|
|
35
|
+
type: 'install',
|
|
36
|
+
target: 'server',
|
|
37
|
+
message: 'Failed to install MSRooCode extension',
|
|
38
|
+
operationId
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const installConfig = await this.setupInstallConfig(serverConfig, options);
|
|
42
|
+
installConfig.mode = serverConfig.mode;
|
|
43
|
+
// Track success for both VS Code variants
|
|
44
|
+
const results = [];
|
|
45
|
+
// Update settings for VS Code if installed
|
|
46
|
+
if (isVSCodeInstalled) {
|
|
47
|
+
try {
|
|
48
|
+
const settingPath = SUPPORTED_CLIENTS['MSRooCode'].codeSettingPath;
|
|
49
|
+
await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
|
|
50
|
+
results.push({ success: true, path: settingPath });
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
results.push({
|
|
54
|
+
success: false,
|
|
55
|
+
path: SUPPORTED_CLIENTS['MSRooCode'].codeSettingPath,
|
|
56
|
+
error: error instanceof Error ? error.message : String(error)
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Update settings for VS Code Insiders if installed
|
|
61
|
+
if (isVSCodeInsidersInstalled) {
|
|
62
|
+
try {
|
|
63
|
+
const settingPath = SUPPORTED_CLIENTS['MSRooCode'].codeInsiderSettingPath;
|
|
64
|
+
await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
|
|
65
|
+
results.push({ success: true, path: settingPath });
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
results.push({
|
|
69
|
+
success: false,
|
|
70
|
+
path: SUPPORTED_CLIENTS['MSRooCode'].codeInsiderSettingPath,
|
|
71
|
+
error: error instanceof Error ? error.message : String(error)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Determine overall success
|
|
76
|
+
const anySuccess = results.some(r => r.success);
|
|
77
|
+
const successPaths = results.filter(r => r.success).map(r => r.path);
|
|
78
|
+
const errors = results.filter(r => !r.success).map(r => r.error);
|
|
79
|
+
return {
|
|
80
|
+
status: anySuccess ? 'completed' : 'failed',
|
|
81
|
+
type: 'install',
|
|
82
|
+
target: 'server',
|
|
83
|
+
message: anySuccess
|
|
84
|
+
? `Successfully installed MSRooCode client. Updated settings in: ${successPaths.join(', ')}`
|
|
85
|
+
: `Failed to install MSRooCode client. Errors: ${errors.join('; ')}`,
|
|
86
|
+
operationId,
|
|
87
|
+
error: anySuccess ? undefined : errors.join('; ')
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
return {
|
|
92
|
+
status: 'failed',
|
|
93
|
+
type: 'install',
|
|
94
|
+
target: 'server',
|
|
95
|
+
message: `Unexpected error installing MSRooCode client: ${error instanceof Error ? error.message : String(error)}`,
|
|
96
|
+
operationId,
|
|
97
|
+
error: error instanceof Error ? error.message : String(error)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Set up MSRooCode client settings
|
|
103
|
+
*/
|
|
104
|
+
async setupClientSettings(settingPath, serverName, installConfig) {
|
|
105
|
+
// Read existing settings
|
|
106
|
+
const settings = await readJsonFile(settingPath, true);
|
|
107
|
+
// Initialize settings with client-specific structure
|
|
108
|
+
this.initializeSettings(settings);
|
|
109
|
+
// Handle different modes
|
|
110
|
+
if (installConfig.mode === 'stdio') {
|
|
111
|
+
// Process config for Windows NPX if needed
|
|
112
|
+
const finalConfig = await this.handleWindowsNpx(installConfig);
|
|
113
|
+
await this.handleStdioMode(settings, serverName, finalConfig);
|
|
114
|
+
}
|
|
115
|
+
else if (installConfig.mode === 'sse') {
|
|
116
|
+
this.handleSseMode(settings, serverName, installConfig);
|
|
117
|
+
}
|
|
118
|
+
// Write updated settings
|
|
119
|
+
await writeJsonFile(settingPath, settings);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=MSRooCodeInstaller.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequirementConfig, RequirementStatus,
|
|
1
|
+
import { RequirementConfig, RequirementStatus, ServerInstallOptions } from '../../types.js';
|
|
2
2
|
import { RequirementInstaller } from './RequirementInstaller.js';
|
|
3
3
|
/**
|
|
4
4
|
* Abstract base class with common functionality for all requirement installers
|
|
@@ -17,43 +17,20 @@ export declare abstract class BaseInstaller implements RequirementInstaller {
|
|
|
17
17
|
abstract supportCheckUpdates(): boolean;
|
|
18
18
|
abstract install(requirement: RequirementConfig, options?: ServerInstallOptions): Promise<RequirementStatus>;
|
|
19
19
|
abstract checkInstallation(requirement: RequirementConfig, options?: ServerInstallOptions): Promise<RequirementStatus>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the latest version available for the requirement.
|
|
22
|
+
* This method needs to be implemented by concrete installers.
|
|
23
|
+
* @param requirement The requirement to check.
|
|
24
|
+
* @param options Optional server install options.
|
|
25
|
+
* @returns The latest version string, or undefined if not found or not applicable.
|
|
26
|
+
*/
|
|
27
|
+
abstract getLatestVersion(requirement: RequirementConfig, options?: ServerInstallOptions): Promise<string | undefined>;
|
|
20
28
|
/**
|
|
21
29
|
* Check if updates are available for the requirement
|
|
22
30
|
* @param requirement The requirement to check
|
|
23
31
|
* @param currentStatus The current status of the requirement
|
|
32
|
+
* @param options Optional server install options.
|
|
24
33
|
* @returns The status of the requirement with update information
|
|
25
34
|
*/
|
|
26
|
-
checkForUpdates(requirement: RequirementConfig, currentStatus: RequirementStatus): Promise<RequirementStatus>;
|
|
27
|
-
/**
|
|
28
|
-
* Helper to handle artifact registry downloads
|
|
29
|
-
* @param requirement The requirement configuration
|
|
30
|
-
* @param registry The artifacts registry configuration
|
|
31
|
-
* @returns The registry URL
|
|
32
|
-
*/
|
|
33
|
-
protected handleArtifactsRegistry(requirement: RequirementConfig, registry: RegistryConfig['artifacts']): Promise<string>;
|
|
34
|
-
/**
|
|
35
|
-
* Helper to handle local path registry
|
|
36
|
-
* @param requirement The requirement configuration
|
|
37
|
-
* @param registry The local registry configuration
|
|
38
|
-
* @returns The local path or extracted asset path
|
|
39
|
-
*/
|
|
40
|
-
protected handleLocalRegistry(requirement: RequirementConfig, registry: RegistryConfig['local']): Promise<string>;
|
|
41
|
-
/**
|
|
42
|
-
* Get the latest version available for a GitHub repository
|
|
43
|
-
* @param repository The GitHub repository in format 'owner/repo'
|
|
44
|
-
* @returns The latest version or tag
|
|
45
|
-
*/
|
|
46
|
-
protected getGitHubLatestVersion(repository: string): Promise<string>;
|
|
47
|
-
/**
|
|
48
|
-
* Get the latest version available for an NPM package
|
|
49
|
-
* @param packageName The name of the NPM package
|
|
50
|
-
* @returns The latest version
|
|
51
|
-
*/
|
|
52
|
-
protected getNpmLatestVersion(packageName: string): Promise<string>;
|
|
53
|
-
/**
|
|
54
|
-
* Get the latest version available for a pip package
|
|
55
|
-
* @param packageName The name of the pip package
|
|
56
|
-
* @returns The latest version
|
|
57
|
-
*/
|
|
58
|
-
protected getPipLatestVersion(packageName: string, options?: ServerInstallOptions): Promise<string>;
|
|
35
|
+
checkForUpdates(requirement: RequirementConfig, currentStatus: RequirementStatus, options?: ServerInstallOptions): Promise<RequirementStatus>;
|
|
59
36
|
}
|