imcp 0.0.17 → 0.0.19

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 (47) hide show
  1. package/dist/cli/commands/serve.js +2 -1
  2. package/dist/core/installers/clients/BaseClientInstaller.d.ts +25 -2
  3. package/dist/core/installers/clients/BaseClientInstaller.js +121 -0
  4. package/dist/core/installers/clients/ClineInstaller.d.ts +1 -6
  5. package/dist/core/installers/clients/ClineInstaller.js +1 -94
  6. package/dist/core/installers/clients/GithubCopilotInstaller.d.ts +1 -6
  7. package/dist/core/installers/clients/GithubCopilotInstaller.js +1 -94
  8. package/dist/core/installers/clients/MSRooCodeInstaller.d.ts +1 -5
  9. package/dist/core/installers/clients/MSRooCodeInstaller.js +1 -94
  10. package/dist/core/loaders/ConfigurationLoader.d.ts +4 -1
  11. package/dist/core/loaders/ConfigurationLoader.js +24 -3
  12. package/dist/core/loaders/ConfigurationProvider.d.ts +4 -1
  13. package/dist/core/loaders/ConfigurationProvider.js +13 -4
  14. package/dist/core/loaders/ServerSchemaLoader.d.ts +15 -4
  15. package/dist/core/loaders/ServerSchemaLoader.js +86 -20
  16. package/dist/core/loaders/ServerSchemaProvider.d.ts +2 -5
  17. package/dist/core/loaders/ServerSchemaProvider.js +32 -62
  18. package/dist/core/metadatas/types.d.ts +3 -2
  19. package/dist/core/onboard/FeedOnboardService.d.ts +14 -7
  20. package/dist/core/onboard/FeedOnboardService.js +214 -129
  21. package/dist/core/onboard/OnboardProcessor.d.ts +7 -1
  22. package/dist/core/onboard/OnboardProcessor.js +52 -8
  23. package/dist/core/onboard/OnboardStatus.d.ts +6 -1
  24. package/dist/core/onboard/OnboardStatusManager.d.ts +70 -24
  25. package/dist/core/onboard/OnboardStatusManager.js +230 -46
  26. package/dist/core/validators/FeedValidator.d.ts +7 -2
  27. package/dist/core/validators/FeedValidator.js +61 -7
  28. package/dist/core/validators/StdioServerValidator.js +84 -32
  29. package/dist/services/MCPManager.d.ts +2 -1
  30. package/dist/services/MCPManager.js +5 -1
  31. package/dist/services/ServerService.js +2 -2
  32. package/dist/utils/logger.d.ts +2 -0
  33. package/dist/utils/logger.js +10 -0
  34. package/dist/web/public/js/modal/installation.js +1 -1
  35. package/dist/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +41 -9
  36. package/dist/web/public/js/onboard/formProcessor.js +200 -34
  37. package/dist/web/public/js/onboard/index.js +2 -2
  38. package/dist/web/public/js/onboard/publishHandler.js +30 -22
  39. package/dist/web/public/js/onboard/templates.js +34 -40
  40. package/dist/web/public/js/onboard/uiHandlers.js +175 -84
  41. package/dist/web/public/js/onboard/validationHandlers.js +147 -64
  42. package/dist/web/public/js/serverCategoryDetails.js +19 -4
  43. package/dist/web/public/js/serverCategoryList.js +13 -1
  44. package/dist/web/public/onboard.html +1 -1
  45. package/dist/web/server.js +19 -6
  46. package/package.json +1 -1
  47. package/src/core/onboard/OnboardProcessor.ts +25 -23
