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,165 +0,0 @@
|
|
|
1
|
-
import { exec } from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { SUPPORTED_CLIENTS } from '../../metadatas/constants.js';
|
|
4
|
-
import { Logger } from '../../../utils/logger.js';
|
|
5
|
-
import { handleGitHubRelease } from '../../../utils/githubUtils.js';
|
|
6
|
-
import { compareVersions } from '../../../utils/versionUtils.js';
|
|
7
|
-
|
|
8
|
-
const execAsync = promisify(exec);
|
|
9
|
-
|
|
10
|
-
interface ExtensionInfo {
|
|
11
|
-
name: string;
|
|
12
|
-
publisher: string;
|
|
13
|
-
version: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ExtensionInstaller {
|
|
17
|
-
/**
|
|
18
|
-
* Get VSCode path based on the OS type
|
|
19
|
-
*/
|
|
20
|
-
private static async getVSCodePath(isInsiders: boolean): Promise<string | null> {
|
|
21
|
-
const command = isInsiders ? 'code-insiders' : 'code';
|
|
22
|
-
try {
|
|
23
|
-
if (process.platform === 'win32') {
|
|
24
|
-
// Windows: Check command availability first
|
|
25
|
-
await execAsync(`where ${command}`);
|
|
26
|
-
return command;
|
|
27
|
-
} else if (process.platform === 'darwin') {
|
|
28
|
-
// macOS: Check in both system and user Applications
|
|
29
|
-
const appName = isInsiders ? 'Visual Studio Code - Insiders.app' : 'Visual Studio Code.app';
|
|
30
|
-
const systemPath = `/Applications/${appName}`;
|
|
31
|
-
const userPath = `${process.env.HOME}/Applications/${appName}`;
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
await execAsync(`test -d "${systemPath}"`);
|
|
35
|
-
return systemPath;
|
|
36
|
-
} catch {
|
|
37
|
-
try {
|
|
38
|
-
await execAsync(`test -d "${userPath}"`);
|
|
39
|
-
return userPath;
|
|
40
|
-
} catch {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return command;
|
|
46
|
-
} catch {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* List installed extensions for VSCode or VSCode Insiders
|
|
53
|
-
*/
|
|
54
|
-
private static async listExtensions(isInsiders: boolean): Promise<ExtensionInfo[]> {
|
|
55
|
-
const command = isInsiders ? 'code-insiders' : 'code';
|
|
56
|
-
try {
|
|
57
|
-
const { stdout } = await execAsync(`${command} --list-extensions --show-versions`);
|
|
58
|
-
return stdout.split('\n')
|
|
59
|
-
.filter(line => line.trim())
|
|
60
|
-
.map(line => {
|
|
61
|
-
const [extension, version] = line.split('@');
|
|
62
|
-
const [publisher, name] = extension.split('.');
|
|
63
|
-
return { name, publisher, version: version || '' };
|
|
64
|
-
});
|
|
65
|
-
} catch (error) {
|
|
66
|
-
Logger.error(`Failed to list extensions for ${command}:`, error);
|
|
67
|
-
return [];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Check if an extension is installed and get its version
|
|
73
|
-
*/
|
|
74
|
-
private static async checkExtension(extensionId: string, isInsiders: boolean): Promise<string | null> {
|
|
75
|
-
const extensions = await this.listExtensions(isInsiders);
|
|
76
|
-
const [publisher, name] = extensionId.split('.');
|
|
77
|
-
const extension = extensions.find(ext =>
|
|
78
|
-
ext.publisher.toLowerCase() === publisher.toLowerCase() &&
|
|
79
|
-
ext.name.toLowerCase() === name.toLowerCase()
|
|
80
|
-
);
|
|
81
|
-
return extension ? extension.version : null;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Install extension from marketplace
|
|
86
|
-
*/
|
|
87
|
-
private static async installPublicExtension(extensionId: string, isInsiders: boolean): Promise<boolean> {
|
|
88
|
-
const command = isInsiders ? 'code-insiders' : 'code';
|
|
89
|
-
try {
|
|
90
|
-
await execAsync(`${command} --install-extension ${extensionId}`);
|
|
91
|
-
return true;
|
|
92
|
-
} catch (error) {
|
|
93
|
-
Logger.error(`Failed to install extension ${extensionId}:`, error);
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Install extension from VSIX file
|
|
100
|
-
*/
|
|
101
|
-
private static async installPrivateExtension(vsixPath: string, isInsiders: boolean): Promise<boolean> {
|
|
102
|
-
const command = isInsiders ? 'code-insiders' : 'code';
|
|
103
|
-
try {
|
|
104
|
-
await execAsync(`${command} --install-extension "${vsixPath}"`);
|
|
105
|
-
return true;
|
|
106
|
-
} catch (error) {
|
|
107
|
-
Logger.error(`Failed to install extension from VSIX ${vsixPath}:`, error);
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Install extension for a specific client
|
|
114
|
-
*/
|
|
115
|
-
public static async installExtension(clientName: string): Promise<boolean> {
|
|
116
|
-
const client = SUPPORTED_CLIENTS[clientName];
|
|
117
|
-
if (!client?.extension?.extensionId) {
|
|
118
|
-
Logger.error(`No extension configuration found for client ${clientName}`);
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const { extensionId, leastVersion, repository, assetName, private: isPrivate } = client.extension;
|
|
123
|
-
let success = false;
|
|
124
|
-
|
|
125
|
-
// Check both VSCode and VSCode Insiders
|
|
126
|
-
for (const isInsiders of [false, true]) {
|
|
127
|
-
const vscodePath = await this.getVSCodePath(isInsiders);
|
|
128
|
-
if (!vscodePath) {
|
|
129
|
-
Logger.debug(`${isInsiders ? 'VSCode Insiders' : 'VSCode'} not found, skipping...`);
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const currentVersion = await this.checkExtension(extensionId, isInsiders);
|
|
134
|
-
|
|
135
|
-
if (!currentVersion || (isPrivate && leastVersion && compareVersions(currentVersion, leastVersion) < 0)) {
|
|
136
|
-
// Extension not installed or needs update (for private extensions)
|
|
137
|
-
if (!isPrivate) {
|
|
138
|
-
// Install public extension from marketplace
|
|
139
|
-
success = await this.installPublicExtension(extensionId, isInsiders);
|
|
140
|
-
} else {
|
|
141
|
-
// Install private extension from GitHub release using latest version
|
|
142
|
-
try {
|
|
143
|
-
if (!repository || !assetName) {
|
|
144
|
-
throw new Error(`Missing repository or assetName for private extension ${extensionId}`);
|
|
145
|
-
}
|
|
146
|
-
const { resolvedPath } = await handleGitHubRelease(
|
|
147
|
-
{ name: extensionId, version: 'latest', type: 'extension' },
|
|
148
|
-
{ repository, assetName }
|
|
149
|
-
);
|
|
150
|
-
success = await this.installPrivateExtension(resolvedPath, isInsiders);
|
|
151
|
-
} catch (error) {
|
|
152
|
-
Logger.error(`Failed to install/update private extension ${extensionId}:`, error);
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
} else {
|
|
157
|
-
// Extension already installed and up to date
|
|
158
|
-
Logger.debug(`Extension ${extensionId} is already installed and up to date`);
|
|
159
|
-
success = true;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return success;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
-
import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Github Copilot client installer implementation
|
|
6
|
-
* Handles installation of Github Copilot client including extension installation and settings configuration
|
|
7
|
-
*/
|
|
8
|
-
export class GithubCopilotInstaller extends BaseClientInstaller {
|
|
9
|
-
protected readonly clientName: string = 'GithubCopilot';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Initialize settings with GithubCopilot-specific structure
|
|
14
|
-
* Overrides base method to provide custom initialization
|
|
15
|
-
*/
|
|
16
|
-
protected initializeSettings(settings: any): void {
|
|
17
|
-
if (!settings.mcp) {
|
|
18
|
-
settings.mcp = {
|
|
19
|
-
servers: {},
|
|
20
|
-
inputs: []
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (!settings.mcp.servers) {
|
|
25
|
-
settings.mcp.servers = {};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Handle stdio mode configuration for GithubCopilot
|
|
31
|
-
* Overrides base method to provide custom stdio configuration
|
|
32
|
-
*/
|
|
33
|
-
protected async handleStdioMode(settings: any, serverName: string, finalConfig: any): Promise<void> {
|
|
34
|
-
if (finalConfig.args) {
|
|
35
|
-
finalConfig.args = finalConfig.args.map((arg: string) =>
|
|
36
|
-
typeof arg === 'string' ? arg.replace(/\\/g, '/') : arg
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
settings.mcp.servers[serverName] = {
|
|
40
|
-
command: finalConfig.command,
|
|
41
|
-
args: finalConfig.args,
|
|
42
|
-
env: finalConfig.env
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Handle SSE mode configuration for GithubCopilot
|
|
48
|
-
* Overrides base method to provide custom SSE configuration
|
|
49
|
-
*/
|
|
50
|
-
protected handleSseMode(settings: any, serverName: string, installConfig: any): void {
|
|
51
|
-
settings.mcp.servers[serverName] = {
|
|
52
|
-
type: 'sse',
|
|
53
|
-
url: installConfig.url
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Set up Github Copilot client settings
|
|
59
|
-
* Updates VS Code settings with MCP server configuration
|
|
60
|
-
* Note: GithubCopilot uses a different settings structure compared to other clients
|
|
61
|
-
*/
|
|
62
|
-
async setupClientSettings(settingPath: string, serverName: string, installConfig: any): Promise<void> {
|
|
63
|
-
// Read existing settings
|
|
64
|
-
const settings = await readJsonFile(settingPath, true);
|
|
65
|
-
|
|
66
|
-
// Initialize settings with client-specific structure
|
|
67
|
-
this.initializeSettings(settings);
|
|
68
|
-
|
|
69
|
-
// Handle different modes
|
|
70
|
-
if (installConfig.mode === 'stdio') {
|
|
71
|
-
await this.handleStdioMode(settings, serverName, installConfig);
|
|
72
|
-
} else if (installConfig.mode === 'sse') {
|
|
73
|
-
this.handleSseMode(settings, serverName, installConfig);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Write updated settings
|
|
77
|
-
await writeJsonFile(settingPath, settings);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseClientInstaller } from './BaseClientInstaller.js';
|
|
2
|
-
import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* MSRooCode client installer implementation
|
|
6
|
-
*/
|
|
7
|
-
export class MSRooCodeInstaller extends BaseClientInstaller {
|
|
8
|
-
protected readonly clientName: string = 'MSRooCode';
|
|
9
|
-
/**
|
|
10
|
-
* Set up MSRooCode client settings
|
|
11
|
-
*/
|
|
12
|
-
async setupClientSettings(settingPath: string, serverName: string, installConfig: any): Promise<void> {
|
|
13
|
-
// Read existing settings
|
|
14
|
-
const settings = await readJsonFile(settingPath, true);
|
|
15
|
-
|
|
16
|
-
// Initialize settings with client-specific structure
|
|
17
|
-
this.initializeSettings(settings);
|
|
18
|
-
|
|
19
|
-
// Handle different modes
|
|
20
|
-
if (installConfig.mode === 'stdio') {
|
|
21
|
-
// Process config for Windows NPX if needed
|
|
22
|
-
const finalConfig = await this.handleWindowsNpx(installConfig);
|
|
23
|
-
|
|
24
|
-
await this.handleStdioMode(settings, serverName, finalConfig);
|
|
25
|
-
} else if (installConfig.mode === 'sse') {
|
|
26
|
-
this.handleSseMode(settings, serverName, installConfig);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Write updated settings
|
|
30
|
-
await writeJsonFile(settingPath, settings);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Export the interface
|
|
2
|
-
export { RequirementInstaller } from './requirements/RequirementInstaller.js';
|
|
3
|
-
export { ClientInstaller } from './clients/ClientInstaller.js';
|
|
4
|
-
|
|
5
|
-
// Export all requirement installer implementations
|
|
6
|
-
export { BaseInstaller } from './requirements/BaseInstaller.js';
|
|
7
|
-
export { NpmInstaller } from './requirements/NpmInstaller.js';
|
|
8
|
-
export { PipInstaller } from './requirements/PipInstaller.js';
|
|
9
|
-
export { GeneralInstaller } from './requirements/GeneralInstaller.js';
|
|
10
|
-
export { CommandInstaller } from './requirements/CommandInstaller.js';
|
|
11
|
-
export { InstallerFactory, createInstallerFactory } from './requirements/InstallerFactory.js';
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { RequirementConfig, RequirementStatus, RegistryConfig, ServerInstallOptions } from '../../metadatas/types.js';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { SETTINGS_DIR } from '../../metadatas/constants.js';
|
|
4
|
-
import { RequirementInstaller } from './RequirementInstaller.js';
|
|
5
|
-
import { Logger } from '../../../utils/logger.js';
|
|
6
|
-
import { InstallOperationManager } from '../../loaders/InstallOperationManager.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Abstract base class with common functionality for all requirement installers
|
|
10
|
-
*/
|
|
11
|
-
export abstract class BaseInstaller implements RequirementInstaller {
|
|
12
|
-
protected execPromise: (command: string) => Promise<{ stdout: string; stderr: string }>;
|
|
13
|
-
protected downloadsDir: string;
|
|
14
|
-
|
|
15
|
-
constructor(execPromise: (command: string) => Promise<{ stdout: string; stderr: string }>) {
|
|
16
|
-
this.execPromise = execPromise;
|
|
17
|
-
this.downloadsDir = path.join(SETTINGS_DIR, 'downloads');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
abstract canHandle(requirement: RequirementConfig): boolean;
|
|
21
|
-
abstract supportCheckUpdates(): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Install the requirement
|
|
24
|
-
* @param requirement The requirement to install
|
|
25
|
-
* @param options Optional install options
|
|
26
|
-
* @param recorder Optional InstallOperationManager for recording steps
|
|
27
|
-
* @returns The status of the installation
|
|
28
|
-
*/
|
|
29
|
-
abstract install(requirement: RequirementConfig, recorder: InstallOperationManager, options?: ServerInstallOptions): Promise<RequirementStatus>;
|
|
30
|
-
abstract checkInstallation(requirement: RequirementConfig, options?: ServerInstallOptions): Promise<RequirementStatus>;
|
|
31
|
-
/**
|
|
32
|
-
* Get the latest version available for the requirement.
|
|
33
|
-
* This method needs to be implemented by concrete installers.
|
|
34
|
-
* @param requirement The requirement to check.
|
|
35
|
-
* @param options Optional server install options.
|
|
36
|
-
* @returns The latest version string, or undefined if not found or not applicable.
|
|
37
|
-
*/
|
|
38
|
-
abstract getLatestVersion(requirement: RequirementConfig, options?: ServerInstallOptions): Promise<string | undefined>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Check if updates are available for the requirement
|
|
43
|
-
* @param requirement The requirement to check
|
|
44
|
-
* @param currentStatus The current status of the requirement
|
|
45
|
-
* @param options Optional server install options.
|
|
46
|
-
* @returns The status of the requirement with update information
|
|
47
|
-
*/
|
|
48
|
-
async checkForUpdates(requirement: RequirementConfig, currentStatus: RequirementStatus, options?: ServerInstallOptions): Promise<RequirementStatus> {
|
|
49
|
-
try {
|
|
50
|
-
// If requirement is not installed, no need to check for updates
|
|
51
|
-
if (!currentStatus.installed) {
|
|
52
|
-
return currentStatus;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// If the version doesn't contain "latest", no update check needed
|
|
56
|
-
if (!requirement.version.includes('latest')) {
|
|
57
|
-
return currentStatus;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const latestVersion = await this.getLatestVersion(requirement, options);
|
|
61
|
-
|
|
62
|
-
// If we found a latest version and it's different from current
|
|
63
|
-
if (latestVersion && latestVersion !== currentStatus.version) {
|
|
64
|
-
return {
|
|
65
|
-
...currentStatus,
|
|
66
|
-
availableUpdate: {
|
|
67
|
-
version: latestVersion,
|
|
68
|
-
message: `Update available: ${currentStatus.version} → ${latestVersion}`
|
|
69
|
-
},
|
|
70
|
-
lastCheckTime: new Date().toISOString()
|
|
71
|
-
};
|
|
72
|
-
} else {
|
|
73
|
-
return {
|
|
74
|
-
...currentStatus,
|
|
75
|
-
lastCheckTime: new Date().toISOString()
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
} catch (error) {
|
|
80
|
-
// Don't update status on error, just log it
|
|
81
|
-
Logger.log(`Error checking for updates for ${requirement.name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
82
|
-
return currentStatus;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { RequirementConfig, RequirementStatus, OSType, ServerInstallOptions } from '../../metadatas/types.js';
|
|
2
|
-
import { BaseInstaller } from './BaseInstaller.js';
|
|
3
|
-
import { getOSType, refreshPathEnv } from '../../../utils/osUtils.js';
|
|
4
|
-
import { Logger } from '../../../utils/logger.js';
|
|
5
|
-
import { InstallOperationManager } from '../../loaders/InstallOperationManager.js';
|
|
6
|
-
import * as RecordingConstants from '../../metadatas/recordingConstants.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Mapping of command names to their package IDs on different platforms
|
|
10
|
-
*/
|
|
11
|
-
interface CommandMapping {
|
|
12
|
-
windows: string;
|
|
13
|
-
macos: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Installer implementation for command-line tools
|
|
18
|
-
*/
|
|
19
|
-
export class CommandInstaller extends BaseInstaller {
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Constructor for the CommandInstaller
|
|
23
|
-
* @param execPromise Function to execute commands
|
|
24
|
-
*/
|
|
25
|
-
getLatestVersion(requirement: RequirementConfig, options?: ServerInstallOptions): Promise<string | undefined> {
|
|
26
|
-
throw new Error('Method not implemented.');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Mapping of command names to their package IDs
|
|
31
|
-
* This handles special cases where the command name differs from the package ID
|
|
32
|
-
*/
|
|
33
|
-
private commandMappings: Record<string, CommandMapping> = {
|
|
34
|
-
'uv': { windows: 'astral-sh.uv', macos: 'uv' }
|
|
35
|
-
// Add more mappings as needed
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Check if this installer can handle the given requirement type
|
|
40
|
-
* @param requirement The requirement to check
|
|
41
|
-
* @returns True if this installer can handle the requirement
|
|
42
|
-
*/
|
|
43
|
-
canHandle(requirement: RequirementConfig): boolean {
|
|
44
|
-
return requirement.type === 'command';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
supportCheckUpdates(): boolean {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get the mapped package ID for a command
|
|
52
|
-
* @param commandName The command name to map
|
|
53
|
-
* @returns The mapped package ID
|
|
54
|
-
*/
|
|
55
|
-
private getMappedPackageId(commandName: string): string {
|
|
56
|
-
const osType = getOSType();
|
|
57
|
-
const mapping = this.commandMappings[commandName];
|
|
58
|
-
|
|
59
|
-
if (mapping) {
|
|
60
|
-
return osType === OSType.Windows ? mapping.windows : mapping.macos;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// If no mapping exists, use the command name itself
|
|
64
|
-
return commandName;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Check if the command is already installed
|
|
69
|
-
* @param requirement The requirement to check
|
|
70
|
-
* @returns The status of the requirement
|
|
71
|
-
*/
|
|
72
|
-
async checkInstallation(requirement: RequirementConfig): Promise<RequirementStatus> {
|
|
73
|
-
try {
|
|
74
|
-
await refreshPathEnv();
|
|
75
|
-
const commandName = requirement.alias || requirement.name;
|
|
76
|
-
const osType = getOSType();
|
|
77
|
-
let commandResult;
|
|
78
|
-
|
|
79
|
-
if (osType === OSType.Windows) {
|
|
80
|
-
// Check if command exists on Windows
|
|
81
|
-
try {
|
|
82
|
-
commandResult = await this.execPromise(`where ${commandName} 2>nul`);
|
|
83
|
-
} catch (error) {
|
|
84
|
-
Logger.debug(`Error checking command existence: ${error}`);
|
|
85
|
-
// On Windows, 'where' command returns non-zero exit code if the command is not found
|
|
86
|
-
// We'll handle this as "command not found" rather than an error
|
|
87
|
-
commandResult = { stdout: '', stderr: '' };
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
// Check if command exists on macOS/Linux
|
|
91
|
-
try {
|
|
92
|
-
commandResult = await this.execPromise(`which ${commandName} 2>/dev/null`);
|
|
93
|
-
} catch (error) {
|
|
94
|
-
Logger.debug(`Error checking command existence: ${error}`);
|
|
95
|
-
// Similarly handle command not found on Unix systems
|
|
96
|
-
commandResult = { stdout: '', stderr: '' };
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// If the command exists, it will return a path or multiple paths
|
|
101
|
-
const installed = commandResult.stdout.trim().length > 0;
|
|
102
|
-
|
|
103
|
-
// Try to get version information if available
|
|
104
|
-
let version: string | undefined;
|
|
105
|
-
if (installed) {
|
|
106
|
-
try {
|
|
107
|
-
const versionResult = await this.execPromise(`${commandName} --version`);
|
|
108
|
-
if (versionResult.stdout) {
|
|
109
|
-
// Extract version information - this is a simple approach that might need refinement
|
|
110
|
-
const versionMatch = versionResult.stdout.match(/\d+\.\d+(\.\d+)?/);
|
|
111
|
-
version = versionMatch ? versionMatch[0] : undefined;
|
|
112
|
-
}
|
|
113
|
-
} catch (error) {
|
|
114
|
-
Logger.debug(`Error checking command version: ${error}`);
|
|
115
|
-
// Ignore errors from version check, consider it installed anyway
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
name: requirement.name,
|
|
121
|
-
type: 'command',
|
|
122
|
-
installed,
|
|
123
|
-
version,
|
|
124
|
-
inProgress: false
|
|
125
|
-
};
|
|
126
|
-
} catch (error) {
|
|
127
|
-
Logger.error(`Error checking installation: ${error}`);
|
|
128
|
-
return {
|
|
129
|
-
name: requirement.name,
|
|
130
|
-
type: 'command',
|
|
131
|
-
installed: false,
|
|
132
|
-
error: error instanceof Error ? error.message : String(error),
|
|
133
|
-
inProgress: false
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Install the command
|
|
140
|
-
* @param requirement The requirement to install
|
|
141
|
-
* @returns The status of the installation
|
|
142
|
-
*/
|
|
143
|
-
/**
|
|
144
|
-
* Install the command
|
|
145
|
-
* @param requirement The requirement to install
|
|
146
|
-
* @param options Optional install options
|
|
147
|
-
* @param recorder Optional InstallOperationManager for recording steps
|
|
148
|
-
* @returns The status of the installation
|
|
149
|
-
*/
|
|
150
|
-
async install(requirement: RequirementConfig, recorder: InstallOperationManager, options?: ServerInstallOptions): Promise<RequirementStatus> {
|
|
151
|
-
const doInstall = async (): Promise<RequirementStatus> => {
|
|
152
|
-
const status = await this.checkInstallation(requirement);
|
|
153
|
-
if (status.installed) {
|
|
154
|
-
return status;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const packageId = this.getMappedPackageId(requirement.name);
|
|
158
|
-
const osType = getOSType();
|
|
159
|
-
let installCommand: string;
|
|
160
|
-
|
|
161
|
-
if (osType === OSType.Windows) {
|
|
162
|
-
installCommand = `winget install --id ${packageId}`;
|
|
163
|
-
if (requirement.version && requirement.version !== 'latest') {
|
|
164
|
-
installCommand += ` --version ${requirement.version}`;
|
|
165
|
-
}
|
|
166
|
-
} else if (osType === OSType.MacOS) {
|
|
167
|
-
installCommand = `brew install ${packageId}`;
|
|
168
|
-
if (requirement.version && requirement.version !== 'latest') {
|
|
169
|
-
installCommand += `@${requirement.version}`;
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
if (recorder) await recorder.recordStep('CommandInstaller:UnsupportedOS', 'failed', `Unsupported OS for ${requirement.name}`);
|
|
173
|
-
throw new Error(`Unsupported operating system for installing ${requirement.name}`);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Execute the installation command
|
|
177
|
-
const { stderr } = await this.execPromise(installCommand);
|
|
178
|
-
if (stderr && stderr.toLowerCase().includes('error')) {
|
|
179
|
-
throw new Error(stderr);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Check if installation was successful
|
|
183
|
-
const updatedStatus = await this.checkInstallation(requirement);
|
|
184
|
-
if (!updatedStatus.installed) {
|
|
185
|
-
throw new Error(`Failed to install ${requirement.name}`);
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
name: requirement.name,
|
|
189
|
-
type: 'command',
|
|
190
|
-
installed: true,
|
|
191
|
-
version: updatedStatus.version || requirement.version,
|
|
192
|
-
inProgress: false
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
if (recorder) {
|
|
197
|
-
return recorder.recording(doInstall, {
|
|
198
|
-
stepName: RecordingConstants.STEP_COMMAND_INSTALLER_INSTALL,
|
|
199
|
-
inProgressMessage: `Installing command: ${requirement.name}`,
|
|
200
|
-
endMessage: (result) =>
|
|
201
|
-
result.installed
|
|
202
|
-
? `Install completed for ${requirement.name}`
|
|
203
|
-
: `Install failed for ${requirement.name}`,
|
|
204
|
-
onError: (error) => {
|
|
205
|
-
return {
|
|
206
|
-
result: {
|
|
207
|
-
name: requirement.name,
|
|
208
|
-
type: 'command',
|
|
209
|
-
installed: false,
|
|
210
|
-
error: error instanceof Error ? error.message : String(error),
|
|
211
|
-
inProgress: false,
|
|
212
|
-
},
|
|
213
|
-
message: error instanceof Error ? error.message : String(error),
|
|
214
|
-
};
|
|
215
|
-
},
|
|
216
|
-
});
|
|
217
|
-
} else {
|
|
218
|
-
try {
|
|
219
|
-
return await doInstall();
|
|
220
|
-
} catch (error) {
|
|
221
|
-
return {
|
|
222
|
-
name: requirement.name,
|
|
223
|
-
type: 'command',
|
|
224
|
-
installed: false,
|
|
225
|
-
error: error instanceof Error ? error.message : String(error),
|
|
226
|
-
inProgress: false,
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|