imcp 0.1.3 → 0.1.5

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.
Files changed (239) hide show
  1. package/README.md +21 -4
  2. package/dist/cli/commands/install.js.map +1 -0
  3. package/dist/cli/commands/list.js.map +1 -0
  4. package/dist/cli/commands/pull.js.map +1 -0
  5. package/dist/cli/commands/serve.js.map +1 -0
  6. package/dist/cli/commands/start.d.ts +2 -0
  7. package/dist/cli/commands/start.js +32 -0
  8. package/dist/cli/commands/start.js.map +1 -0
  9. package/dist/cli/commands/sync.d.ts +2 -0
  10. package/dist/cli/commands/sync.js +17 -0
  11. package/dist/cli/commands/sync.js.map +1 -0
  12. package/dist/cli/commands/uninstall.js.map +1 -0
  13. package/dist/cli/index.js +0 -0
  14. package/dist/cli/index.js.map +1 -0
  15. package/dist/core/ConfigurationLoader.d.ts +32 -0
  16. package/{src/core/loaders/ConfigurationLoader.ts → dist/core/ConfigurationLoader.js} +236 -298
  17. package/dist/core/ConfigurationLoader.js.map +1 -0
  18. package/dist/core/ConfigurationProvider.d.ts +35 -0
  19. package/{src/core/loaders/ConfigurationProvider.ts → dist/core/ConfigurationProvider.js} +375 -462
  20. package/dist/core/ConfigurationProvider.js.map +1 -0
  21. package/dist/core/InstallationService.d.ts +50 -0
  22. package/dist/core/InstallationService.js +350 -0
  23. package/dist/core/InstallationService.js.map +1 -0
  24. package/dist/core/MCPManager.d.ts +28 -0
  25. package/dist/core/MCPManager.js +188 -0
  26. package/dist/core/MCPManager.js.map +1 -0
  27. package/dist/core/RequirementService.d.ts +40 -0
  28. package/dist/core/RequirementService.js +110 -0
  29. package/dist/core/RequirementService.js.map +1 -0
  30. package/dist/core/ServerSchemaLoader.d.ts +11 -0
  31. package/dist/core/ServerSchemaLoader.js +43 -0
  32. package/dist/core/ServerSchemaLoader.js.map +1 -0
  33. package/dist/core/ServerSchemaProvider.d.ts +17 -0
  34. package/dist/core/ServerSchemaProvider.js +120 -0
  35. package/dist/core/ServerSchemaProvider.js.map +1 -0
  36. package/dist/core/constants.d.ts +47 -0
  37. package/dist/core/constants.js +94 -0
  38. package/dist/core/constants.js.map +1 -0
  39. package/dist/core/installers/BaseInstaller.d.ts +74 -0
  40. package/dist/core/installers/BaseInstaller.js +253 -0
  41. package/dist/core/installers/BaseInstaller.js.map +1 -0
  42. package/dist/core/installers/ClientInstaller.d.ts +23 -0
  43. package/dist/core/installers/ClientInstaller.js +564 -0
  44. package/dist/core/installers/ClientInstaller.js.map +1 -0
  45. package/dist/core/installers/CommandInstaller.d.ts +37 -0
  46. package/{src/core/installers/requirements/CommandInstaller.ts → dist/core/installers/CommandInstaller.js} +173 -231
  47. package/dist/core/installers/CommandInstaller.js.map +1 -0
  48. package/dist/core/installers/GeneralInstaller.d.ts +33 -0
  49. package/dist/core/installers/GeneralInstaller.js +85 -0
  50. package/dist/core/installers/GeneralInstaller.js.map +1 -0
  51. package/dist/core/installers/InstallerFactory.d.ts +54 -0
  52. package/{src/core/installers/requirements/InstallerFactory.ts → dist/core/installers/InstallerFactory.js} +97 -112
  53. package/dist/core/installers/InstallerFactory.js.map +1 -0
  54. package/dist/core/installers/NpmInstaller.d.ts +26 -0
  55. package/dist/core/installers/NpmInstaller.js +127 -0
  56. package/dist/core/installers/NpmInstaller.js.map +1 -0
  57. package/dist/core/installers/PipInstaller.d.ts +28 -0
  58. package/dist/core/installers/PipInstaller.js +127 -0
  59. package/dist/core/installers/PipInstaller.js.map +1 -0
  60. package/{src/core/installers/requirements/RequirementInstaller.ts → dist/core/installers/RequirementInstaller.d.ts} +33 -42
  61. package/dist/core/installers/RequirementInstaller.js +3 -0
  62. package/dist/core/installers/RequirementInstaller.js.map +1 -0
  63. package/dist/core/installers/clients/BaseClientInstaller.js.map +1 -0
  64. package/dist/core/installers/clients/ClientInstaller.js.map +1 -0
  65. package/dist/core/installers/clients/ClientInstallerFactory.js.map +1 -0
  66. package/dist/core/installers/clients/ClineInstaller.js.map +1 -0
  67. package/dist/core/installers/clients/ExtensionInstaller.js.map +1 -0
  68. package/dist/core/installers/clients/GithubCopilotInstaller.js.map +1 -0
  69. package/dist/core/installers/clients/MSRooCodeInstaller.js.map +1 -0
  70. package/dist/core/installers/index.js.map +1 -0
  71. package/dist/core/installers/requirements/BaseInstaller.js.map +1 -0
  72. package/dist/core/installers/requirements/CommandInstaller.js.map +1 -0
  73. package/dist/core/installers/requirements/GeneralInstaller.js.map +1 -0
  74. package/dist/core/installers/requirements/InstallerFactory.js +2 -0
  75. package/dist/core/installers/requirements/InstallerFactory.js.map +1 -0
  76. package/dist/core/installers/requirements/NpmInstaller.js.map +1 -0
  77. package/dist/core/installers/requirements/NugetInstaller.d.ts +37 -0
  78. package/dist/core/installers/requirements/NugetInstaller.js +189 -0
  79. package/dist/core/installers/requirements/NugetInstaller.js.map +1 -0
  80. package/dist/core/installers/requirements/PipInstaller.js.map +1 -0
  81. package/dist/core/installers/requirements/RequirementInstaller.js.map +1 -0
  82. package/dist/core/loaders/ConfigurationLoader.js.map +1 -0
  83. package/dist/core/loaders/ConfigurationProvider.js.map +1 -0
  84. package/dist/core/loaders/InstallOperationManager.js.map +1 -0
  85. package/dist/core/loaders/ServerSchemaLoader.js.map +1 -0
  86. package/dist/core/loaders/ServerSchemaProvider.js.map +1 -0
  87. package/dist/core/loaders/SystemSettingsManager.js.map +1 -0
  88. package/dist/core/metadatas/constants.js.map +1 -0
  89. package/dist/core/metadatas/recordingConstants.d.ts +2 -0
  90. package/dist/core/metadatas/recordingConstants.js +2 -0
  91. package/dist/core/metadatas/recordingConstants.js.map +1 -0
  92. package/dist/core/metadatas/types.d.ts +1 -1
  93. package/dist/core/metadatas/types.js.map +1 -0
  94. package/dist/core/onboard/FeedOnboardService.js +1 -22
  95. package/dist/core/onboard/FeedOnboardService.js.map +1 -0
  96. package/dist/core/onboard/OnboardProcessor.js.map +1 -0
  97. package/dist/core/onboard/OnboardStatus.js.map +1 -0
  98. package/dist/core/onboard/OnboardStatusManager.js.map +1 -0
  99. package/dist/core/types.d.ts +166 -0
  100. package/dist/core/types.js +16 -0
  101. package/dist/core/types.js.map +1 -0
  102. package/dist/core/validators/FeedValidator.js.map +1 -0
  103. package/dist/core/validators/IServerValidator.js.map +1 -0
  104. package/dist/core/validators/SSEServerValidator.js.map +1 -0
  105. package/dist/core/validators/ServerValidatorFactory.js.map +1 -0
  106. package/dist/core/validators/StdioServerValidator.js +5 -5
  107. package/dist/core/validators/StdioServerValidator.js.map +1 -0
  108. package/dist/index.js.map +1 -0
  109. package/dist/services/InstallRequestValidator.d.ts +21 -0
  110. package/dist/services/InstallRequestValidator.js +99 -0
  111. package/dist/services/InstallRequestValidator.js.map +1 -0
  112. package/dist/services/InstallationService.js.map +1 -0
  113. package/dist/services/MCPManager.js.map +1 -0
  114. package/dist/services/RequirementService.js.map +1 -0
  115. package/dist/services/ServerService.js.map +1 -0
  116. package/dist/services/TelemetryService.js.map +1 -0
  117. package/dist/utils/UpdateCheckTracker.js.map +1 -0
  118. package/dist/utils/adoUtils.js.map +1 -0
  119. package/dist/utils/clientUtils.js.map +1 -0
  120. package/dist/utils/feedUtils.js.map +1 -0
  121. package/dist/utils/githubAuth.js.map +1 -0
  122. package/dist/utils/githubUtils.js.map +1 -0
  123. package/dist/utils/logger.js.map +1 -0
  124. package/dist/utils/macroExpressionUtils.js.map +1 -0
  125. package/dist/utils/osUtils.d.ts +11 -0
  126. package/dist/utils/osUtils.js +100 -0
  127. package/dist/utils/osUtils.js.map +1 -0
  128. package/dist/utils/versionUtils.js.map +1 -0
  129. package/dist/web/contract/serverContract.js.map +1 -0
  130. package/dist/web/public/index.html +1 -1
  131. package/dist/web/public/js/modal/installHandler.js +227 -0
  132. package/dist/web/public/js/modal/loadingUI.js +74 -0
  133. package/dist/web/public/js/modal/messageQueue.js +101 -45
  134. package/dist/web/public/js/modal/modalUI.js +214 -0
  135. package/{src/web/public/js/modal/versionUtils.js → dist/web/public/js/modal/version.js} +1 -1
  136. package/dist/web/public/js/onboard/templates.js +1 -0
  137. package/dist/web/public/js/serverCategoryList.js +3 -3
  138. package/dist/web/public/onboard.html +4 -4
  139. package/dist/web/server.js.map +1 -0
  140. package/package.json +5 -1
  141. package/.github/ISSUE_TEMPLATE/JitAccess.yml +0 -28
  142. package/.github/acl/access.yml +0 -20
  143. package/.github/compliance/inventory.yml +0 -5
  144. package/.github/policies/jit.yml +0 -19
  145. package/.roo/rules-code/rules.md +0 -88
  146. package/dist/core/onboard/InstallOperationManager.d.ts +0 -23
  147. package/dist/core/onboard/InstallOperationManager.js +0 -144
  148. package/docs/ONBOARDING_PAGE_DESIGN.md +0 -260
  149. package/docs/Telemetry.md +0 -136
  150. package/memory-bank/activeContext.md +0 -26
  151. package/memory-bank/decisionLog.md +0 -91
  152. package/memory-bank/productContext.md +0 -41
  153. package/memory-bank/progress.md +0 -35
  154. package/memory-bank/systemPatterns.md +0 -10
  155. package/src/cli/commands/install.ts +0 -139
  156. package/src/cli/commands/list.ts +0 -113
  157. package/src/cli/commands/pull.ts +0 -16
  158. package/src/cli/commands/serve.ts +0 -39
  159. package/src/cli/commands/uninstall.ts +0 -64
  160. package/src/cli/index.ts +0 -82
  161. package/src/core/installers/clients/BaseClientInstaller.ts +0 -341
  162. package/src/core/installers/clients/ClientInstaller.ts +0 -222
  163. package/src/core/installers/clients/ClientInstallerFactory.ts +0 -43
  164. package/src/core/installers/clients/ClineInstaller.ts +0 -35
  165. package/src/core/installers/clients/ExtensionInstaller.ts +0 -165
  166. package/src/core/installers/clients/GithubCopilotInstaller.ts +0 -79
  167. package/src/core/installers/clients/MSRooCodeInstaller.ts +0 -32
  168. package/src/core/installers/index.ts +0 -11
  169. package/src/core/installers/requirements/BaseInstaller.ts +0 -85
  170. package/src/core/installers/requirements/GeneralInstaller.ts +0 -133
  171. package/src/core/installers/requirements/NpmInstaller.ts +0 -271
  172. package/src/core/installers/requirements/PipInstaller.ts +0 -207
  173. package/src/core/loaders/InstallOperationManager.ts +0 -367
  174. package/src/core/loaders/ServerSchemaLoader.ts +0 -117
  175. package/src/core/loaders/ServerSchemaProvider.ts +0 -99
  176. package/src/core/loaders/SystemSettingsManager.ts +0 -278
  177. package/src/core/metadatas/constants.ts +0 -122
  178. package/src/core/metadatas/recordingConstants.ts +0 -62
  179. package/src/core/metadatas/types.ts +0 -202
  180. package/src/core/onboard/FeedOnboardService.ts +0 -524
  181. package/src/core/onboard/OnboardProcessor.ts +0 -356
  182. package/src/core/onboard/OnboardStatus.ts +0 -60
  183. package/src/core/onboard/OnboardStatusManager.ts +0 -416
  184. package/src/core/validators/FeedValidator.ts +0 -135
  185. package/src/core/validators/IServerValidator.ts +0 -21
  186. package/src/core/validators/SSEServerValidator.ts +0 -43
  187. package/src/core/validators/ServerValidatorFactory.ts +0 -51
  188. package/src/core/validators/StdioServerValidator.ts +0 -312
  189. package/src/index.ts +0 -44
  190. package/src/services/InstallationService.ts +0 -102
  191. package/src/services/MCPManager.ts +0 -249
  192. package/src/services/RequirementService.ts +0 -627
  193. package/src/services/ServerService.ts +0 -161
  194. package/src/services/TelemetryService.ts +0 -59
  195. package/src/utils/UpdateCheckTracker.ts +0 -86
  196. package/src/utils/adoUtils.ts +0 -293
  197. package/src/utils/clientUtils.ts +0 -72
  198. package/src/utils/feedUtils.ts +0 -31
  199. package/src/utils/githubAuth.ts +0 -212
  200. package/src/utils/githubUtils.ts +0 -164
  201. package/src/utils/logger.ts +0 -195
  202. package/src/utils/macroExpressionUtils.ts +0 -104
  203. package/src/utils/osUtils.ts +0 -597
  204. package/src/utils/versionUtils.ts +0 -114
  205. package/src/web/contract/serverContract.ts +0 -74
  206. package/src/web/public/css/detailsWidget.css +0 -235
  207. package/src/web/public/css/modal.css +0 -757
  208. package/src/web/public/css/notifications.css +0 -101
  209. package/src/web/public/css/onboard.css +0 -107
  210. package/src/web/public/css/serverCategoryList.css +0 -120
  211. package/src/web/public/css/serverDetails.css +0 -139
  212. package/src/web/public/index.html +0 -359
  213. package/src/web/public/js/api.js +0 -132
  214. package/src/web/public/js/detailsWidget.js +0 -264
  215. package/src/web/public/js/flights/flights.js +0 -127
  216. package/src/web/public/js/modal/index.js +0 -52
  217. package/src/web/public/js/modal/installModal.js +0 -162
  218. package/src/web/public/js/modal/installation.js +0 -266
  219. package/src/web/public/js/modal/loadingModal.js +0 -182
  220. package/src/web/public/js/modal/modalSetup.js +0 -595
  221. package/src/web/public/js/modal/modalUtils.js +0 -37
  222. package/src/web/public/js/modal.js +0 -42
  223. package/src/web/public/js/notifications.js +0 -137
  224. package/src/web/public/js/onboard/formProcessor.js +0 -1037
  225. package/src/web/public/js/onboard/index.js +0 -374
  226. package/src/web/public/js/onboard/publishHandler.js +0 -172
  227. package/src/web/public/js/onboard/state.js +0 -76
  228. package/src/web/public/js/onboard/templates.js +0 -341
  229. package/src/web/public/js/onboard/uiHandlers.js +0 -1076
  230. package/src/web/public/js/onboard/validationHandlers.js +0 -493
  231. package/src/web/public/js/serverCategoryDetails.js +0 -364
  232. package/src/web/public/js/serverCategoryList.js +0 -241
  233. package/src/web/public/js/settings.js +0 -314
  234. package/src/web/public/modal.html +0 -84
  235. package/src/web/public/onboard.html +0 -296
  236. package/src/web/public/settings.html +0 -135
  237. package/src/web/public/styles.css +0 -277
  238. package/src/web/server.ts +0 -478
  239. package/tsconfig.json +0 -18