@@ -6,12 +6,13 @@ export function createServeCommand() {
6
6
  .description('Serve local web interface')
7
7
  .option('-p, --port <port>', 'Port to run the server on', '3000')
8
8
  .option('-f, --feed-file <filepath>', 'Path to a custom feed configuration file')
9
+ .option('-s, --schemas-directory <path>', 'Path to a directory containing adhoc schema files')
9
10
  .action(async (options) => {
10
11
  try {
11
12
  // Sync feeds before start the local UI
12
13
  await mcpManager.syncFeeds();
13
14
  // Ensure MCP manager is initialized before starting the web server
14
- await mcpManager.initialize(options.feedFile);
15
+ await mcpManager.initialize(options.feedFile, options.schemasDirectory);
15
16
  const port = parseInt(options.port, 10);
16
17
  if (isNaN(port) || port < 1 || port > 65535) {
17
18
  throw new Error('Invalid port number');
@@ -3,6 +3,7 @@ import { OperationStatus, McpConfig, ServerInstallOptions } from '../../metadata
3
3
  * Base class for client installers with shared functionality
4
4
  */
5
5
  export declare abstract class BaseClientInstaller {
6
+ protected abstract readonly clientName: string;
6
7
  /**
7
8
  * Generate a unique operation ID for tracking installations
8
9
  */
@@ -44,8 +45,30 @@ export declare abstract class BaseClientInstaller {
44
45
  */
45
46
  private getNpmPath;
46
47
  /**
47
- * Abstract methods that must be implemented by client-specific installers
48
+ * Checks if VS Code or VS Code Insiders is installed and installs the client extension.
49
+ * @param operationId The operation ID for tracking.
50
+ * @returns An OperationStatus object if checks fail or installation fails, otherwise undefined.
51
+ */
52
+ protected checkVSCodeAndInstallExtension(operationId: string): Promise<OperationStatus | undefined>;
53
+ /**
54
+ * Update VS Code settings for both VS Code and VS Code Insiders if installed
55
+ * @param serverName The name of the server to configure
56
+ * @param installConfig The installation configuration
57
+ * @returns Array of results indicating success/failure for each VS Code variant
58
+ */
59
+ protected updateVSCodeSettings(serverName: string, installConfig: any): Promise<Array<{
60
+ success: boolean;
61
+ path: string;
62
+ error?: string;
63
+ }>>;
64
+ /**
65
+ * Install the client
66
+ * @param serverConfig Server configuration
67
+ * @param options Installation options including environment variables and arguments
68
+ */
69
+ install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
70
+ /**
71
+ * Abstract method that must be implemented by client-specific installers
48
72
  */
49
- abstract install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
50
73
  abstract setupClientSettings(settingPath: string, serverName: string, installConfig: any): Promise<void>;
51
74
  }
@@ -1,6 +1,9 @@
1
1
  import { Logger } from '../../../utils/logger.js';
2
2
  import { exec } from 'child_process';
3
3
  import { promisify } from 'util';
4
+ import { isCommandAvailable } from '../../../utils/osUtils.js';
5
+ import { ExtensionInstaller } from './ExtensionInstaller.js';
6
+ import { SUPPORTED_CLIENTS } from '../../metadatas/constants.js';
4
7
  import { MACRO_EXPRESSIONS, MacroResolverFunctions } from '../../../utils/macroExpressionUtils.js';
5
8
  const execAsync = promisify(exec);
6
9
  /**
@@ -156,5 +159,123 @@ export class BaseClientInstaller {
156
159
  return 'C:\\Program Files\\nodejs';
157
160
  }
158
161
  }
162
+ /**
163
+ * Checks if VS Code or VS Code Insiders is installed and installs the client extension.
164
+ * @param operationId The operation ID for tracking.
165
+ * @returns An OperationStatus object if checks fail or installation fails, otherwise undefined.
166
+ */
167
+ async checkVSCodeAndInstallExtension(operationId) {
168
+ // Check if VS Code or VS Code Insiders is installed
169
+ const isVSCodeInstalled = await isCommandAvailable('code');
170
+ const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
171
+ if (!isVSCodeInstalled && !isVSCodeInsidersInstalled) {
172
+ return {
173
+ status: 'failed',
174
+ type: 'install',
175
+ target: 'server',
176
+ message: 'Failed to install as neither VS Code nor VS Code Insiders are installed on this system. Please run `code` or `code-insiders` to make sure they are installed. Relaunch imcp after installation.',
177
+ operationId
178
+ };
179
+ }
180
+ // Install extension
181
+ const extensionResult = await ExtensionInstaller.installExtension(this.clientName);
182
+ if (!extensionResult) {
183
+ Logger.debug(`Failed to install ${this.clientName} extension`);
184
+ return {
185
+ status: 'failed',
186
+ type: 'install',
187
+ target: 'server',
188
+ message: `Failed to install ${this.clientName} extension`,
189
+ operationId
190
+ };
191
+ }
192
+ return undefined;
193
+ }
194
+ /**
195
+ * Update VS Code settings for both VS Code and VS Code Insiders if installed
196
+ * @param serverName The name of the server to configure
197
+ * @param installConfig The installation configuration
198
+ * @returns Array of results indicating success/failure for each VS Code variant
199
+ */
200
+ async updateVSCodeSettings(serverName, installConfig) {
201
+ const results = [];
202
+ const isVSCodeInstalled = await isCommandAvailable('code');
203
+ const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
204
+ // Update settings for VS Code if installed
205
+ if (isVSCodeInstalled) {
206
+ try {
207
+ const settingPath = SUPPORTED_CLIENTS[this.clientName].codeSettingPath;
208
+ await this.setupClientSettings(settingPath, serverName, installConfig);
209
+ results.push({ success: true, path: settingPath });
210
+ }
211
+ catch (error) {
212
+ results.push({
213
+ success: false,
214
+ path: SUPPORTED_CLIENTS[this.clientName].codeSettingPath,
215
+ error: error instanceof Error ? error.message : String(error)
216
+ });
217
+ }
218
+ }
219
+ // Update settings for VS Code Insiders if installed
220
+ if (isVSCodeInsidersInstalled) {
221
+ try {
222
+ const settingPath = SUPPORTED_CLIENTS[this.clientName].codeInsiderSettingPath;
223
+ await this.setupClientSettings(settingPath, serverName, installConfig);
224
+ results.push({ success: true, path: settingPath });
225
+ }
226
+ catch (error) {
227
+ results.push({
228
+ success: false,
229
+ path: SUPPORTED_CLIENTS[this.clientName].codeInsiderSettingPath,
230
+ error: error instanceof Error ? error.message : String(error)
231
+ });
232
+ }
233
+ }
234
+ return results;
235
+ }
236
+ /**
237
+ * Install the client
238
+ * @param serverConfig Server configuration
239
+ * @param options Installation options including environment variables and arguments
240
+ */
241
+ async install(serverConfig, options) {
242
+ const operationId = this.generateOperationId();
243
+ try {
244
+ const vsCodeCheckResult = await this.checkVSCodeAndInstallExtension(operationId);
245
+ if (vsCodeCheckResult) {
246
+ return vsCodeCheckResult;
247
+ }
248
+ const installConfig = await this.setupInstallConfig(serverConfig, options);
249
+ if (serverConfig.mode) {
250
+ installConfig.mode = serverConfig.mode;
251
+ }
252
+ // Update VS Code settings
253
+ const results = await this.updateVSCodeSettings(serverConfig.name, installConfig);
254
+ // Determine overall success
255
+ const anySuccess = results.some(r => r.success);
256
+ const successPaths = results.filter(r => r.success).map(r => r.path);
257
+ const errors = results.filter(r => !r.success).map(r => r.error);
258
+ return {
259
+ status: anySuccess ? 'completed' : 'failed',
260
+ type: 'install',
261
+ target: 'server',
262
+ message: anySuccess
263
+ ? `Successfully installed ${this.clientName} client. Updated settings in: ${successPaths.join(', ')}`
264
+ : `Failed to install ${this.clientName} client. Errors: ${errors.join('; ')}`,
265
+ operationId,
266
+ error: anySuccess ? undefined : errors.join('; ')
267
+ };
268
+ }
269
+ catch (error) {
270
+ return {
271
+ status: 'failed',
272
+ type: 'install',
273
+ target: 'server',
274
+ message: `Unexpected error installing ${this.clientName} client: ${error instanceof Error ? error.message : String(error)}`,
275
+ operationId,
276
+ error: error instanceof Error ? error.message : String(error)
277
+ };
278
+ }
279
+ }
159
280
  }
160
281
  //# sourceMappingURL=BaseClientInstaller.js.map
@@ -1,15 +1,10 @@
1
1
  import { BaseClientInstaller } from './BaseClientInstaller.js';
2
- import { ServerInstallOptions, OperationStatus, McpConfig } from '../../metadatas/types.js';
3
2
  /**
4
3
  * Cline client installer implementation
5
4
  * Handles installation of Cline client including extension installation and settings configuration
6
5
  */
7
6
  export declare class ClineInstaller extends BaseClientInstaller {
8
- /**
9
- * Install Cline client
10
- * @param options Installation options including environment variables and arguments
11
- */
12
- install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
7
+ protected readonly clientName: string;
13
8
  /**
14
9
  * Set up Cline client settings
15
10
  * Updates VS Code settings with MCP server configuration
@@ -1,104 +1,11 @@
1
1
  import { BaseClientInstaller } from './BaseClientInstaller.js';
2
- import { Logger } from '../../../utils/logger.js';
3
2
  import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
4
- import { ExtensionInstaller } from './ExtensionInstaller.js';
5
- import { SUPPORTED_CLIENTS } from '../../metadatas/constants.js';
6
- import { isCommandAvailable } from '../../../utils/osUtils.js';
7
3
  /**
8
4
  * Cline client installer implementation
9
5
  * Handles installation of Cline client including extension installation and settings configuration
10
6
  */
11
7
  export class ClineInstaller extends BaseClientInstaller {
12
- /**
13
- * Install Cline client
14
- * @param options Installation options including environment variables and arguments
15
- */
16
- async install(serverConfig, options) {
17
- const operationId = this.generateOperationId();
18
- try {
19
- // Check if VS Code or VS Code Insiders is installed
20
- const isVSCodeInstalled = await isCommandAvailable('code');
21
- const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
22
- if (!isVSCodeInstalled && !isVSCodeInsidersInstalled) {
23
- return {
24
- status: 'failed',
25
- type: 'install',
26
- target: 'server',
27
- message: 'Neither VS Code nor VS Code Insiders are installed on this system',
28
- operationId
29
- };
30
- }
31
- // Install extension
32
- const extensionResult = await ExtensionInstaller.installExtension('Cline');
33
- if (!extensionResult) {
34
- Logger.debug('Failed to install Cline extension');
35
- return {
36
- status: 'failed',
37
- type: 'install',
38
- target: 'server',
39
- message: 'Failed to install Cline extension',
40
- operationId
41
- };
42
- }
43
- const installConfig = await this.setupInstallConfig(serverConfig, options);
44
- // Track success for both VS Code variants
45
- const results = [];
46
- // Update settings for VS Code if installed
47
- if (isVSCodeInstalled) {
48
- try {
49
- const settingPath = SUPPORTED_CLIENTS['Cline'].codeSettingPath;
50
- await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
51
- results.push({ success: true, path: settingPath });
52
- }
53
- catch (error) {
54
- results.push({
55
- success: false,
56
- path: SUPPORTED_CLIENTS['Cline'].codeSettingPath,
57
- error: error instanceof Error ? error.message : String(error)
58
- });
59
- }
60
- }
61
- // Update settings for VS Code Insiders if installed
62
- if (isVSCodeInsidersInstalled) {
63
- try {
64
- const settingPath = SUPPORTED_CLIENTS['Cline'].codeInsiderSettingPath;
65
- await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
66
- results.push({ success: true, path: settingPath });
67
- }
68
- catch (error) {
69
- results.push({
70
- success: false,
71
- path: SUPPORTED_CLIENTS['Cline'].codeInsiderSettingPath,
72
- error: error instanceof Error ? error.message : String(error)
73
- });
74
- }
75
- }
76
- // Determine overall success
77
- const anySuccess = results.some(r => r.success);
78
- const successPaths = results.filter(r => r.success).map(r => r.path);
79
- const errors = results.filter(r => !r.success).map(r => r.error);
80
- return {
81
- status: anySuccess ? 'completed' : 'failed',
82
- type: 'install',
83
- target: 'server',
84
- message: anySuccess
85
- ? `Successfully installed Cline client. Updated settings in: ${successPaths.join(', ')}`
86
- : `Failed to install Cline client. Errors: ${errors.join('; ')}`,
87
- operationId,
88
- error: anySuccess ? undefined : errors.join('; ')
89
- };
90
- }
91
- catch (error) {
92
- return {
93
- status: 'failed',
94
- type: 'install',
95
- target: 'server',
96
- message: `Unexpected error installing Cline client: ${error instanceof Error ? error.message : String(error)}`,
97
- operationId,
98
- error: error instanceof Error ? error.message : String(error)
99
- };
100
- }
101
- }
8
+ clientName = 'Cline';
102
9
  /**
103
10
  * Set up Cline client settings
104
11
  * Updates VS Code settings with MCP server configuration
@@ -1,15 +1,10 @@
1
1
  import { BaseClientInstaller } from './BaseClientInstaller.js';
2
- import { ServerInstallOptions, OperationStatus, McpConfig } from '../../metadatas/types.js';
3
2
  /**
4
3
  * Github Copilot client installer implementation
5
4
  * Handles installation of Github Copilot client including extension installation and settings configuration
6
5
  */
7
6
  export declare class GithubCopilotInstaller extends BaseClientInstaller {
8
- /**
9
- * Install Github Copilot client
10
- * @param options Installation options including environment variables and arguments
11
- */
12
- install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
7
+ protected readonly clientName: string;
13
8
  /**
14
9
  * Initialize settings with GithubCopilot-specific structure
15
10
  * Overrides base method to provide custom initialization
@@ -1,104 +1,11 @@
1
1
  import { BaseClientInstaller } from './BaseClientInstaller.js';
2
- import { Logger } from '../../../utils/logger.js';
3
2
  import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
4
- import { ExtensionInstaller } from './ExtensionInstaller.js';
5
- import { SUPPORTED_CLIENTS } from '../../metadatas/constants.js';
6
- import { isCommandAvailable } from '../../../utils/osUtils.js';
7
3
  /**
8
4
  * Github Copilot client installer implementation
9
5
  * Handles installation of Github Copilot client including extension installation and settings configuration
10
6
  */
11
7
  export class GithubCopilotInstaller extends BaseClientInstaller {
12
- /**
13
- * Install Github Copilot client
14
- * @param options Installation options including environment variables and arguments
15
- */
16
- async install(serverConfig, options) {
17
- const operationId = this.generateOperationId();
18
- try {
19
- // Check if VS Code or VS Code Insiders is installed
20
- const isVSCodeInstalled = await isCommandAvailable('code');
21
- const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
22
- if (!isVSCodeInstalled && !isVSCodeInsidersInstalled) {
23
- return {
24
- status: 'failed',
25
- type: 'install',
26
- target: 'server',
27
- message: 'Neither VS Code nor VS Code Insiders are installed on this system',
28
- operationId
29
- };
30
- }
31
- // Install extension
32
- const extensionResult = await ExtensionInstaller.installExtension('GithubCopilot');
33
- if (!extensionResult) {
34
- Logger.debug('Failed to install Github Copilot extension');
35
- return {
36
- status: 'failed',
37
- type: 'install',
38
- target: 'server',
39
- message: 'Failed to install Github Copilot extension',
40
- operationId
41
- };
42
- }
43
- const installConfig = await this.setupInstallConfig(serverConfig, options);
44
- // Track success for both VS Code variants
45
- const results = [];
46
- // Update settings for VS Code if installed
47
- if (isVSCodeInstalled) {
48
- try {
49
- const settingPath = SUPPORTED_CLIENTS['GithubCopilot'].codeSettingPath;
50
- await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
51
- results.push({ success: true, path: settingPath });
52
- }
53
- catch (error) {
54
- results.push({
55
- success: false,
56
- path: SUPPORTED_CLIENTS['GithubCopilot'].codeSettingPath,
57
- error: error instanceof Error ? error.message : String(error)
58
- });
59
- }
60
- }
61
- // Update settings for VS Code Insiders if installed
62
- if (isVSCodeInsidersInstalled) {
63
- try {
64
- const settingPath = SUPPORTED_CLIENTS['GithubCopilot'].codeInsiderSettingPath;
65
- await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
66
- results.push({ success: true, path: settingPath });
67
- }
68
- catch (error) {
69
- results.push({
70
- success: false,
71
- path: SUPPORTED_CLIENTS['GithubCopilot'].codeInsiderSettingPath,
72
- error: error instanceof Error ? error.message : String(error)
73
- });
74
- }
75
- }
76
- // Determine overall success
77
- const anySuccess = results.some(r => r.success);
78
- const successPaths = results.filter(r => r.success).map(r => r.path);
79
- const errors = results.filter(r => !r.success).map(r => r.error);
80
- return {
81
- status: anySuccess ? 'completed' : 'failed',
82
- type: 'install',
83
- target: 'server',
84
- message: anySuccess
85
- ? `Successfully installed Github Copilot client. Updated settings in: ${successPaths.join(', ')}`
86
- : `Failed to install Github Copilot client. Errors: ${errors.join('; ')}`,
87
- operationId,
88
- error: anySuccess ? undefined : errors.join('; ')
89
- };
90
- }
91
- catch (error) {
92
- return {
93
- status: 'failed',
94
- type: 'install',
95
- target: 'server',
96
- message: `Unexpected error installing Github Copilot client: ${error instanceof Error ? error.message : String(error)}`,
97
- operationId,
98
- error: error instanceof Error ? error.message : String(error)
99
- };
100
- }
101
- }
8
+ clientName = 'GithubCopilot';
102
9
  /**
103
10
  * Initialize settings with GithubCopilot-specific structure
104
11
  * Overrides base method to provide custom initialization
@@ -1,13 +1,9 @@
1
1
  import { BaseClientInstaller } from './BaseClientInstaller.js';
2
- import { ServerInstallOptions, OperationStatus, McpConfig } from '../../metadatas/types.js';
3
2
  /**
4
3
  * MSRooCode client installer implementation
5
4
  */
6
5
  export declare class MSRooCodeInstaller extends BaseClientInstaller {
7
- /**
8
- * Install MSRooCode client
9
- */
10
- install(serverConfig: McpConfig, options: ServerInstallOptions): Promise<OperationStatus>;
6
+ protected readonly clientName: string;
11
7
  /**
12
8
  * Set up MSRooCode client settings
13
9
  */
@@ -1,103 +1,10 @@
1
1
  import { BaseClientInstaller } from './BaseClientInstaller.js';
2
- import { Logger } from '../../../utils/logger.js';
3
2
  import { readJsonFile, writeJsonFile } from '../../../utils/clientUtils.js';
4
- import { ExtensionInstaller } from './ExtensionInstaller.js';
5
- import { SUPPORTED_CLIENTS } from '../../metadatas/constants.js';
6
- import { isCommandAvailable } from '../../../utils/osUtils.js';
7
3
  /**
8
4
  * MSRooCode client installer implementation
9
5
  */
10
6
  export class MSRooCodeInstaller extends BaseClientInstaller {
11
- /**
12
- * Install MSRooCode client
13
- */
14
- async install(serverConfig, options) {
15
- const operationId = this.generateOperationId();
16
- try {
17
- // Check if VS Code or VS Code Insiders is installed
18
- const isVSCodeInstalled = await isCommandAvailable('code');
19
- const isVSCodeInsidersInstalled = await isCommandAvailable('code-insiders');
20
- if (!isVSCodeInstalled && !isVSCodeInsidersInstalled) {
21
- return {
22
- status: 'failed',
23
- type: 'install',
24
- target: 'server',
25
- message: 'Neither VS Code nor VS Code Insiders are installed on this system',
26
- operationId
27
- };
28
- }
29
- // Install extension
30
- const extensionResult = await ExtensionInstaller.installExtension('MSRooCode');
31
- if (!extensionResult) {
32
- Logger.debug('Failed to install MSRooCode extension');
33
- return {
34
- status: 'failed',
35
- type: 'install',
36
- target: 'server',
37
- message: 'Failed to install MSRooCode extension',
38
- operationId
39
- };
40
- }
41
- const installConfig = await this.setupInstallConfig(serverConfig, options);
42
- installConfig.mode = serverConfig.mode;
43
- // Track success for both VS Code variants
44
- const results = [];
45
- // Update settings for VS Code if installed
46
- if (isVSCodeInstalled) {
47
- try {
48
- const settingPath = SUPPORTED_CLIENTS['MSRooCode'].codeSettingPath;
49
- await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
50
- results.push({ success: true, path: settingPath });
51
- }
52
- catch (error) {
53
- results.push({
54
- success: false,
55
- path: SUPPORTED_CLIENTS['MSRooCode'].codeSettingPath,
56
- error: error instanceof Error ? error.message : String(error)
57
- });
58
- }
59
- }
60
- // Update settings for VS Code Insiders if installed
61
- if (isVSCodeInsidersInstalled) {
62
- try {
63
- const settingPath = SUPPORTED_CLIENTS['MSRooCode'].codeInsiderSettingPath;
64
- await this.setupClientSettings(settingPath, serverConfig.name, installConfig);
65
- results.push({ success: true, path: settingPath });
66
- }
67
- catch (error) {
68
- results.push({
69
- success: false,
70
- path: SUPPORTED_CLIENTS['MSRooCode'].codeInsiderSettingPath,
71
- error: error instanceof Error ? error.message : String(error)
72
- });
73
- }
74
- }
75
- // Determine overall success
76
- const anySuccess = results.some(r => r.success);
77
- const successPaths = results.filter(r => r.success).map(r => r.path);
78
- const errors = results.filter(r => !r.success).map(r => r.error);
79
- return {
80
- status: anySuccess ? 'completed' : 'failed',
81
- type: 'install',
82
- target: 'server',
83
- message: anySuccess
84
- ? `Successfully installed MSRooCode client. Updated settings in: ${successPaths.join(', ')}`
85
- : `Failed to install MSRooCode client. Errors: ${errors.join('; ')}`,
86
- operationId,
87
- error: anySuccess ? undefined : errors.join('; ')
88
- };
89
- }
90
- catch (error) {
91
- return {
92
- status: 'failed',
93
- type: 'install',
94
- target: 'server',
95
- message: `Unexpected error installing MSRooCode client: ${error instanceof Error ? error.message : String(error)}`,
96
- operationId,
97
- error: error instanceof Error ? error.message : String(error)
98
- };
99
- }
100
- }
7
+ clientName = 'MSRooCode';
101
8
  /**
102
9
  * Set up MSRooCode client settings
103
10
  */
@@ -24,7 +24,10 @@ export declare class ConfigurationLoader {
24
24
  /**
25
25
  * Loads feed configurations into the MCP configuration
26
26
  */
27
- static loadFeedsIntoConfiguration(configuration: MCPConfiguration, feedFile?: string): Promise<MCPConfiguration>;
27
+ static loadFeedsIntoConfiguration(configuration: MCPConfiguration, feedFile?: string, settings?: {
28
+ prLink?: string;
29
+ adhocServers?: string[];
30
+ }): Promise<MCPConfiguration>;
28
31
  /**
29
32
  * Loads MCP client settings into the configuration
30
33
  */
@@ -140,7 +140,7 @@ export class ConfigurationLoader {
140
140
  /**
141
141
  * Loads feed configurations into the MCP configuration
142
142
  */
143
- static async loadFeedsIntoConfiguration(configuration, feedFile) {
143
+ static async loadFeedsIntoConfiguration(configuration, feedFile, settings) {
144
144
  try {
145
145
  await fs.mkdir(LOCAL_FEEDS_DIR, { recursive: true });
146
146
  const feeds = {};
@@ -148,10 +148,31 @@ export class ConfigurationLoader {
148
148
  if (feedFile) {
149
149
  try {
150
150
  const content = await fs.readFile(feedFile, 'utf8');
151
- const config = JSON.parse(content);
151
+ let config = JSON.parse(content);
152
152
  if (config && config.name) {
153
+ // Update systemTags if feedFile is provided
154
+ if (!config.systemTags) {
155
+ config.systemTags = {};
156
+ }
157
+ config.systemTags['adhoc'] = 'true';
158
+ // Update PullRequest if prLink is provided in settings
159
+ if (settings?.prLink) {
160
+ config.PullRequest = settings.prLink;
161
+ }
162
+ // Update mcpServers systemTags if adhocServers are provided in settings
163
+ if (settings?.adhocServers && settings.adhocServers.length > 0 && config.mcpServers) {
164
+ config.mcpServers = config.mcpServers.map(server => {
165
+ if (settings.adhocServers.includes(server.name)) {
166
+ if (!server.systemTags) {
167
+ server.systemTags = {};
168
+ }
169
+ server.systemTags['adhoc'] = 'true';
170
+ }
171
+ return server;
172
+ });
173
+ }
153
174
  feeds[config.name] = config;
154
- console.log(`Loaded feed configuration from provided file: ${feedFile}`);
175
+ console.log(`Loaded and processed feed configuration from provided file: ${feedFile}`);
155
176
  }
156
177
  }
157
178
  catch (error) {
@@ -8,7 +8,10 @@ export declare class ConfigurationProvider {
8
8
  private constructor();
9
9
  static getInstance(): ConfigurationProvider;
10
10
  private withLock;
11
- initialize(feedFile?: string): Promise<void>;
11
+ initialize(feedFile?: string, settings?: {
12
+ prLink?: string;
13
+ adhocServers?: string[];
14
+ }): Promise<void>;
12
15
  private saveConfiguration;
13
16
  getServerCategories(): Promise<MCPServerCategory[]>;
14
17
  getServerCategory(categoryName: string): Promise<MCPServerCategory | undefined>;