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,298 +0,0 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { LOCAL_FEEDS_DIR, SUPPORTED_CLIENTS } from '../metadatas/constants.js';
|
|
4
|
-
import { Logger } from '../../utils/logger.js';
|
|
5
|
-
import { readJsonFile } from '../../utils/clientUtils.js';
|
|
6
|
-
import {
|
|
7
|
-
MCPConfiguration,
|
|
8
|
-
MCPServerCategory,
|
|
9
|
-
MCPServerStatus,
|
|
10
|
-
OperationStatus,
|
|
11
|
-
FeedConfiguration,
|
|
12
|
-
RequirementStatus,
|
|
13
|
-
InstallationStatus
|
|
14
|
-
} from '../metadatas/types.js';
|
|
15
|
-
|
|
16
|
-
export class ConfigurationLoader {
|
|
17
|
-
/**
|
|
18
|
-
* Updates the installed status for a server and client combination
|
|
19
|
-
*/
|
|
20
|
-
private static updateServerInstalledStatus(
|
|
21
|
-
serverStatus: MCPServerStatus,
|
|
22
|
-
clientName: string,
|
|
23
|
-
operationStatus: OperationStatus
|
|
24
|
-
): void {
|
|
25
|
-
if (!serverStatus.installedStatus) {
|
|
26
|
-
serverStatus.installedStatus = {};
|
|
27
|
-
}
|
|
28
|
-
serverStatus.installedStatus[clientName] = operationStatus;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Removes a client's status from a server
|
|
33
|
-
*/
|
|
34
|
-
private static removeClientStatus(
|
|
35
|
-
serverStatus: MCPServerStatus,
|
|
36
|
-
clientName: string
|
|
37
|
-
): void {
|
|
38
|
-
if (serverStatus.installedStatus && serverStatus.installedStatus[clientName]) {
|
|
39
|
-
delete serverStatus.installedStatus[clientName];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Synchronizes server categories with client MCP settings.
|
|
45
|
-
* Uses clientMCPSettings as source of truth for installation status.
|
|
46
|
-
*/
|
|
47
|
-
static syncServerCategoriesWithClientSettings(configuration: MCPConfiguration): MCPConfiguration {
|
|
48
|
-
if (!configuration.clientMCPSettings) {
|
|
49
|
-
return configuration;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
configuration.localServerCategories = configuration.localServerCategories.map(category => {
|
|
53
|
-
if (!category.installationStatus?.serversStatus) {
|
|
54
|
-
return category;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const updatedServerStatus = { ...category.installationStatus.serversStatus };
|
|
58
|
-
const clientSettings = configuration.clientMCPSettings as Record<string, Record<string, any>>;
|
|
59
|
-
|
|
60
|
-
for (const [clientName, settings] of Object.entries(clientSettings)) {
|
|
61
|
-
const clientServers = clientName === 'GithubCopilot'
|
|
62
|
-
? settings.servers || {}
|
|
63
|
-
: settings.mcpServers || {};
|
|
64
|
-
|
|
65
|
-
Object.keys(updatedServerStatus).forEach(serverName => {
|
|
66
|
-
if (clientServers[serverName]) {
|
|
67
|
-
if (!updatedServerStatus[serverName].installedStatus[clientName]) {
|
|
68
|
-
const operationStatus: OperationStatus = {
|
|
69
|
-
status: 'completed',
|
|
70
|
-
type: 'install',
|
|
71
|
-
target: 'server',
|
|
72
|
-
message: `Server ${serverName} is configured for client ${clientName}`
|
|
73
|
-
};
|
|
74
|
-
ConfigurationLoader.updateServerInstalledStatus(updatedServerStatus[serverName], clientName, operationStatus);
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
ConfigurationLoader.removeClientStatus(updatedServerStatus[serverName], clientName);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
...category,
|
|
84
|
-
installationStatus: {
|
|
85
|
-
...category.installationStatus,
|
|
86
|
-
serversStatus: updatedServerStatus,
|
|
87
|
-
lastUpdated: new Date().toISOString()
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return configuration;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Initializes installation status for a feed configuration
|
|
97
|
-
*/
|
|
98
|
-
private static initializeInstallationStatus(feedConfig?: FeedConfiguration): InstallationStatus {
|
|
99
|
-
const requirementsStatus: Record<string, RequirementStatus> = {};
|
|
100
|
-
const serversStatus: Record<string, MCPServerStatus> = {};
|
|
101
|
-
|
|
102
|
-
if (feedConfig) {
|
|
103
|
-
if (feedConfig.requirements) {
|
|
104
|
-
for (const req of feedConfig.requirements) {
|
|
105
|
-
requirementsStatus[req.name] = {
|
|
106
|
-
name: req.name,
|
|
107
|
-
type: req.type,
|
|
108
|
-
installed: false,
|
|
109
|
-
version: req.version,
|
|
110
|
-
error: undefined
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (feedConfig.mcpServers) {
|
|
115
|
-
for (const mcp of feedConfig.mcpServers) {
|
|
116
|
-
serversStatus[mcp.name] = {
|
|
117
|
-
name: mcp.name,
|
|
118
|
-
error: undefined,
|
|
119
|
-
installedStatus: {}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return {
|
|
126
|
-
requirementsStatus,
|
|
127
|
-
serversStatus,
|
|
128
|
-
lastUpdated: new Date().toISOString()
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Synchronizes server categories with feeds
|
|
134
|
-
*/
|
|
135
|
-
private static async syncServerCategoriesWithFeeds(configuration: MCPConfiguration): Promise<MCPConfiguration> {
|
|
136
|
-
// Filter out categories that don't have corresponding feeds and update existing ones
|
|
137
|
-
configuration.localServerCategories = configuration.localServerCategories
|
|
138
|
-
.filter(server => configuration.feeds[server.name])
|
|
139
|
-
.map(server => {
|
|
140
|
-
server.feedConfiguration = configuration.feeds[server.name];
|
|
141
|
-
|
|
142
|
-
if (
|
|
143
|
-
!server.installationStatus ||
|
|
144
|
-
!server.installationStatus.requirementsStatus ||
|
|
145
|
-
Object.keys(server.installationStatus.requirementsStatus).length === 0 ||
|
|
146
|
-
!server.installationStatus.serversStatus ||
|
|
147
|
-
Object.keys(server.installationStatus.serversStatus).length < Object.keys(server.feedConfiguration?.mcpServers || []).length
|
|
148
|
-
) {
|
|
149
|
-
server.installationStatus = ConfigurationLoader.initializeInstallationStatus(server.feedConfiguration);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return server;
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
// Add new categories for feeds that don't have a corresponding category
|
|
156
|
-
const existingServerNames = new Set(configuration.localServerCategories.map(category => category.name));
|
|
157
|
-
|
|
158
|
-
for (const [feedName, feedConfig] of Object.entries(configuration.feeds)) {
|
|
159
|
-
if (!existingServerNames.has(feedName)) {
|
|
160
|
-
const newServerCategory: MCPServerCategory = {
|
|
161
|
-
name: feedName,
|
|
162
|
-
displayName: feedConfig.displayName || feedName,
|
|
163
|
-
type: 'local',
|
|
164
|
-
description: feedConfig.description || `Local MCP server category: ${feedName}`,
|
|
165
|
-
installationStatus: ConfigurationLoader.initializeInstallationStatus(feedConfig),
|
|
166
|
-
feedConfiguration: feedConfig
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
configuration.localServerCategories.push(newServerCategory);
|
|
170
|
-
console.log(`Created new local server entry for feed: ${feedName}`);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return configuration;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Loads feed configurations into the MCP configuration
|
|
179
|
-
*/
|
|
180
|
-
static async loadFeedsIntoConfiguration(configuration: MCPConfiguration, feedFile?: string, settings?: { prLink?:string, adhocServers?: string[] }): Promise<MCPConfiguration> {
|
|
181
|
-
try {
|
|
182
|
-
await fs.mkdir(LOCAL_FEEDS_DIR, { recursive: true });
|
|
183
|
-
const feeds: Record<string, FeedConfiguration> = {};
|
|
184
|
-
|
|
185
|
-
// Load provided feed file if specified
|
|
186
|
-
if (feedFile) {
|
|
187
|
-
try {
|
|
188
|
-
const content = await fs.readFile(feedFile, 'utf8');
|
|
189
|
-
let config = JSON.parse(content) as FeedConfiguration;
|
|
190
|
-
if (config && config.name) {
|
|
191
|
-
// Update systemTags if feedFile is provided
|
|
192
|
-
if (!config.systemTags) {
|
|
193
|
-
config.systemTags = {};
|
|
194
|
-
}
|
|
195
|
-
config.systemTags['adhoc'] = 'true';
|
|
196
|
-
|
|
197
|
-
// Update PullRequest if prLink is provided in settings
|
|
198
|
-
if (settings?.prLink) {
|
|
199
|
-
config.PullRequest = settings.prLink;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// Update mcpServers systemTags if adhocServers are provided in settings
|
|
203
|
-
if (settings?.adhocServers && settings.adhocServers.length > 0 && config.mcpServers) {
|
|
204
|
-
config.mcpServers = config.mcpServers.map(server => {
|
|
205
|
-
if (settings.adhocServers!.includes(server.name)) {
|
|
206
|
-
if (!server.systemTags) {
|
|
207
|
-
server.systemTags = {};
|
|
208
|
-
}
|
|
209
|
-
server.systemTags['adhoc'] = 'true';
|
|
210
|
-
}
|
|
211
|
-
return server;
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
feeds[config.name] = config;
|
|
216
|
-
console.log(`Loaded and processed feed configuration from provided file: ${feedFile}`);
|
|
217
|
-
}
|
|
218
|
-
} catch (error) {
|
|
219
|
-
console.log(`Error loading feed configuration from provided file ${feedFile}:`, error);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Load feeds from LOCAL_FEEDS_DIR
|
|
224
|
-
const files = await fs.readdir(LOCAL_FEEDS_DIR);
|
|
225
|
-
const jsonFiles = files.filter(file => file.endsWith('.json'));
|
|
226
|
-
|
|
227
|
-
if (jsonFiles.length === 0 && !feedFile) {
|
|
228
|
-
console.log(`No feed configuration files found in ${LOCAL_FEEDS_DIR}`);
|
|
229
|
-
return configuration;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
for (const file of jsonFiles) {
|
|
233
|
-
try {
|
|
234
|
-
const filePath = path.join(LOCAL_FEEDS_DIR, file);
|
|
235
|
-
const content = await fs.readFile(filePath, 'utf8');
|
|
236
|
-
const config = JSON.parse(content) as FeedConfiguration;
|
|
237
|
-
if (config && config.name) {
|
|
238
|
-
// If feed exists from provided file, skip the local one
|
|
239
|
-
if (!feeds[config.name]) {
|
|
240
|
-
feeds[config.name] = config;
|
|
241
|
-
} else {
|
|
242
|
-
console.log(`Skipping local feed ${config.name} as it was provided via --feed-file`);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
} catch (error) {
|
|
246
|
-
console.warn(`Error loading feed configuration from ${file}:`, error);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
configuration.feeds = feeds;
|
|
251
|
-
return await ConfigurationLoader.syncServerCategoriesWithFeeds(configuration);
|
|
252
|
-
} catch (error) {
|
|
253
|
-
console.error("Error loading feed configurations:", error);
|
|
254
|
-
throw error;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Loads MCP client settings into the configuration
|
|
260
|
-
*/
|
|
261
|
-
static async loadClientMCPSettings(configuration: MCPConfiguration): Promise<MCPConfiguration> {
|
|
262
|
-
try {
|
|
263
|
-
Logger.debug('Starting to load MCP client settings...');
|
|
264
|
-
const settings: Record<string, Record<string, any>> = {};
|
|
265
|
-
|
|
266
|
-
for (const [clientName, clientSettings] of Object.entries(SUPPORTED_CLIENTS)) {
|
|
267
|
-
const settingPath = process.env.CODE_INSIDERS
|
|
268
|
-
? clientSettings.codeInsiderSettingPath
|
|
269
|
-
: clientSettings.codeSettingPath;
|
|
270
|
-
try {
|
|
271
|
-
let content = await readJsonFile(settingPath, true);
|
|
272
|
-
|
|
273
|
-
if (clientName === 'GithubCopilot') {
|
|
274
|
-
if (!content.mcp) {
|
|
275
|
-
content = {
|
|
276
|
-
servers: {},
|
|
277
|
-
inputs: []
|
|
278
|
-
};
|
|
279
|
-
} else {
|
|
280
|
-
content = content.mcp;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
settings[clientName] = content;
|
|
284
|
-
Logger.debug(`Successfully loaded MCP settings for ${clientName}`);
|
|
285
|
-
} catch (error) {
|
|
286
|
-
Logger.debug(`Warning: Could not load MCP settings for client ${clientName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
287
|
-
settings[clientName] = {};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
configuration.clientMCPSettings = settings;
|
|
292
|
-
return ConfigurationLoader.syncServerCategoriesWithClientSettings(configuration);
|
|
293
|
-
} catch (error) {
|
|
294
|
-
Logger.error('Error loading client MCP settings:', error);
|
|
295
|
-
throw error;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|