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,278 +0,0 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { SETTINGS_DIR } from '../metadatas/constants.js';
|
|
4
|
-
import { SystemSettings } from '../metadatas/types.js';
|
|
5
|
-
import { Logger } from '../../utils/logger.js';
|
|
6
|
-
import { getSystemPythonExecutablePath, getNpmExecutablePath, getBrowserPath } from '../../utils/osUtils.js';
|
|
7
|
-
|
|
8
|
-
const SETTINGS_FILE_NAME = 'system_settings.json';
|
|
9
|
-
const SETTINGS_FILE_PATH = path.join(SETTINGS_DIR, 'settings', SETTINGS_FILE_NAME);
|
|
10
|
-
|
|
11
|
-
export class SystemSettingsManager {
|
|
12
|
-
private static instance: SystemSettingsManager;
|
|
13
|
-
private settings: SystemSettings;
|
|
14
|
-
private settingsFilePath: string;
|
|
15
|
-
private settingsLock: Promise<void> = Promise.resolve();
|
|
16
|
-
|
|
17
|
-
private constructor() {
|
|
18
|
-
this.settingsFilePath = SETTINGS_FILE_PATH;
|
|
19
|
-
this.settings = {};
|
|
20
|
-
// No await here, initialization is best-effort. Lock will protect subsequent calls.
|
|
21
|
-
this.loadSettings().catch(error => {
|
|
22
|
-
Logger.error('Failed to initialize SystemSettingsManager during construction:', error);
|
|
23
|
-
// Initialize with empty settings if load fails, defaults will be applied on first access
|
|
24
|
-
this.settings = {};
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
public static getInstance(): SystemSettingsManager {
|
|
29
|
-
if (!SystemSettingsManager.instance) {
|
|
30
|
-
SystemSettingsManager.instance = new SystemSettingsManager();
|
|
31
|
-
}
|
|
32
|
-
return SystemSettingsManager.instance;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
private async withLock<T>(operation: () => Promise<T>): Promise<T> {
|
|
36
|
-
const currentLock = this.settingsLock;
|
|
37
|
-
let releaseLock: () => void;
|
|
38
|
-
this.settingsLock = new Promise<void>(resolve => releaseLock = resolve);
|
|
39
|
-
try {
|
|
40
|
-
await currentLock;
|
|
41
|
-
return await operation();
|
|
42
|
-
} finally {
|
|
43
|
-
releaseLock!();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Internal method without lock
|
|
48
|
-
private async _loadSettingsInternal(): Promise<void> {
|
|
49
|
-
try {
|
|
50
|
-
await fs.mkdir(path.dirname(this.settingsFilePath), { recursive: true });
|
|
51
|
-
const data = await fs.readFile(this.settingsFilePath, 'utf-8');
|
|
52
|
-
this.settings = JSON.parse(data);
|
|
53
|
-
await this._applyDefaultsIfNeededInternal(); // Call internal version
|
|
54
|
-
} catch (error) {
|
|
55
|
-
if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
|
|
56
|
-
Logger.info(`Settings file not found at ${this.settingsFilePath}. Initializing with defaults.`);
|
|
57
|
-
this.settings = {};
|
|
58
|
-
await this._applyDefaultsIfNeededInternal(); // Call internal version
|
|
59
|
-
} else {
|
|
60
|
-
Logger.error(`Error loading settings from ${this.settingsFilePath}:`, error);
|
|
61
|
-
this.settings = {};
|
|
62
|
-
await this._applyDefaultsIfNeededInternal(); // Call internal version
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Loads settings from the file. This operation is atomic.
|
|
69
|
-
* If the settings file doesn't exist, it initializes with defaults and creates the file.
|
|
70
|
-
* @returns A promise that resolves when settings are loaded.
|
|
71
|
-
*/
|
|
72
|
-
public async loadSettings(): Promise<void> {
|
|
73
|
-
return this.withLock(() => this._loadSettingsInternal());
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Internal method without lock
|
|
77
|
-
private async _applyDefaultsIfNeededInternal(): Promise<void> {
|
|
78
|
-
let updated = false;
|
|
79
|
-
const normalizePath = (p?: string) => p ? p.replace(/\\/g, '/') : undefined;
|
|
80
|
-
|
|
81
|
-
if (!this.settings.pythonEnvs) {
|
|
82
|
-
this.settings.pythonEnvs = {};
|
|
83
|
-
updated = true;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (!this.settings.pythonEnvs["system"]) {
|
|
87
|
-
try {
|
|
88
|
-
const pythonPath = normalizePath(await getSystemPythonExecutablePath() || undefined);
|
|
89
|
-
if (pythonPath) {
|
|
90
|
-
this.settings.pythonEnvs["system"] = pythonPath;
|
|
91
|
-
updated = true;
|
|
92
|
-
}
|
|
93
|
-
} catch (e) {
|
|
94
|
-
Logger.warn(`Could not get default pythonEnv: ${e}`);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (!this.settings.nodePath) {
|
|
99
|
-
try {
|
|
100
|
-
const npmExecDir = await getNpmExecutablePath();
|
|
101
|
-
let nodeExecutable = process.platform === 'win32' ? 'node.exe' : 'node';
|
|
102
|
-
const platformNodePath = process.platform === 'win32'
|
|
103
|
-
? path.join(npmExecDir || '', nodeExecutable)
|
|
104
|
-
: path.join(npmExecDir || '', 'bin', nodeExecutable);
|
|
105
|
-
this.settings.nodePath = npmExecDir ? normalizePath(platformNodePath) : undefined;
|
|
106
|
-
if (this.settings.nodePath) updated = true;
|
|
107
|
-
} catch (e) {
|
|
108
|
-
Logger.warn(`Could not get default nodePath: ${e}`);
|
|
109
|
-
}
|
|
110
|
-
} else {
|
|
111
|
-
this.settings.nodePath = normalizePath(this.settings.nodePath);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (!this.settings.browserPath) {
|
|
115
|
-
try {
|
|
116
|
-
this.settings.browserPath = normalizePath(await getBrowserPath() || undefined);
|
|
117
|
-
if (this.settings.browserPath) updated = true;
|
|
118
|
-
} catch (e) {
|
|
119
|
-
Logger.warn(`Could not get default browserPath: ${e}`);
|
|
120
|
-
}
|
|
121
|
-
} else {
|
|
122
|
-
this.settings.browserPath = normalizePath(this.settings.browserPath);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (!this.settings.systemEnvironments) {
|
|
126
|
-
this.settings.systemEnvironments = { ...process.env } as Record<string, string>;
|
|
127
|
-
updated = true;
|
|
128
|
-
}
|
|
129
|
-
if (this.settings.userConfigurations === undefined) {
|
|
130
|
-
this.settings.userConfigurations = {};
|
|
131
|
-
updated = true;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (updated) {
|
|
135
|
-
await this._saveSettingsInternal();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Applies default values to settings if they are not already set.
|
|
141
|
-
* This operation is atomic and saves settings if defaults are applied.
|
|
142
|
-
* @returns A promise that resolves when defaults are applied and saved if necessary.
|
|
143
|
-
*/
|
|
144
|
-
public async applyDefaultsIfNeeded(): Promise<void> {
|
|
145
|
-
return this.withLock(() => this._applyDefaultsIfNeededInternal());
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Retrieves the current system settings.
|
|
150
|
-
* If settings haven't been loaded or are empty, it attempts to load them.
|
|
151
|
-
* Paths within the settings are normalized (e.g., backslashes to forward slashes).
|
|
152
|
-
* @returns A promise that resolves to the `SystemSettings` object.
|
|
153
|
-
*/
|
|
154
|
-
public async getSystemSettings(): Promise<SystemSettings> {
|
|
155
|
-
// Ensure settings are loaded if they are empty.
|
|
156
|
-
if (Object.keys(this.settings).length === 0) {
|
|
157
|
-
// Use the public, locked version of loadSettings here
|
|
158
|
-
await this.loadSettings();
|
|
159
|
-
}
|
|
160
|
-
// Return a deep copy to prevent external modification of the internal state.
|
|
161
|
-
// Ensure this.settings is used, not a potentially stale local copy.
|
|
162
|
-
const settingsToReturn = JSON.parse(JSON.stringify(this.settings));
|
|
163
|
-
|
|
164
|
-
// Ensure paths are normalized when retrieved
|
|
165
|
-
const normalizedSettings = { ...settingsToReturn };
|
|
166
|
-
|
|
167
|
-
// Normalize paths in pythonEnvs
|
|
168
|
-
if (normalizedSettings.pythonEnvs) {
|
|
169
|
-
const normalizedPythonEnvs: Record<string, string> = {};
|
|
170
|
-
Object.keys(normalizedSettings.pythonEnvs).forEach(key => {
|
|
171
|
-
normalizedPythonEnvs[key] = normalizedSettings.pythonEnvs?.[key]?.replace(/\\/g, '/') || '';
|
|
172
|
-
});
|
|
173
|
-
normalizedSettings.pythonEnvs = normalizedPythonEnvs;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
normalizedSettings.nodePath = normalizedSettings.nodePath?.replace(/\\/g, '/');
|
|
177
|
-
normalizedSettings.browserPath = normalizedSettings.browserPath?.replace(/\\/g, '/');
|
|
178
|
-
return normalizedSettings;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Creates or updates system settings with the provided partial settings.
|
|
183
|
-
* This operation is atomic and protected by a lock.
|
|
184
|
-
* It loads existing settings if not already loaded, merges the new settings,
|
|
185
|
-
* applies any necessary defaults, and then saves the updated settings.
|
|
186
|
-
* @param newSettings A `Partial<SystemSettings>` object containing the settings to update.
|
|
187
|
-
* @returns A promise that resolves to the fully updated and normalized `SystemSettings`.
|
|
188
|
-
*/
|
|
189
|
-
public async createOrUpdateSystemSettings(newSettings: Partial<SystemSettings>): Promise<SystemSettings> {
|
|
190
|
-
return this.withLock(async () => {
|
|
191
|
-
// Ensure current settings are loaded before modification by calling the internal, non-locking version
|
|
192
|
-
if (Object.keys(this.settings).length === 0) {
|
|
193
|
-
await this._loadSettingsInternal();
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const normalizePath = (p?: string) => p ? p.replace(/\\/g, '/') : undefined;
|
|
197
|
-
|
|
198
|
-
// Initialize pythonEnvs if it doesn't exist on the current settings
|
|
199
|
-
if (!this.settings.pythonEnvs) {
|
|
200
|
-
this.settings.pythonEnvs = {};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// Create a new settings object by merging current and new settings.
|
|
204
|
-
const updatedSettings: SystemSettings = {
|
|
205
|
-
...this.settings, // Start with current settings
|
|
206
|
-
...newSettings, // Override with new settings
|
|
207
|
-
// Explicitly handle potentially undefined paths from newSettings
|
|
208
|
-
nodePath: normalizePath(newSettings.nodePath !== undefined ? newSettings.nodePath : this.settings.nodePath),
|
|
209
|
-
browserPath: normalizePath(newSettings.browserPath !== undefined ? newSettings.browserPath : this.settings.browserPath),
|
|
210
|
-
// Ensure systemEnvironments and userConfigurations are properly merged or taken from newSettings
|
|
211
|
-
systemEnvironments: newSettings.systemEnvironments !== undefined
|
|
212
|
-
? newSettings.systemEnvironments
|
|
213
|
-
: this.settings.systemEnvironments, // Keep existing if not in newSettings
|
|
214
|
-
userConfigurations: newSettings.userConfigurations !== undefined
|
|
215
|
-
? newSettings.userConfigurations
|
|
216
|
-
: this.settings.userConfigurations || {}, // Keep existing or default to empty
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
this.settings = updatedSettings;
|
|
220
|
-
|
|
221
|
-
// Call the internal, non-locking version of applyDefaultsIfNeeded
|
|
222
|
-
await this._applyDefaultsIfNeededInternal();
|
|
223
|
-
|
|
224
|
-
// _applyDefaultsIfNeededInternal will call _saveSettingsInternal if it makes changes.
|
|
225
|
-
// However, if newSettings were provided that didn't trigger a change in _applyDefaultsIfNeededInternal
|
|
226
|
-
// (e.g., just updating an existing path), we still need to save.
|
|
227
|
-
// So, always call _saveSettingsInternal to persist all merged changes.
|
|
228
|
-
await this._saveSettingsInternal();
|
|
229
|
-
|
|
230
|
-
Logger.info('System settings updated.');
|
|
231
|
-
// getSystemSettings will handle its own locking if it needs to load.
|
|
232
|
-
return this.getSystemSettings();
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Internal method to save settings to the file without acquiring a lock.
|
|
238
|
-
* Assumes the lock is already held by the calling public method.
|
|
239
|
-
* Normalizes paths before saving.
|
|
240
|
-
* @returns A promise that resolves when settings are written to disk.
|
|
241
|
-
*/
|
|
242
|
-
private async _saveSettingsInternal(): Promise<void> {
|
|
243
|
-
try {
|
|
244
|
-
// Normalize paths before saving
|
|
245
|
-
const settingsToSave = { ...this.settings };
|
|
246
|
-
settingsToSave.nodePath = settingsToSave.nodePath?.replace(/\\/g, '/');
|
|
247
|
-
settingsToSave.browserPath = settingsToSave.browserPath?.replace(/\\/g, '/');
|
|
248
|
-
|
|
249
|
-
if (settingsToSave.pythonEnvs) {
|
|
250
|
-
const normalizedPythonEnvs: Record<string, string> = {};
|
|
251
|
-
Object.keys(settingsToSave.pythonEnvs).forEach(key => {
|
|
252
|
-
normalizedPythonEnvs[key] = settingsToSave.pythonEnvs?.[key]?.replace(/\\/g, '/') || '';
|
|
253
|
-
});
|
|
254
|
-
settingsToSave.pythonEnvs = normalizedPythonEnvs;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
await fs.mkdir(path.dirname(this.settingsFilePath), { recursive: true });
|
|
258
|
-
await fs.writeFile(this.settingsFilePath, JSON.stringify(settingsToSave, null, 2));
|
|
259
|
-
Logger.info(`System settings saved to ${this.settingsFilePath}`);
|
|
260
|
-
} catch (error) {
|
|
261
|
-
Logger.error(`Error saving settings to ${this.settingsFilePath}:`, error);
|
|
262
|
-
throw error; // Re-throw to indicate failure
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Saves the current settings to the file. This operation is atomic and protected by a lock.
|
|
268
|
-
* Paths are normalized before saving.
|
|
269
|
-
* @returns A promise that resolves when the settings are saved.
|
|
270
|
-
*/
|
|
271
|
-
public async saveSettings(): Promise<void> {
|
|
272
|
-
await this.withLock(async () => {
|
|
273
|
-
await this._saveSettingsInternal();
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export const systemSettingsManager = SystemSettingsManager.getInstance();
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import os from 'os';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Defines constants used across the application.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* GitHub repository configuration for feeds
|
|
10
|
-
*/
|
|
11
|
-
export const GITHUB_REPO = {
|
|
12
|
-
url: 'https://github.com/ai-microsoft/imcp-feed.git',
|
|
13
|
-
repoName: 'ai-microsoft/imcp-feed',
|
|
14
|
-
feedsPath: 'feeds',
|
|
15
|
-
feedAssetsName: 'imcp-feeds-${latest}.zip',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Local settings directory path based on OS
|
|
20
|
-
*/
|
|
21
|
-
export const SETTINGS_DIR = (() => {
|
|
22
|
-
switch (process.platform) {
|
|
23
|
-
case 'win32':
|
|
24
|
-
return path.join(os.homedir(), '.imcp');
|
|
25
|
-
default: // linux, darwin (macOS), etc.
|
|
26
|
-
return path.join(os.homedir(), '.imcp');
|
|
27
|
-
}
|
|
28
|
-
})();
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Local feeds directory path
|
|
32
|
-
*/
|
|
33
|
-
export const LOCAL_FEEDS_DIR = path.join(SETTINGS_DIR, 'feeds');
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Path to the user information file
|
|
37
|
-
*/
|
|
38
|
-
export const USER_INFO_PATH = path.join(SETTINGS_DIR, 'settings', 'user_info.json');
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Path to the local feeds schema directory
|
|
42
|
-
*/
|
|
43
|
-
export const LOCAL_FEEDS_SCHEMA_DIR = path.join(LOCAL_FEEDS_DIR, 'schemas');
|
|
44
|
-
|
|
45
|
-
const CODE_STRORAGE_DIR = (() => {
|
|
46
|
-
switch (process.platform) {
|
|
47
|
-
case 'win32':
|
|
48
|
-
return path.join(os.homedir(), 'AppData', 'Roaming', 'Code', 'User');
|
|
49
|
-
case 'darwin': // macOS
|
|
50
|
-
return path.join(os.homedir(), 'Library', 'Application Support', 'Code', 'User');
|
|
51
|
-
default: // linux
|
|
52
|
-
return path.join(os.homedir(), '.config', 'Code', 'User');
|
|
53
|
-
}
|
|
54
|
-
})();
|
|
55
|
-
|
|
56
|
-
const CODE_INSIDER_STRORAGE_DIR = (() => {
|
|
57
|
-
switch (process.platform) {
|
|
58
|
-
case 'win32':
|
|
59
|
-
return path.join(os.homedir(), 'AppData', 'Roaming', 'Code - Insiders', 'User');
|
|
60
|
-
case 'darwin': // macOS
|
|
61
|
-
return path.join(os.homedir(), 'Library', 'Application Support', 'Code - Insiders', 'User');
|
|
62
|
-
default: // linux
|
|
63
|
-
return path.join(os.homedir(), '.config', 'Code - Insiders', 'User');
|
|
64
|
-
}
|
|
65
|
-
})();
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Supported client configurations.
|
|
69
|
-
* Key: Client name (e.g., 'vscode')
|
|
70
|
-
* Value: Client-specific settings or configuration details.
|
|
71
|
-
* TODO: Define actual client settings structure.
|
|
72
|
-
*/
|
|
73
|
-
export const SUPPORTED_CLIENTS: Record<string, {
|
|
74
|
-
extension: {
|
|
75
|
-
extensionId: string;
|
|
76
|
-
leastVersion?: string;
|
|
77
|
-
repository?: string;
|
|
78
|
-
assetName?: string;
|
|
79
|
-
private?: boolean;
|
|
80
|
-
};
|
|
81
|
-
codeSettingPath: string;
|
|
82
|
-
codeInsiderSettingPath: string;
|
|
83
|
-
}> = {
|
|
84
|
-
'MSRooCode': {
|
|
85
|
-
|
|
86
|
-
extension: {
|
|
87
|
-
extensionId: 'microsoftai.ms-roo-cline',
|
|
88
|
-
leastVersion: '0.0.8',
|
|
89
|
-
repository: 'ai-microsoft/roo-cline',
|
|
90
|
-
assetName: 'ms-roo-cline-${version}.vsix',
|
|
91
|
-
private: true
|
|
92
|
-
},
|
|
93
|
-
codeSettingPath: path.join(CODE_STRORAGE_DIR, 'globalStorage', 'microsoftai.ms-roo-cline', 'settings', 'cline_mcp_settings.json'),
|
|
94
|
-
codeInsiderSettingPath: path.join(CODE_INSIDER_STRORAGE_DIR, 'globalStorage', 'microsoftai.ms-roo-cline', 'settings', 'cline_mcp_settings.json'),
|
|
95
|
-
},
|
|
96
|
-
'Cline': { /* VS Code specific settings */
|
|
97
|
-
extension: {
|
|
98
|
-
extensionId: 'saoudrizwan.claude-dev',
|
|
99
|
-
},
|
|
100
|
-
codeSettingPath: path.join(CODE_STRORAGE_DIR, 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'),
|
|
101
|
-
codeInsiderSettingPath: path.join(CODE_INSIDER_STRORAGE_DIR, 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'),
|
|
102
|
-
},
|
|
103
|
-
'GithubCopilot': { /* GitHub Copilot specific settings */
|
|
104
|
-
extension: {
|
|
105
|
-
extensionId: 'github.copilot',
|
|
106
|
-
},
|
|
107
|
-
codeSettingPath: path.join(CODE_STRORAGE_DIR, 'settings.json'),
|
|
108
|
-
codeInsiderSettingPath: path.join(CODE_INSIDER_STRORAGE_DIR, 'settings.json'),
|
|
109
|
-
},
|
|
110
|
-
// Add other supported clients here
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* List of supported client names.
|
|
115
|
-
*/
|
|
116
|
-
export const SUPPORTED_CLIENT_NAMES = Object.keys(SUPPORTED_CLIENTS);
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Minimum time between requirement update checks (in milliseconds)
|
|
120
|
-
* 10 minutes = 10 * 60 * 1000 = 600000 ms
|
|
121
|
-
*/
|
|
122
|
-
export const UPDATE_CHECK_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Step name constants for InstallOperationManager and step recording.
|
|
3
|
-
*
|
|
4
|
-
* This file defines all static step names and documents dynamic step name patterns
|
|
5
|
-
* used throughout the installation and onboarding process.
|
|
6
|
-
*
|
|
7
|
-
* Dynamic step names are documented as template string patterns.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/** Step for processing all requirement updates in a batch operation. */
|
|
11
|
-
export const STEP_PROCESS_REQUIREMENT_UPDATES = 'Processing all requirement updates';
|
|
12
|
-
|
|
13
|
-
/** Step for checking the status of a specific requirement. */
|
|
14
|
-
export const STEP_CHECKING_REQUIREMENT_STATUS = 'Checking the status of requirement';
|
|
15
|
-
|
|
16
|
-
/** Step for installing requirements in the background process. */
|
|
17
|
-
export const STEP_INSTALLING_REQUIREMENTS_IN_BACKGROUND = 'Installing requirements in the background';
|
|
18
|
-
|
|
19
|
-
/** Step for running the install logic in the NugetInstaller. */
|
|
20
|
-
export const STEP_NUGET_INSTALLER_INSTALL = 'Running install in NugetInstaller';
|
|
21
|
-
|
|
22
|
-
/** Step for checking and installing all requirements as needed. */
|
|
23
|
-
export const STEP_CHECK_AND_INSTALL_REQUIREMENTS = 'Checking and installing all requirements';
|
|
24
|
-
|
|
25
|
-
/** Step for running the install logic in the CommandInstaller. */
|
|
26
|
-
export const STEP_COMMAND_INSTALLER_INSTALL = 'Running install in CommandInstaller';
|
|
27
|
-
|
|
28
|
-
/** Step for running the install logic in the GeneralInstaller. */
|
|
29
|
-
export const STEP_GENERAL_INSTALLER_INSTALL = 'Running install in GeneralInstaller';
|
|
30
|
-
|
|
31
|
-
/** Step for executing the actual installation command (npm, pip, etc.). */
|
|
32
|
-
export const STEP_INSTALLATION_COMMAND_EXECUTION = 'Executing installation command for requirement';
|
|
33
|
-
|
|
34
|
-
/** Step for running the install logic in the PipInstaller. */
|
|
35
|
-
export const STEP_PIP_INSTALLER_INSTALL = 'Running install in PipInstaller';
|
|
36
|
-
|
|
37
|
-
/** Step for processing requirement updates in the RequirementService. */
|
|
38
|
-
export const STEP_PROCESS_REQUIREMENT_UPDATES_SERVICE = 'Processing requirement updates in RequirementService';
|
|
39
|
-
|
|
40
|
-
/** Step for checking if the server is ready after installation. */
|
|
41
|
-
export const STEP_CHECK_SERVER_READINESS = 'Checking server readiness after installation';
|
|
42
|
-
|
|
43
|
-
/** Step for running the install logic in the NpmInstaller. */
|
|
44
|
-
export const STEP_NPM_INSTALLER_INSTALL = 'Running install in NpmInstaller';
|
|
45
|
-
|
|
46
|
-
/** Prefix for steps that update a specific requirement. */
|
|
47
|
-
export const STEP_INSTALL_REQUIREMENT_PREFIX = 'Updating requirement:';
|
|
48
|
-
|
|
49
|
-
/** Prefix for steps that execute an installation command for a requirement. */
|
|
50
|
-
export const STEP_INSTALL_COMMAND_PREFIX = 'Executing installation command for:';
|
|
51
|
-
|
|
52
|
-
/** Step for checking and installing the VS Code extension for the client. */
|
|
53
|
-
export const STEP_CHECK_VSCODE_AND_INSTALL_EXTENSION = 'Checking and installing VS Code extension for client';
|
|
54
|
-
|
|
55
|
-
/** Step for setting up the installation configuration (env, args, etc.). */
|
|
56
|
-
export const STEP_SETUP_INSTALLATION_CONFIG = 'Setting up installation configuration';
|
|
57
|
-
|
|
58
|
-
/** Step for updating VS Code settings for the client/server. */
|
|
59
|
-
export const STEP_UPDATE_VSCODE_SETTINGS = 'Updating VS Code settings for client/server';
|
|
60
|
-
|
|
61
|
-
/** Step for the overall installation process of a client or server. */
|
|
62
|
-
export const STEP_INSTALLATION = 'Running overall installation process';
|
|
63
|
-
|
|
64
|
-
/** Step for marking the initiation of an onboarding or installation process. */
|
|
65
|
-
export const STEP_INITIATED = 'Initiating onboarding or installation process';
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
export enum OSType {
|
|
2
|
-
Windows = 'windows',
|
|
3
|
-
MacOS = 'macos',
|
|
4
|
-
Linux = 'linux'
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface RequirementStatus {
|
|
8
|
-
name: string;
|
|
9
|
-
type: string;
|
|
10
|
-
installed: boolean;
|
|
11
|
-
inProgress?: boolean;
|
|
12
|
-
version?: string;
|
|
13
|
-
error?: string;
|
|
14
|
-
availableUpdate?: {
|
|
15
|
-
version: string;
|
|
16
|
-
message: string;
|
|
17
|
-
};
|
|
18
|
-
lastCheckTime?: string;
|
|
19
|
-
operationStatus?: OperationStatus;
|
|
20
|
-
pythonEnv?: string; // Store Python environment path for pip requirements
|
|
21
|
-
npmPath?: string; // Path to the installed npm package path
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface MCPServerStatus {
|
|
25
|
-
installedStatus: Record<string, OperationStatus>; // client: installed
|
|
26
|
-
name: string;
|
|
27
|
-
error?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface OperationStatus {
|
|
31
|
-
status: 'pending' | 'in-progress' | 'completed' | 'failed';
|
|
32
|
-
type: 'install' | 'uninstall' | 'update' | 'check';
|
|
33
|
-
target: 'requirement' | 'server';
|
|
34
|
-
message?: string;
|
|
35
|
-
error?: string;
|
|
36
|
-
operationId?: string; // Added to track async operations
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface InstallationStatus {
|
|
40
|
-
requirementsStatus: Record<string, RequirementStatus>;
|
|
41
|
-
serversStatus: Record<string, MCPServerStatus>;
|
|
42
|
-
lastUpdated: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface MCPServerCategory {
|
|
46
|
-
name: string;
|
|
47
|
-
displayName: string;
|
|
48
|
-
description?: string;
|
|
49
|
-
type: 'local';
|
|
50
|
-
path?: string;
|
|
51
|
-
installationStatus?: InstallationStatus;
|
|
52
|
-
feedConfiguration?: FeedConfiguration;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface ServerCategoryListOptions {
|
|
56
|
-
local?: boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface ServerOperationResult {
|
|
60
|
-
success: boolean;
|
|
61
|
-
message?: string;
|
|
62
|
-
error?: Error;
|
|
63
|
-
output?: string; // Added to capture installation logs
|
|
64
|
-
status?: OperationStatus[]; // Added to capture operation status
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface MCPConfiguration {
|
|
68
|
-
localServerCategories: MCPServerCategory[];
|
|
69
|
-
feeds: Record<string, FeedConfiguration>;
|
|
70
|
-
clientMCPSettings?: Record<string, Record<string, any>>;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface ServerInstallOptions {
|
|
74
|
-
force?: boolean;
|
|
75
|
-
env?: Record<string, string>; // Environment variables for installation
|
|
76
|
-
targetClients?: string[]; // Target clients for configuration
|
|
77
|
-
requirements?: RequirementConfig[];
|
|
78
|
-
args?: string[]; // Arguments for installation
|
|
79
|
-
settings?: Record<string, any>; // Settings for installation like python env
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface UpdateRequirementOptions {
|
|
83
|
-
requirementName: string;
|
|
84
|
-
updateVersion: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export interface ServerUninstallOptions {
|
|
88
|
-
removeData?: boolean;
|
|
89
|
-
targets?: string[]; // List of client targets to uninstall from
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Types related to server feed configuration (e.g., ai-coder-tools.json)
|
|
93
|
-
export interface EnvVariableConfig {
|
|
94
|
-
Required: boolean;
|
|
95
|
-
Description: string;
|
|
96
|
-
Default?: string;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface InstallationConfig {
|
|
100
|
-
command: string;
|
|
101
|
-
args: string[]; // Can use ${packageSource} as template variable for installation path
|
|
102
|
-
env?: Record<string, EnvVariableConfig>; // Note the colon in property name
|
|
103
|
-
url?: string; // URL for sse mode
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface DependencyConfig {
|
|
107
|
-
requirements?: Array<{
|
|
108
|
-
name: string;
|
|
109
|
-
version: string;
|
|
110
|
-
order?: number;
|
|
111
|
-
}>;
|
|
112
|
-
mcpServers?: Array<{
|
|
113
|
-
name: string;
|
|
114
|
-
}>;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface McpConfig {
|
|
118
|
-
name: string;
|
|
119
|
-
description: string;
|
|
120
|
-
mode: 'stdio' | 'sse'; // Currently only stdio mode is supported in ai-coder-tools
|
|
121
|
-
dependencies?: DependencyConfig;
|
|
122
|
-
schemas?: string; // Path to the schema file
|
|
123
|
-
repository?: string; // Repository URL for the server
|
|
124
|
-
systemTags?: Record<string, string>; // System tags for the feed
|
|
125
|
-
installation: InstallationConfig;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface RegistryConfig {
|
|
129
|
-
githubRelease?: {
|
|
130
|
-
repository: string;
|
|
131
|
-
assetsName?: string; // Template string like "ai-coder-tools-${latest}.zip"
|
|
132
|
-
assetName: string; // Template string like "ai-coder-tools-${latest}.tgz"
|
|
133
|
-
};
|
|
134
|
-
artifacts?: {
|
|
135
|
-
registryUrl: string;
|
|
136
|
-
registryName: string; // Name of the registry
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export interface RequirementConfig {
|
|
141
|
-
name: string;
|
|
142
|
-
type: 'npm' | 'pip' | 'command' | 'extension' | 'nuget' | 'other'; // Add other requirement types if needed
|
|
143
|
-
alias?: string; // Alias for the command type
|
|
144
|
-
version: string;
|
|
145
|
-
registry?: RegistryConfig;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface FeedConfiguration {
|
|
149
|
-
name: string;
|
|
150
|
-
displayName: string;
|
|
151
|
-
description: string;
|
|
152
|
-
repository?: string;
|
|
153
|
-
PullRequest?: string; // Optional Pull Request link
|
|
154
|
-
requirements: RequirementConfig[];
|
|
155
|
-
mcpServers: McpConfig[];
|
|
156
|
-
systemTags?: Record<string, string>; // System tags for the feed
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export interface ClientSettings {
|
|
160
|
-
codeSettingPath: string;
|
|
161
|
-
codeInsiderSettingPath: string;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Events that can be emitted by the SDK
|
|
165
|
-
export enum MCPEvent {
|
|
166
|
-
SERVER_INSTALLED = 'server:installed',
|
|
167
|
-
SERVER_UNINSTALLED = 'server:uninstalled',
|
|
168
|
-
SERVER_STARTED = 'server:started',
|
|
169
|
-
SERVER_STOPPED = 'server:stopped',
|
|
170
|
-
CONFIG_CHANGED = 'config:changed',
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface MCPEventData {
|
|
174
|
-
[MCPEvent.SERVER_INSTALLED]: { server: MCPServerCategory };
|
|
175
|
-
[MCPEvent.SERVER_UNINSTALLED]: { serverName: string; targets?: string[] };
|
|
176
|
-
[MCPEvent.SERVER_STARTED]: { server: MCPServerCategory };
|
|
177
|
-
[MCPEvent.SERVER_STOPPED]: { serverName: string };
|
|
178
|
-
[MCPEvent.CONFIG_CHANGED]: { configuration: MCPConfiguration };
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export interface InstallOperationStep {
|
|
182
|
-
name: string;
|
|
183
|
-
status: 'pending' | 'in-progress' | 'completed' | 'failed' | 'canceled';
|
|
184
|
-
message?: string;
|
|
185
|
-
isCritical?: boolean;
|
|
186
|
-
timestamp: string;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface InstallOperationDetails {
|
|
190
|
-
currentStep: string;
|
|
191
|
-
steps: InstallOperationStep[];
|
|
192
|
-
lastUpdated: string;
|
|
193
|
-
error?: string;
|
|
194
|
-
overallStatus: 'pending' | 'in-progress' | 'completed' | 'failed';
|
|
195
|
-
}
|
|
196
|
-
export interface SystemSettings {
|
|
197
|
-
pythonEnvs?: Record<string, string>;
|
|
198
|
-
nodePath?: string;
|
|
199
|
-
browserPath?: string;
|
|
200
|
-
systemEnvironments?: Record<string, string>;
|
|
201
|
-
userConfigurations?: Record<string, string>;
|
|
202
|
-
}
|