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,253 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import fs from 'fs/promises';
|
|
3
|
-
import { SETTINGS_DIR } from '../constants.js';
|
|
4
|
-
import { extractZipFile } from '../../utils/clientUtils.js';
|
|
5
|
-
import { Logger } from '../../utils/logger.js';
|
|
6
|
-
/**
|
|
7
|
-
* Abstract base class with common functionality for all requirement installers
|
|
8
|
-
*/
|
|
9
|
-
export class BaseInstaller {
|
|
10
|
-
execPromise;
|
|
11
|
-
downloadsDir;
|
|
12
|
-
constructor(execPromise) {
|
|
13
|
-
this.execPromise = execPromise;
|
|
14
|
-
this.downloadsDir = path.join(SETTINGS_DIR, 'downloads');
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Check if updates are available for the requirement
|
|
18
|
-
* @param requirement The requirement to check
|
|
19
|
-
* @param currentStatus The current status of the requirement
|
|
20
|
-
* @returns The status of the requirement with update information
|
|
21
|
-
*/
|
|
22
|
-
async checkForUpdates(requirement, currentStatus) {
|
|
23
|
-
try {
|
|
24
|
-
// If requirement is not installed, no need to check for updates
|
|
25
|
-
if (!currentStatus.installed) {
|
|
26
|
-
return currentStatus;
|
|
27
|
-
}
|
|
28
|
-
// If the version doesn't contain "latest", no update check needed
|
|
29
|
-
if (!requirement.version.includes('latest')) {
|
|
30
|
-
return currentStatus;
|
|
31
|
-
}
|
|
32
|
-
let latestVersion;
|
|
33
|
-
// Check based on registry type
|
|
34
|
-
if (requirement.registry?.githubRelease) {
|
|
35
|
-
latestVersion = await this.getGitHubLatestVersion(requirement.registry.githubRelease.repository);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
// Use common practice based on requirement type
|
|
39
|
-
switch (requirement.type) {
|
|
40
|
-
case 'npm':
|
|
41
|
-
latestVersion = await this.getNpmLatestVersion(requirement.name);
|
|
42
|
-
break;
|
|
43
|
-
case 'pip':
|
|
44
|
-
latestVersion = await this.getPipLatestVersion(requirement.name);
|
|
45
|
-
break;
|
|
46
|
-
// Add other types as needed
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// If we found a latest version and it's different from current
|
|
50
|
-
if (latestVersion && latestVersion !== currentStatus.version) {
|
|
51
|
-
return {
|
|
52
|
-
...currentStatus,
|
|
53
|
-
availableUpdate: {
|
|
54
|
-
version: latestVersion,
|
|
55
|
-
message: `Update available: ${currentStatus.version} → ${latestVersion}`
|
|
56
|
-
},
|
|
57
|
-
lastCheckTime: new Date().toISOString()
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
return {
|
|
62
|
-
...currentStatus,
|
|
63
|
-
lastCheckTime: new Date().toISOString()
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
// Don't update status on error, just log it
|
|
69
|
-
console.warn(`Error checking for updates for ${requirement.name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
70
|
-
return currentStatus;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Helper method to ensure downloads directory exists
|
|
75
|
-
*/
|
|
76
|
-
async ensureDownloadsDir() {
|
|
77
|
-
await fs.mkdir(this.downloadsDir, { recursive: true });
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Helper to handle GitHub release downloads
|
|
81
|
-
* @param requirement The requirement configuration
|
|
82
|
-
* @param registry The GitHub release registry configuration
|
|
83
|
-
* @returns The path to the downloaded file
|
|
84
|
-
*/
|
|
85
|
-
async handleGitHubRelease(requirement, registry) {
|
|
86
|
-
if (!registry) {
|
|
87
|
-
throw new Error('GitHub release registry configuration is required');
|
|
88
|
-
}
|
|
89
|
-
await this.ensureDownloadsDir();
|
|
90
|
-
const { repository, assetsName, assetName } = registry;
|
|
91
|
-
if (!repository) {
|
|
92
|
-
throw new Error('GitHub repository is required for GitHub release downloads');
|
|
93
|
-
}
|
|
94
|
-
let version = requirement.version;
|
|
95
|
-
let resolvedAssetName = assetName || '';
|
|
96
|
-
let resolvedAssetsName = assetsName || '';
|
|
97
|
-
const { stdout } = await this.execPromise(`gh release view --repo ${repository} --json tagName --jq .tagName`);
|
|
98
|
-
const latestTag = stdout.trim();
|
|
99
|
-
let latestVersion = latestTag;
|
|
100
|
-
const tagWithVPrefix = latestVersion.startsWith('v');
|
|
101
|
-
if (tagWithVPrefix)
|
|
102
|
-
latestVersion = latestVersion.substring(1); // Remove 'v' prefix if present
|
|
103
|
-
version = version.includes("latest") ? latestVersion : version;
|
|
104
|
-
if (assetsName) {
|
|
105
|
-
resolvedAssetsName = assetsName.replace('${latest}', version).replace('${version}', version);
|
|
106
|
-
}
|
|
107
|
-
if (assetName) {
|
|
108
|
-
resolvedAssetName = assetName.replace('${latest}', version).replace('${version}', version);
|
|
109
|
-
}
|
|
110
|
-
Logger.debug(`Downloading ${requirement.name} from GitHub release ${repository} version ${version}`);
|
|
111
|
-
Logger.debug(`ResolvedAssetsName} ${resolvedAssetName}; ResolvedAsetName} ${resolvedAssetName}`);
|
|
112
|
-
const pattern = resolvedAssetsName ? resolvedAssetsName : resolvedAssetName;
|
|
113
|
-
Logger.debug(`Resolved pattern: ${pattern}`);
|
|
114
|
-
if (!pattern) {
|
|
115
|
-
throw new Error('Either assetsName or assetName must be specified for GitHub release downloads');
|
|
116
|
-
}
|
|
117
|
-
// Download the release asset
|
|
118
|
-
const downloadPath = path.join(this.downloadsDir, path.basename(pattern));
|
|
119
|
-
if (!await this.fileExists(downloadPath)) {
|
|
120
|
-
await this.execPromise(`gh release download ${tagWithVPrefix ? `v${version}` : version} --repo ${repository} --pattern "${pattern}" -O "${downloadPath}"`);
|
|
121
|
-
}
|
|
122
|
-
// Handle zip file extraction if the downloaded file is a zip
|
|
123
|
-
if (downloadPath.endsWith('.zip')) {
|
|
124
|
-
const extractDir = path.join(this.downloadsDir, path.basename(pattern, '.zip'));
|
|
125
|
-
await fs.mkdir(extractDir, { recursive: true });
|
|
126
|
-
// Extract the zip file
|
|
127
|
-
await extractZipFile(downloadPath, { dir: extractDir });
|
|
128
|
-
let assetPath = '';
|
|
129
|
-
// If resolvedAssetName is specified, look for it in the extracted directory
|
|
130
|
-
if (resolvedAssetName) {
|
|
131
|
-
assetPath = path.join(extractDir, resolvedAssetName);
|
|
132
|
-
try {
|
|
133
|
-
await fs.access(assetPath);
|
|
134
|
-
return { resolvedVersion: version, resolvedPath: assetPath };
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
throw new Error(`Asset ${resolvedAssetName} not found in extracted directory ${extractDir}`);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
assetPath = path.join(extractDir, path.basename(pattern, '.zip') + '.tgz');
|
|
142
|
-
}
|
|
143
|
-
// If no specific asset is required, return the extraction directory
|
|
144
|
-
return { resolvedVersion: version, resolvedPath: extractDir };
|
|
145
|
-
}
|
|
146
|
-
return { resolvedVersion: version, resolvedPath: downloadPath };
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Helper to handle artifact registry downloads
|
|
150
|
-
* @param requirement The requirement configuration
|
|
151
|
-
* @param registry The artifacts registry configuration
|
|
152
|
-
* @returns The registry URL
|
|
153
|
-
*/
|
|
154
|
-
async handleArtifactsRegistry(requirement, registry) {
|
|
155
|
-
if (!registry) {
|
|
156
|
-
throw new Error('Artifacts registry configuration is required');
|
|
157
|
-
}
|
|
158
|
-
const { registryUrl, assetName } = registry;
|
|
159
|
-
if (!registryUrl) {
|
|
160
|
-
throw new Error('Registry URL is required for artifacts downloads');
|
|
161
|
-
}
|
|
162
|
-
return registryUrl;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Helper to handle local path registry
|
|
166
|
-
* @param requirement The requirement configuration
|
|
167
|
-
* @param registry The local registry configuration
|
|
168
|
-
* @returns The local path or extracted asset path
|
|
169
|
-
*/
|
|
170
|
-
async handleLocalRegistry(requirement, registry) {
|
|
171
|
-
if (!registry) {
|
|
172
|
-
throw new Error('Local registry configuration is required');
|
|
173
|
-
}
|
|
174
|
-
const { localPath, assetName } = registry;
|
|
175
|
-
if (!localPath) {
|
|
176
|
-
throw new Error('Local path is required for local registry');
|
|
177
|
-
}
|
|
178
|
-
// Verify the local path exists
|
|
179
|
-
try {
|
|
180
|
-
await fs.access(localPath);
|
|
181
|
-
}
|
|
182
|
-
catch (error) {
|
|
183
|
-
throw new Error(`Local path ${localPath} does not exist or is not accessible`);
|
|
184
|
-
}
|
|
185
|
-
// If the path is a zip file and assetName is specified, extract it
|
|
186
|
-
if (localPath.endsWith('.zip') && assetName) {
|
|
187
|
-
const extractDir = path.join(this.downloadsDir, path.basename(localPath, '.zip'));
|
|
188
|
-
await fs.mkdir(extractDir, { recursive: true });
|
|
189
|
-
// Extract the zip file
|
|
190
|
-
await extractZipFile(localPath, { dir: extractDir });
|
|
191
|
-
// Find the asset in the extracted directory
|
|
192
|
-
const assetPath = path.join(extractDir, assetName);
|
|
193
|
-
try {
|
|
194
|
-
await fs.access(assetPath);
|
|
195
|
-
return assetPath;
|
|
196
|
-
}
|
|
197
|
-
catch (error) {
|
|
198
|
-
throw new Error(`Asset ${assetName} not found in extracted directory ${extractDir}`);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return localPath;
|
|
202
|
-
}
|
|
203
|
-
async fileExists(filePath) {
|
|
204
|
-
try {
|
|
205
|
-
await fs.access(filePath);
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
catch {
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Get the latest version available for a GitHub repository
|
|
214
|
-
* @param repository The GitHub repository in format 'owner/repo'
|
|
215
|
-
* @returns The latest version or tag
|
|
216
|
-
*/
|
|
217
|
-
async getGitHubLatestVersion(repository) {
|
|
218
|
-
try {
|
|
219
|
-
// Use GitHub CLI to get the latest release
|
|
220
|
-
const { stdout } = await this.execPromise(`gh release view --repo ${repository} --json tagName --jq .tagName`);
|
|
221
|
-
const latestTag = stdout.trim();
|
|
222
|
-
// Remove 'v' prefix if present
|
|
223
|
-
return latestTag.startsWith('v') ? latestTag.substring(1) : latestTag;
|
|
224
|
-
}
|
|
225
|
-
catch (error) {
|
|
226
|
-
// If gh command fails, try to get the latest tag
|
|
227
|
-
const { stdout } = await this.execPromise(`git ls-remote --tags --refs https://github.com/${repository}.git | sort -t '/' -k 3 -V | tail -n 1 | awk -F/ '{print $3}'`);
|
|
228
|
-
let latestTag = stdout.trim();
|
|
229
|
-
// Remove 'v' prefix if present
|
|
230
|
-
return latestTag.startsWith('v') ? latestTag.substring(1) : latestTag;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Get the latest version available for an NPM package
|
|
235
|
-
* @param packageName The name of the NPM package
|
|
236
|
-
* @returns The latest version
|
|
237
|
-
*/
|
|
238
|
-
async getNpmLatestVersion(packageName) {
|
|
239
|
-
const { stdout } = await this.execPromise(`npm view ${packageName} version`);
|
|
240
|
-
return stdout.trim();
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Get the latest version available for a pip package
|
|
244
|
-
* @param packageName The name of the pip package
|
|
245
|
-
* @returns The latest version
|
|
246
|
-
*/
|
|
247
|
-
async getPipLatestVersion(packageName, options) {
|
|
248
|
-
const pythonCmd = options?.settings?.pythonEnv || 'python';
|
|
249
|
-
const { stdout } = await this.execPromise(`${pythonCmd} -m pip index versions ${packageName} --pre=0 | grep -oP "(?<=Latest:\\s)[^\\s]+" | head -1`);
|
|
250
|
-
return stdout.trim();
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
//# sourceMappingURL=BaseInstaller.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ServerOperationResult, ServerInstallOptions } from '../types.js';
|
|
2
|
-
export declare class ClientInstaller {
|
|
3
|
-
private categoryName;
|
|
4
|
-
private serverName;
|
|
5
|
-
private clients;
|
|
6
|
-
private configProvider;
|
|
7
|
-
private operationStatuses;
|
|
8
|
-
constructor(categoryName: string, serverName: string, clients: string[]);
|
|
9
|
-
private generateOperationId;
|
|
10
|
-
private getNpmPath;
|
|
11
|
-
/**
|
|
12
|
-
* Check if a command is available on the system
|
|
13
|
-
* @param command The command to check
|
|
14
|
-
* @returns True if the command is available, false otherwise
|
|
15
|
-
*/
|
|
16
|
-
private isCommandAvailable;
|
|
17
|
-
private installClient;
|
|
18
|
-
private processInstallation;
|
|
19
|
-
private installClientConfig;
|
|
20
|
-
private updateClineOrMSRooSettings;
|
|
21
|
-
private updateGithubCopilotSettings;
|
|
22
|
-
install(options: ServerInstallOptions): Promise<ServerOperationResult>;
|
|
23
|
-
}
|