@@ -1,298 +1,236 @@
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
- }
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import { LOCAL_FEEDS_DIR, SUPPORTED_CLIENTS } from './constants.js';
4
+ import { Logger } from '../utils/logger.js';
5
+ import { readJsonFile } from '../utils/clientUtils.js';
6
+ export class ConfigurationLoader {
7
+ /**
8
+ * Updates the installed status for a server and client combination
9
+ */
10
+ static updateServerInstalledStatus(serverStatus, clientName, operationStatus) {
11
+ if (!serverStatus.installedStatus) {
12
+ serverStatus.installedStatus = {};
13
+ }
14
+ serverStatus.installedStatus[clientName] = operationStatus;
15
+ }
16
+ /**
17
+ * Removes a client's status from a server
18
+ */
19
+ static removeClientStatus(serverStatus, clientName) {
20
+ if (serverStatus.installedStatus && serverStatus.installedStatus[clientName]) {
21
+ delete serverStatus.installedStatus[clientName];
22
+ }
23
+ }
24
+ /**
25
+ * Synchronizes server categories with client MCP settings.
26
+ * Uses clientMCPSettings as source of truth for installation status.
27
+ */
28
+ static syncServerCategoriesWithClientSettings(configuration) {
29
+ if (!configuration.clientMCPSettings) {
30
+ return configuration;
31
+ }
32
+ configuration.localServerCategories = configuration.localServerCategories.map(category => {
33
+ if (!category.installationStatus?.serversStatus) {
34
+ return category;
35
+ }
36
+ const updatedServerStatus = { ...category.installationStatus.serversStatus };
37
+ const clientSettings = configuration.clientMCPSettings;
38
+ for (const [clientName, settings] of Object.entries(clientSettings)) {
39
+ const clientServers = clientName === 'GithubCopilot'
40
+ ? settings.servers || {}
41
+ : settings.mcpServers || {};
42
+ Object.keys(updatedServerStatus).forEach(serverName => {
43
+ if (clientServers[serverName]) {
44
+ if (!updatedServerStatus[serverName].installedStatus[clientName]) {
45
+ const operationStatus = {
46
+ status: 'completed',
47
+ type: 'install',
48
+ target: 'server',
49
+ message: `Server ${serverName} is configured for client ${clientName}`
50
+ };
51
+ ConfigurationLoader.updateServerInstalledStatus(updatedServerStatus[serverName], clientName, operationStatus);
52
+ }
53
+ }
54
+ else {
55
+ ConfigurationLoader.removeClientStatus(updatedServerStatus[serverName], clientName);
56
+ }
57
+ });
58
+ }
59
+ return {
60
+ ...category,
61
+ installationStatus: {
62
+ ...category.installationStatus,
63
+ serversStatus: updatedServerStatus,
64
+ lastUpdated: new Date().toISOString()
65
+ }
66
+ };
67
+ });
68
+ return configuration;
69
+ }
70
+ /**
71
+ * Initializes installation status for a feed configuration
72
+ */
73
+ static initializeInstallationStatus(feedConfig) {
74
+ const requirementsStatus = {};
75
+ const serversStatus = {};
76
+ if (feedConfig) {
77
+ if (feedConfig.requirements) {
78
+ for (const req of feedConfig.requirements) {
79
+ requirementsStatus[req.name] = {
80
+ name: req.name,
81
+ type: req.type,
82
+ installed: false,
83
+ version: req.version,
84
+ error: undefined
85
+ };
86
+ }
87
+ }
88
+ if (feedConfig.mcpServers) {
89
+ for (const mcp of feedConfig.mcpServers) {
90
+ serversStatus[mcp.name] = {
91
+ name: mcp.name,
92
+ error: undefined,
93
+ installedStatus: {}
94
+ };
95
+ }
96
+ }
97
+ }
98
+ return {
99
+ requirementsStatus,
100
+ serversStatus,
101
+ lastUpdated: new Date().toISOString()
102
+ };
103
+ }
104
+ /**
105
+ * Synchronizes server categories with feeds
106
+ */
107
+ static async syncServerCategoriesWithFeeds(configuration) {
108
+ // Filter out categories that don't have corresponding feeds and update existing ones
109
+ configuration.localServerCategories = configuration.localServerCategories
110
+ .filter(server => configuration.feeds[server.name])
111
+ .map(server => {
112
+ server.feedConfiguration = configuration.feeds[server.name];
113
+ if (!server.installationStatus ||
114
+ !server.installationStatus.requirementsStatus ||
115
+ Object.keys(server.installationStatus.requirementsStatus).length === 0 ||
116
+ !server.installationStatus.serversStatus ||
117
+ Object.keys(server.installationStatus.serversStatus).length < Object.keys(server.feedConfiguration?.mcpServers || []).length) {
118
+ server.installationStatus = ConfigurationLoader.initializeInstallationStatus(server.feedConfiguration);
119
+ }
120
+ return server;
121
+ });
122
+ // Add new categories for feeds that don't have a corresponding category
123
+ const existingServerNames = new Set(configuration.localServerCategories.map(category => category.name));
124
+ for (const [feedName, feedConfig] of Object.entries(configuration.feeds)) {
125
+ if (!existingServerNames.has(feedName)) {
126
+ const newServerCategory = {
127
+ name: feedName,
128
+ displayName: feedConfig.displayName || feedName,
129
+ type: 'local',
130
+ description: feedConfig.description || `Local MCP server category: ${feedName}`,
131
+ installationStatus: ConfigurationLoader.initializeInstallationStatus(feedConfig),
132
+ feedConfiguration: feedConfig
133
+ };
134
+ configuration.localServerCategories.push(newServerCategory);
135
+ console.log(`Created new local server entry for feed: ${feedName}`);
136
+ }
137
+ }
138
+ return configuration;
139
+ }
140
+ /**
141
+ * Loads feed configurations into the MCP configuration
142
+ */
143
+ static async loadFeedsIntoConfiguration(configuration, feedFile) {
144
+ try {
145
+ await fs.mkdir(LOCAL_FEEDS_DIR, { recursive: true });
146
+ const feeds = {};
147
+ // Load provided feed file if specified
148
+ if (feedFile) {
149
+ try {
150
+ const content = await fs.readFile(feedFile, 'utf8');
151
+ const config = JSON.parse(content);
152
+ if (config && config.name) {
153
+ feeds[config.name] = config;
154
+ console.log(`Loaded feed configuration from provided file: ${feedFile}`);
155
+ }
156
+ }
157
+ catch (error) {
158
+ console.log(`Error loading feed configuration from provided file ${feedFile}:`, error);
159
+ }
160
+ }
161
+ // Load feeds from LOCAL_FEEDS_DIR
162
+ const files = await fs.readdir(LOCAL_FEEDS_DIR);
163
+ const jsonFiles = files.filter(file => file.endsWith('.json'));
164
+ if (jsonFiles.length === 0 && !feedFile) {
165
+ console.log(`No feed configuration files found in ${LOCAL_FEEDS_DIR}`);
166
+ return configuration;
167
+ }
168
+ for (const file of jsonFiles) {
169
+ try {
170
+ const filePath = path.join(LOCAL_FEEDS_DIR, file);
171
+ const content = await fs.readFile(filePath, 'utf8');
172
+ const config = JSON.parse(content);
173
+ if (config && config.name) {
174
+ // If feed exists from provided file, skip the local one
175
+ if (!feeds[config.name]) {
176
+ feeds[config.name] = config;
177
+ }
178
+ else {
179
+ console.log(`Skipping local feed ${config.name} as it was provided via --feed-file`);
180
+ }
181
+ }
182
+ }
183
+ catch (error) {
184
+ console.warn(`Error loading feed configuration from ${file}:`, error);
185
+ }
186
+ }
187
+ configuration.feeds = feeds;
188
+ return await ConfigurationLoader.syncServerCategoriesWithFeeds(configuration);
189
+ }
190
+ catch (error) {
191
+ console.error("Error loading feed configurations:", error);
192
+ throw error;
193
+ }
194
+ }
195
+ /**
196
+ * Loads MCP client settings into the configuration
197
+ */
198
+ static async loadClientMCPSettings(configuration) {
199
+ try {
200
+ Logger.debug('Starting to load MCP client settings...');
201
+ const settings = {};
202
+ for (const [clientName, clientSettings] of Object.entries(SUPPORTED_CLIENTS)) {
203
+ const settingPath = process.env.CODE_INSIDERS
204
+ ? clientSettings.codeInsiderSettingPath
205
+ : clientSettings.codeSettingPath;
206
+ try {
207
+ let content = await readJsonFile(settingPath, true);
208
+ if (clientName === 'GithubCopilot') {
209
+ if (!content.mcp) {
210
+ content = {
211
+ servers: {},
212
+ inputs: []
213
+ };
214
+ }
215
+ else {
216
+ content = content.mcp;
217
+ }
218
+ }
219
+ settings[clientName] = content;
220
+ Logger.debug(`Successfully loaded MCP settings for ${clientName}`);
221
+ }
222
+ catch (error) {
223
+ Logger.debug(`Warning: Could not load MCP settings for client ${clientName}: ${error instanceof Error ? error.message : String(error)}`);
224
+ settings[clientName] = {};
225
+ }
226
+ }
227
+ configuration.clientMCPSettings = settings;
228
+ return ConfigurationLoader.syncServerCategoriesWithClientSettings(configuration);
229
+ }
230
+ catch (error) {
231
+ Logger.error('Error loading client MCP settings:', error);
232
+ throw error;
233
+ }
234
+ }
235
+ }
236
+ //# sourceMappingURL=ConfigurationLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationLoader.js","sourceRoot":"","sources":["../../src/core/ConfigurationLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAA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 import { MCPServerCategory, FeedConfiguration, InstallationStatus, RequirementStatus, MCPServerStatus, OperationStatus, McpConfig } from './types.js';
2
+ export declare class ConfigurationProvider {
3
+ private static instance;
4
+ private configPath;
5
+ private configuration;
6
+ private configLock;
7
+ private tempDir;
8
+ private constructor();
9
+ static getInstance(): ConfigurationProvider;
10
+ private withLock;
11
+ initialize(feedFile?: string): Promise<void>;
12
+ private saveConfiguration;
13
+ getServerCategories(): Promise<MCPServerCategory[]>;
14
+ getServerCategory(categoryName: string): Promise<MCPServerCategory | undefined>;
15
+ getClientMcpSettings(): Promise<Record<string, Record<string, any>> | undefined>;
16
+ getFeedConfiguration(categoryName: string): Promise<FeedConfiguration | undefined>;
17
+ getServerMcpConfig(categoryName: string, serverName: string): Promise<McpConfig | undefined>;
18
+ getInstallationStatus(categoryName: string): Promise<InstallationStatus | undefined>;
19
+ getServerStatus(categoryName: string, serverName: string): Promise<MCPServerStatus | undefined>;
20
+ getRequirementStatus(categoryName: string, requirementName: string): Promise<RequirementStatus | undefined>;
21
+ updateInstallationStatus(categoryName: string, requirementStatus: Record<string, RequirementStatus>, serverStatus: Record<string, MCPServerStatus>): Promise<boolean>;
22
+ updateRequirementStatus(categoryName: string, requirementName: string, status: RequirementStatus): Promise<boolean>;
23
+ updateRequirementOperationStatus(categoryName: string, requirementName: string, operationStatus: OperationStatus): Promise<boolean>;
24
+ updateServerStatus(categoryName: string, serverName: string, status: MCPServerStatus): Promise<boolean>;
25
+ updateServerOperationStatus(categoryName: string, serverName: string, clientName: string, operationStatus: OperationStatus): Promise<boolean>;
26
+ isRequirementsReady(categoryName: string, serverName: string): Promise<boolean>;
27
+ GetServerRequirementStatus(categoryName: string, serverName: string): Promise<RequirementStatus[]>;
28
+ isServerReady(categoryName: string, serverName: string, clients: string[]): Promise<boolean>;
29
+ syncFeeds(): Promise<void>;
30
+ private loadFeedsIntoConfiguration;
31
+ private loadClientMCPSettings;
32
+ reloadClientMCPSettings(): Promise<void>;
33
+ removeServerFromClientMCPSettings(serverName: string, target?: string): Promise<void>;
34
+ }
35
+ export declare const configProvider: ConfigurationProvider;