imcp 0.0.16 → 0.0.17

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 (135) hide show
  1. package/dist/cli/commands/install.js +2 -2
  2. package/dist/cli/commands/list.js +2 -2
  3. package/dist/cli/commands/serve.js +1 -1
  4. package/dist/core/RequirementService.d.ts +0 -12
  5. package/dist/core/RequirementService.js +0 -24
  6. package/dist/core/installers/clients/BaseClientInstaller.d.ts +1 -1
  7. package/dist/core/installers/clients/ClientInstaller.d.ts +1 -1
  8. package/dist/core/installers/clients/ClientInstaller.js +1 -1
  9. package/dist/core/installers/clients/ClientInstallerFactory.js +1 -1
  10. package/dist/core/installers/clients/ClineInstaller.d.ts +1 -1
  11. package/dist/core/installers/clients/ClineInstaller.js +1 -1
  12. package/dist/core/installers/clients/ExtensionInstaller.js +1 -1
  13. package/dist/core/installers/clients/GithubCopilotInstaller.d.ts +1 -1
  14. package/dist/core/installers/clients/GithubCopilotInstaller.js +1 -1
  15. package/dist/core/installers/clients/MSRooCodeInstaller.d.ts +1 -1
  16. package/dist/core/installers/clients/MSRooCodeInstaller.js +1 -1
  17. package/dist/core/installers/requirements/BaseInstaller.d.ts +1 -1
  18. package/dist/core/installers/requirements/BaseInstaller.js +1 -1
  19. package/dist/core/installers/requirements/CommandInstaller.d.ts +1 -1
  20. package/dist/core/installers/requirements/CommandInstaller.js +1 -1
  21. package/dist/core/installers/requirements/GeneralInstaller.d.ts +1 -1
  22. package/dist/core/installers/requirements/InstallerFactory.d.ts +1 -1
  23. package/dist/core/installers/requirements/NpmInstaller.d.ts +1 -1
  24. package/dist/core/installers/requirements/NpmInstaller.js +1 -1
  25. package/dist/core/installers/requirements/PipInstaller.d.ts +1 -1
  26. package/dist/core/installers/requirements/RequirementInstaller.d.ts +1 -1
  27. package/dist/core/loaders/ConfigurationLoader.d.ts +32 -0
  28. package/dist/core/loaders/ConfigurationLoader.js +236 -0
  29. package/dist/core/loaders/ConfigurationProvider.d.ts +35 -0
  30. package/dist/core/loaders/ConfigurationProvider.js +375 -0
  31. package/dist/core/loaders/ServerSchemaLoader.d.ts +11 -0
  32. package/{src/core/ServerSchemaLoader.ts → dist/core/loaders/ServerSchemaLoader.js} +43 -48
  33. package/dist/core/loaders/ServerSchemaProvider.d.ts +17 -0
  34. package/{src/core/ServerSchemaProvider.ts → dist/core/loaders/ServerSchemaProvider.js} +120 -137
  35. package/dist/core/metadatas/constants.d.ts +47 -0
  36. package/dist/core/metadatas/constants.js +94 -0
  37. package/dist/core/metadatas/types.d.ts +166 -0
  38. package/dist/core/metadatas/types.js +16 -0
  39. package/dist/core/onboard/FeedOnboardService.d.ts +1 -1
  40. package/dist/core/onboard/FeedOnboardService.js +1 -1
  41. package/dist/core/onboard/OnboardProcessor.d.ts +1 -1
  42. package/dist/core/onboard/OnboardProcessor.js +1 -1
  43. package/dist/core/onboard/OnboardStatus.d.ts +1 -1
  44. package/dist/core/onboard/OnboardStatusManager.d.ts +1 -1
  45. package/dist/core/onboard/OnboardStatusManager.js +1 -1
  46. package/dist/core/validators/FeedValidator.d.ts +1 -1
  47. package/dist/core/validators/IServerValidator.d.ts +1 -1
  48. package/dist/core/validators/SSEServerValidator.d.ts +1 -1
  49. package/dist/core/validators/ServerValidatorFactory.d.ts +1 -1
  50. package/dist/core/validators/StdioServerValidator.d.ts +1 -1
  51. package/dist/core/validators/StdioServerValidator.js +1 -1
  52. package/dist/index.d.ts +3 -3
  53. package/dist/index.js +3 -3
  54. package/dist/services/InstallationService.d.ts +50 -0
  55. package/dist/services/InstallationService.js +350 -0
  56. package/dist/services/MCPManager.d.ts +28 -0
  57. package/dist/services/MCPManager.js +188 -0
  58. package/dist/services/RequirementService.d.ts +40 -0
  59. package/dist/services/RequirementService.js +110 -0
  60. package/dist/services/ServerService.d.ts +2 -2
  61. package/dist/services/ServerService.js +5 -5
  62. package/dist/utils/adoUtils.d.ts +2 -2
  63. package/dist/utils/adoUtils.js +1 -1
  64. package/dist/utils/feedUtils.js +1 -1
  65. package/dist/utils/githubUtils.d.ts +1 -1
  66. package/dist/utils/githubUtils.js +1 -1
  67. package/dist/utils/logger.js +1 -1
  68. package/dist/utils/macroExpressionUtils.d.ts +1 -1
  69. package/dist/utils/osUtils.d.ts +1 -1
  70. package/dist/utils/osUtils.js +1 -1
  71. package/dist/web/contract/serverContract.d.ts +1 -1
  72. package/dist/web/public/index.html +1 -3
  73. package/dist/web/public/js/api.js +2 -80
  74. package/dist/web/server.js +2 -2
  75. package/package.json +1 -1
  76. package/src/cli/commands/install.ts +3 -3
  77. package/src/cli/commands/list.ts +2 -2
  78. package/src/cli/commands/serve.ts +3 -2
  79. package/src/cli/index.ts +1 -1
  80. package/src/core/installers/clients/BaseClientInstaller.ts +134 -3
  81. package/src/core/installers/clients/ClientInstaller.ts +3 -3
  82. package/src/core/installers/clients/ClientInstallerFactory.ts +1 -1
  83. package/src/core/installers/clients/ClineInstaller.ts +1 -101
  84. package/src/core/installers/clients/ExtensionInstaller.ts +1 -1
  85. package/src/core/installers/clients/GithubCopilotInstaller.ts +1 -101
  86. package/src/core/installers/clients/MSRooCodeInstaller.ts +1 -102
  87. package/src/core/installers/requirements/BaseInstaller.ts +2 -2
  88. package/src/core/installers/requirements/CommandInstaller.ts +1 -1
  89. package/src/core/installers/requirements/GeneralInstaller.ts +1 -1
  90. package/src/core/installers/requirements/InstallerFactory.ts +1 -1
  91. package/src/core/installers/requirements/NpmInstaller.ts +12 -12
  92. package/src/core/installers/requirements/PipInstaller.ts +1 -1
  93. package/src/core/installers/requirements/RequirementInstaller.ts +1 -1
  94. package/src/core/{ConfigurationLoader.ts → loaders/ConfigurationLoader.ts} +31 -7
  95. package/src/core/{ConfigurationProvider.ts → loaders/ConfigurationProvider.ts} +18 -10
  96. package/src/core/loaders/ServerSchemaLoader.ts +117 -0
  97. package/src/core/loaders/ServerSchemaProvider.ts +99 -0
  98. package/src/core/{types.ts → metadatas/types.ts} +3 -2
  99. package/src/core/onboard/FeedOnboardService.ts +270 -146
  100. package/src/core/onboard/OnboardProcessor.ts +60 -11
  101. package/src/core/onboard/OnboardStatus.ts +7 -2
  102. package/src/core/onboard/OnboardStatusManager.ts +270 -43
  103. package/src/core/validators/FeedValidator.ts +65 -9
  104. package/src/core/validators/IServerValidator.ts +1 -1
  105. package/src/core/validators/SSEServerValidator.ts +2 -2
  106. package/src/core/validators/ServerValidatorFactory.ts +1 -1
  107. package/src/core/validators/StdioServerValidator.ts +86 -34
  108. package/src/index.ts +3 -3
  109. package/src/{core → services}/InstallationService.ts +5 -5
  110. package/src/{core → services}/MCPManager.ts +10 -5
  111. package/src/{core → services}/RequirementService.ts +2 -31
  112. package/src/services/ServerService.ts +7 -7
  113. package/src/utils/adoUtils.ts +3 -3
  114. package/src/utils/feedUtils.ts +2 -2
  115. package/src/utils/githubUtils.ts +2 -2
  116. package/src/utils/logger.ts +13 -1
  117. package/src/utils/macroExpressionUtils.ts +1 -1
  118. package/src/utils/osUtils.ts +4 -4
  119. package/src/web/contract/serverContract.ts +2 -2
  120. package/src/web/public/index.html +1 -3
  121. package/src/web/public/js/api.js +2 -80
  122. package/src/web/public/js/modal/installation.js +1 -1
  123. package/src/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +41 -9
  124. package/src/web/public/js/onboard/formProcessor.js +200 -34
  125. package/src/web/public/js/onboard/index.js +2 -2
  126. package/src/web/public/js/onboard/publishHandler.js +30 -22
  127. package/src/web/public/js/onboard/templates.js +34 -40
  128. package/src/web/public/js/onboard/uiHandlers.js +175 -84
  129. package/src/web/public/js/onboard/validationHandlers.js +147 -64
  130. package/src/web/public/js/serverCategoryDetails.js +19 -4
  131. package/src/web/public/js/serverCategoryList.js +13 -1
  132. package/src/web/public/onboard.html +1 -1
  133. package/src/web/server.ts +30 -14
  134. package/src/services/InstallRequestValidator.ts +0 -112
  135. /package/src/core/{constants.ts → metadatas/constants.ts} +0 -0
@@ -1,137 +1,120 @@
1
- import fs from 'fs/promises';
2
- import path from 'path';
3
- import { LOCAL_FEEDS_SCHEMA_DIR } from './constants.js';
4
- import { Logger } from '../utils/logger.js';
5
-
6
- export interface ServerSchema {
7
- schema: Record<string, any>;
8
- }
9
-
10
- export class ServerSchemaProvider {
11
- private static instance: ServerSchemaProvider;
12
- private schemaMap: Map<string, Map<string, ServerSchema>>;
13
- private schemaLock: Promise<void> = Promise.resolve();
14
-
15
- private constructor() {
16
- this.schemaMap = new Map();
17
- }
18
-
19
- public static async getInstance(): Promise<ServerSchemaProvider> {
20
- if (!ServerSchemaProvider.instance) {
21
- ServerSchemaProvider.instance = new ServerSchemaProvider();
22
- await ServerSchemaProvider.instance.initialize();
23
- }
24
- return ServerSchemaProvider.instance;
25
- }
26
-
27
- private async withLock<T>(operation: () => Promise<T>): Promise<T> {
28
- const current = this.schemaLock;
29
- let resolve: () => void;
30
- this.schemaLock = new Promise<void>(r => resolve = r);
31
- try {
32
- await current;
33
- return await operation();
34
- } finally {
35
- resolve!();
36
- }
37
- }
38
-
39
- async initialize(): Promise<void> {
40
- await this.withLock(async () => {
41
- try {
42
- // Create feeds directory if it doesn't exist
43
- await fs.mkdir(LOCAL_FEEDS_SCHEMA_DIR, { recursive: true });
44
-
45
- // Load all schemas from the feeds directory
46
- await this.loadAllSchemas();
47
- } catch (error) {
48
- Logger.error('Error during schema initialization:', error);
49
- throw error;
50
- }
51
- });
52
- }
53
-
54
- private async loadSchema(categoryName: string, schemaFileName: string): Promise<ServerSchema | undefined> {
55
- try {
56
- const schemaPath = path.join(LOCAL_FEEDS_SCHEMA_DIR, categoryName, schemaFileName);
57
- const content = await fs.readFile(schemaPath, 'utf8');
58
- const schema = JSON.parse(content);
59
-
60
- return {
61
- schema: schema
62
- };
63
- } catch (error) {
64
- if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
65
- Logger.debug(`No schema file found for ${schemaFileName} in category ${categoryName}`);
66
- return undefined;
67
- }
68
- Logger.error(`Error loading schema ${schemaFileName} in category ${categoryName}:`, error);
69
- throw error;
70
- }
71
- }
72
-
73
- private async loadAllSchemas(): Promise<void> {
74
- this.schemaMap.clear();
75
-
76
- // Read server category directories
77
- const categoryDirs = await fs.readdir(LOCAL_FEEDS_SCHEMA_DIR, { withFileTypes: true });
78
-
79
- for (const categoryDir of categoryDirs) {
80
- if (categoryDir.isDirectory()) {
81
- const categoryPath = path.join(LOCAL_FEEDS_SCHEMA_DIR, categoryDir.name);
82
- const serverFiles = await fs.readdir(categoryPath);
83
-
84
- const serverSchemas = new Map<string, ServerSchema>();
85
-
86
- for (const file of serverFiles) {
87
- if (file.endsWith('.json')) {
88
- try {
89
- const schema = await this.loadSchema(categoryDir.name, file);
90
- if (schema) {
91
- // Store with the complete file name for direct lookup
92
- serverSchemas.set(file, schema);
93
- }
94
- } catch (error) {
95
- Logger.error(`Error loading schema for file ${file} in category ${categoryDir.name}:`, error);
96
- }
97
- }
98
- }
99
-
100
- if (serverSchemas.size > 0) {
101
- this.schemaMap.set(categoryDir.name, serverSchemas);
102
- }
103
- }
104
- }
105
- }
106
-
107
- async getSchema(categoryName: string, schemaFileName: string): Promise<ServerSchema | undefined> {
108
- return await this.withLock(async () => {
109
- const categorySchemas = this.schemaMap.get(categoryName);
110
- if (!categorySchemas) {
111
- Logger.debug(`No schemas found for category ${categoryName}`);
112
- return undefined;
113
- }
114
- const schema = categorySchemas.get(schemaFileName);
115
- if (!schema) {
116
- Logger.debug(`Schema ${schemaFileName} not found in category ${categoryName}`);
117
- }
118
- return schema;
119
- });
120
- }
121
-
122
- async reloadSchemas(): Promise<void> {
123
- return await this.withLock(async () => {
124
- await this.loadAllSchemas();
125
- });
126
- }
127
- }
128
-
129
- // Export a lazy initialized singleton instance getter
130
- let initPromise: Promise<ServerSchemaProvider> | null = null;
131
-
132
- export function getServerSchemaProvider(): Promise<ServerSchemaProvider> {
133
- if (!initPromise) {
134
- initPromise = ServerSchemaProvider.getInstance();
135
- }
136
- return initPromise;
137
- }
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import { LOCAL_FEEDS_SCHEMA_DIR } from '../metadatas/constants.js';
4
+ import { Logger } from '../../utils/logger.js';
5
+ export class ServerSchemaProvider {
6
+ static instance;
7
+ schemaMap;
8
+ schemaLock = Promise.resolve();
9
+ constructor() {
10
+ this.schemaMap = new Map();
11
+ }
12
+ static async getInstance() {
13
+ if (!ServerSchemaProvider.instance) {
14
+ ServerSchemaProvider.instance = new ServerSchemaProvider();
15
+ await ServerSchemaProvider.instance.initialize();
16
+ }
17
+ return ServerSchemaProvider.instance;
18
+ }
19
+ async withLock(operation) {
20
+ const current = this.schemaLock;
21
+ let resolve;
22
+ this.schemaLock = new Promise(r => resolve = r);
23
+ try {
24
+ await current;
25
+ return await operation();
26
+ }
27
+ finally {
28
+ resolve();
29
+ }
30
+ }
31
+ async initialize() {
32
+ await this.withLock(async () => {
33
+ try {
34
+ // Create feeds directory if it doesn't exist
35
+ await fs.mkdir(LOCAL_FEEDS_SCHEMA_DIR, { recursive: true });
36
+ // Load all schemas from the feeds directory
37
+ await this.loadAllSchemas();
38
+ }
39
+ catch (error) {
40
+ Logger.error('Error during schema initialization:', error);
41
+ throw error;
42
+ }
43
+ });
44
+ }
45
+ async loadSchema(categoryName, schemaFileName) {
46
+ try {
47
+ const schemaPath = path.join(LOCAL_FEEDS_SCHEMA_DIR, categoryName, schemaFileName);
48
+ const content = await fs.readFile(schemaPath, 'utf8');
49
+ const schema = JSON.parse(content);
50
+ return {
51
+ schema: schema
52
+ };
53
+ }
54
+ catch (error) {
55
+ if (error.code === 'ENOENT') {
56
+ Logger.debug(`No schema file found for ${schemaFileName} in category ${categoryName}`);
57
+ return undefined;
58
+ }
59
+ Logger.error(`Error loading schema ${schemaFileName} in category ${categoryName}:`, error);
60
+ throw error;
61
+ }
62
+ }
63
+ async loadAllSchemas() {
64
+ this.schemaMap.clear();
65
+ // Read server category directories
66
+ const categoryDirs = await fs.readdir(LOCAL_FEEDS_SCHEMA_DIR, { withFileTypes: true });
67
+ for (const categoryDir of categoryDirs) {
68
+ if (categoryDir.isDirectory()) {
69
+ const categoryPath = path.join(LOCAL_FEEDS_SCHEMA_DIR, categoryDir.name);
70
+ const serverFiles = await fs.readdir(categoryPath);
71
+ const serverSchemas = new Map();
72
+ for (const file of serverFiles) {
73
+ if (file.endsWith('.json')) {
74
+ try {
75
+ const schema = await this.loadSchema(categoryDir.name, file);
76
+ if (schema) {
77
+ // Store with the complete file name for direct lookup
78
+ serverSchemas.set(file, schema);
79
+ }
80
+ }
81
+ catch (error) {
82
+ Logger.error(`Error loading schema for file ${file} in category ${categoryDir.name}:`, error);
83
+ }
84
+ }
85
+ }
86
+ if (serverSchemas.size > 0) {
87
+ this.schemaMap.set(categoryDir.name, serverSchemas);
88
+ }
89
+ }
90
+ }
91
+ }
92
+ async getSchema(categoryName, schemaFileName) {
93
+ return await this.withLock(async () => {
94
+ const categorySchemas = this.schemaMap.get(categoryName);
95
+ if (!categorySchemas) {
96
+ Logger.debug(`No schemas found for category ${categoryName}`);
97
+ return undefined;
98
+ }
99
+ const schema = categorySchemas.get(schemaFileName);
100
+ if (!schema) {
101
+ Logger.debug(`Schema ${schemaFileName} not found in category ${categoryName}`);
102
+ }
103
+ return schema;
104
+ });
105
+ }
106
+ async reloadSchemas() {
107
+ return await this.withLock(async () => {
108
+ await this.loadAllSchemas();
109
+ });
110
+ }
111
+ }
112
+ // Export a lazy initialized singleton instance getter
113
+ let initPromise = null;
114
+ export function getServerSchemaProvider() {
115
+ if (!initPromise) {
116
+ initPromise = ServerSchemaProvider.getInstance();
117
+ }
118
+ return initPromise;
119
+ }
120
+ //# sourceMappingURL=ServerSchemaProvider.js.map
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Defines constants used across the application.
3
+ */
4
+ /**
5
+ * GitHub repository configuration for feeds
6
+ */
7
+ export declare const GITHUB_REPO: {
8
+ url: string;
9
+ repoName: string;
10
+ feedsPath: string;
11
+ feedAssetsName: string;
12
+ };
13
+ /**
14
+ * Local settings directory path based on OS
15
+ */
16
+ export declare const SETTINGS_DIR: string;
17
+ /**
18
+ * Local feeds directory path
19
+ */
20
+ export declare const LOCAL_FEEDS_DIR: string;
21
+ export declare const LOCAL_FEEDS_SCHEMA_DIR: string;
22
+ /**
23
+ * Supported client configurations.
24
+ * Key: Client name (e.g., 'vscode')
25
+ * Value: Client-specific settings or configuration details.
26
+ * TODO: Define actual client settings structure.
27
+ */
28
+ export declare const SUPPORTED_CLIENTS: Record<string, {
29
+ extension: {
30
+ extensionId: string;
31
+ leastVersion?: string;
32
+ repository?: string;
33
+ assetName?: string;
34
+ private?: boolean;
35
+ };
36
+ codeSettingPath: string;
37
+ codeInsiderSettingPath: string;
38
+ }>;
39
+ /**
40
+ * List of supported client names.
41
+ */
42
+ export declare const SUPPORTED_CLIENT_NAMES: string[];
43
+ /**
44
+ * Minimum time between requirement update checks (in milliseconds)
45
+ * 10 minutes = 10 * 60 * 1000 = 600000 ms
46
+ */
47
+ export declare const UPDATE_CHECK_INTERVAL_MS: number;
@@ -0,0 +1,94 @@
1
+ import os from 'os';
2
+ import path from 'path';
3
+ /**
4
+ * Defines constants used across the application.
5
+ */
6
+ /**
7
+ * GitHub repository configuration for feeds
8
+ */
9
+ export const GITHUB_REPO = {
10
+ url: 'https://github.com/ai-microsoft/imcp-feed.git',
11
+ repoName: 'ai-microsoft/imcp-feed',
12
+ feedsPath: 'feeds',
13
+ feedAssetsName: 'imcp-feeds-${latest}.zip',
14
+ };
15
+ /**
16
+ * Local settings directory path based on OS
17
+ */
18
+ export const SETTINGS_DIR = (() => {
19
+ switch (process.platform) {
20
+ case 'win32':
21
+ return path.join(os.homedir(), '.imcp');
22
+ default: // linux, darwin (macOS), etc.
23
+ return path.join(os.homedir(), '.imcp');
24
+ }
25
+ })();
26
+ /**
27
+ * Local feeds directory path
28
+ */
29
+ export const LOCAL_FEEDS_DIR = path.join(SETTINGS_DIR, 'feeds');
30
+ export const LOCAL_FEEDS_SCHEMA_DIR = path.join(LOCAL_FEEDS_DIR, 'schemas');
31
+ const CODE_STRORAGE_DIR = (() => {
32
+ switch (process.platform) {
33
+ case 'win32':
34
+ return path.join(os.homedir(), 'AppData', 'Roaming', 'Code', 'User');
35
+ case 'darwin': // macOS
36
+ return path.join(os.homedir(), 'Library', 'Application Support', 'Code', 'User');
37
+ default: // linux
38
+ return path.join(os.homedir(), '.config', 'Code', 'User');
39
+ }
40
+ })();
41
+ const CODE_INSIDER_STRORAGE_DIR = (() => {
42
+ switch (process.platform) {
43
+ case 'win32':
44
+ return path.join(os.homedir(), 'AppData', 'Roaming', 'Code - Insiders', 'User');
45
+ case 'darwin': // macOS
46
+ return path.join(os.homedir(), 'Library', 'Application Support', 'Code - Insiders', 'User');
47
+ default: // linux
48
+ return path.join(os.homedir(), '.config', 'Code - Insiders', 'User');
49
+ }
50
+ })();
51
+ /**
52
+ * Supported client configurations.
53
+ * Key: Client name (e.g., 'vscode')
54
+ * Value: Client-specific settings or configuration details.
55
+ * TODO: Define actual client settings structure.
56
+ */
57
+ export const SUPPORTED_CLIENTS = {
58
+ 'MSRooCode': {
59
+ extension: {
60
+ extensionId: 'microsoftai.ms-roo-cline',
61
+ leastVersion: '0.0.8',
62
+ repository: 'ai-microsoft/roo-cline',
63
+ assetName: 'ms-roo-cline-${version}.vsix',
64
+ private: true
65
+ },
66
+ codeSettingPath: path.join(CODE_STRORAGE_DIR, 'globalStorage', 'microsoftai.ms-roo-cline', 'settings', 'cline_mcp_settings.json'),
67
+ codeInsiderSettingPath: path.join(CODE_INSIDER_STRORAGE_DIR, 'globalStorage', 'microsoftai.ms-roo-cline', 'settings', 'cline_mcp_settings.json'),
68
+ },
69
+ 'Cline': {
70
+ extension: {
71
+ extensionId: 'saoudrizwan.claude-dev',
72
+ },
73
+ codeSettingPath: path.join(CODE_STRORAGE_DIR, 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'),
74
+ codeInsiderSettingPath: path.join(CODE_INSIDER_STRORAGE_DIR, 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'),
75
+ },
76
+ 'GithubCopilot': {
77
+ extension: {
78
+ extensionId: 'github.copilot',
79
+ },
80
+ codeSettingPath: path.join(CODE_STRORAGE_DIR, 'settings.json'),
81
+ codeInsiderSettingPath: path.join(CODE_INSIDER_STRORAGE_DIR, 'settings.json'),
82
+ },
83
+ // Add other supported clients here
84
+ };
85
+ /**
86
+ * List of supported client names.
87
+ */
88
+ export const SUPPORTED_CLIENT_NAMES = Object.keys(SUPPORTED_CLIENTS);
89
+ /**
90
+ * Minimum time between requirement update checks (in milliseconds)
91
+ * 10 minutes = 10 * 60 * 1000 = 600000 ms
92
+ */
93
+ export const UPDATE_CHECK_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes
94
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,166 @@
1
+ export declare enum OSType {
2
+ Windows = "windows",
3
+ MacOS = "macos",
4
+ Linux = "linux"
5
+ }
6
+ export interface RequirementStatus {
7
+ name: string;
8
+ type: string;
9
+ installed: boolean;
10
+ inProgress?: boolean;
11
+ version?: string;
12
+ error?: string;
13
+ availableUpdate?: {
14
+ version: string;
15
+ message: string;
16
+ };
17
+ lastCheckTime?: string;
18
+ operationStatus?: OperationStatus;
19
+ pythonEnv?: string;
20
+ npmPath?: string;
21
+ }
22
+ export interface MCPServerStatus {
23
+ installedStatus: Record<string, OperationStatus>;
24
+ name: string;
25
+ tags?: string[];
26
+ error?: string;
27
+ }
28
+ export interface OperationStatus {
29
+ status: 'pending' | 'in-progress' | 'completed' | 'failed';
30
+ type: 'install' | 'uninstall' | 'update' | 'check';
31
+ target: 'requirement' | 'server';
32
+ message?: string;
33
+ error?: string;
34
+ operationId?: string;
35
+ }
36
+ export interface InstallationStatus {
37
+ requirementsStatus: Record<string, RequirementStatus>;
38
+ serversStatus: Record<string, MCPServerStatus>;
39
+ lastUpdated: string;
40
+ }
41
+ export interface MCPServerCategory {
42
+ name: string;
43
+ displayName: string;
44
+ description?: string;
45
+ type: 'local';
46
+ tags?: string[];
47
+ path?: string;
48
+ installationStatus?: InstallationStatus;
49
+ feedConfiguration?: FeedConfiguration;
50
+ }
51
+ export interface ServerCategoryListOptions {
52
+ local?: boolean;
53
+ }
54
+ export interface ServerOperationResult {
55
+ success: boolean;
56
+ message?: string;
57
+ error?: Error;
58
+ output?: string;
59
+ status?: OperationStatus[];
60
+ }
61
+ export interface MCPConfiguration {
62
+ localServerCategories: MCPServerCategory[];
63
+ feeds: Record<string, FeedConfiguration>;
64
+ clientMCPSettings?: Record<string, Record<string, any>>;
65
+ }
66
+ export interface ServerInstallOptions {
67
+ force?: boolean;
68
+ env?: Record<string, string>;
69
+ targetClients?: string[];
70
+ requirements?: RequirementConfig[];
71
+ args?: string[];
72
+ settings?: Record<string, any>;
73
+ }
74
+ export interface UpdateRequirementOptions {
75
+ requirementName: string;
76
+ updateVersion: string;
77
+ }
78
+ export interface ServerUninstallOptions {
79
+ removeData?: boolean;
80
+ targets?: string[];
81
+ }
82
+ export interface EnvVariableConfig {
83
+ Required: boolean;
84
+ Description: string;
85
+ Default?: string;
86
+ }
87
+ export interface InstallationConfig {
88
+ command: string;
89
+ args: string[];
90
+ env?: Record<string, EnvVariableConfig>;
91
+ url?: string;
92
+ }
93
+ export interface DependencyConfig {
94
+ requirements?: Array<{
95
+ name: string;
96
+ version: string;
97
+ order?: number;
98
+ }>;
99
+ mcpServers?: Array<{
100
+ name: string;
101
+ }>;
102
+ }
103
+ export interface McpConfig {
104
+ name: string;
105
+ description: string;
106
+ mode: 'stdio' | 'sse';
107
+ dependencies?: DependencyConfig;
108
+ schemas?: string;
109
+ repository?: string;
110
+ installation: InstallationConfig;
111
+ }
112
+ export interface RegistryConfig {
113
+ githubRelease?: {
114
+ repository: string;
115
+ assetsName?: string;
116
+ assetName: string;
117
+ };
118
+ artifacts?: {
119
+ registryUrl: string;
120
+ registryName: string;
121
+ };
122
+ }
123
+ export interface RequirementConfig {
124
+ name: string;
125
+ type: 'npm' | 'pip' | 'command' | 'extension' | 'other';
126
+ alias?: string;
127
+ version: string;
128
+ registry?: RegistryConfig;
129
+ }
130
+ export interface FeedConfiguration {
131
+ name: string;
132
+ displayName: string;
133
+ description: string;
134
+ repository?: string;
135
+ requirements: RequirementConfig[];
136
+ mcpServers: McpConfig[];
137
+ }
138
+ export interface ClientSettings {
139
+ codeSettingPath: string;
140
+ codeInsiderSettingPath: string;
141
+ }
142
+ export declare enum MCPEvent {
143
+ SERVER_INSTALLED = "server:installed",
144
+ SERVER_UNINSTALLED = "server:uninstalled",
145
+ SERVER_STARTED = "server:started",
146
+ SERVER_STOPPED = "server:stopped",
147
+ CONFIG_CHANGED = "config:changed"
148
+ }
149
+ export interface MCPEventData {
150
+ [MCPEvent.SERVER_INSTALLED]: {
151
+ server: MCPServerCategory;
152
+ };
153
+ [MCPEvent.SERVER_UNINSTALLED]: {
154
+ serverName: string;
155
+ targets?: string[];
156
+ };
157
+ [MCPEvent.SERVER_STARTED]: {
158
+ server: MCPServerCategory;
159
+ };
160
+ [MCPEvent.SERVER_STOPPED]: {
161
+ serverName: string;
162
+ };
163
+ [MCPEvent.CONFIG_CHANGED]: {
164
+ configuration: MCPConfiguration;
165
+ };
166
+ }
@@ -0,0 +1,16 @@
1
+ export var OSType;
2
+ (function (OSType) {
3
+ OSType["Windows"] = "windows";
4
+ OSType["MacOS"] = "macos";
5
+ OSType["Linux"] = "linux";
6
+ })(OSType || (OSType = {}));
7
+ // Events that can be emitted by the SDK
8
+ export var MCPEvent;
9
+ (function (MCPEvent) {
10
+ MCPEvent["SERVER_INSTALLED"] = "server:installed";
11
+ MCPEvent["SERVER_UNINSTALLED"] = "server:uninstalled";
12
+ MCPEvent["SERVER_STARTED"] = "server:started";
13
+ MCPEvent["SERVER_STOPPED"] = "server:stopped";
14
+ MCPEvent["CONFIG_CHANGED"] = "config:changed";
15
+ })(MCPEvent || (MCPEvent = {}));
16
+ //# sourceMappingURL=types.js.map
@@ -1,4 +1,4 @@
1
- import { FeedConfiguration } from '../types.js';
1
+ import { FeedConfiguration } from '../metadatas/types.js';
2
2
  import { OperationStatus } from './OnboardStatus.js';
3
3
  /**
4
4
  * Service for handling feed onboarding operations
@@ -1,4 +1,4 @@
1
- import { configProvider } from '../ConfigurationProvider.js';
1
+ import { configProvider } from '../loaders/ConfigurationProvider.js';
2
2
  import { feedValidator } from '../validators/FeedValidator.js';
3
3
  import { Logger } from '../../utils/logger.js';
4
4
  import { OnboardingProcessStatus } from './OnboardStatus.js';
@@ -1,4 +1,4 @@
1
- import { FeedConfiguration } from '../types.js';
1
+ import { FeedConfiguration } from '../metadatas/types.js';
2
2
  /**
3
3
  * Class responsible for handling GitHub operations during the onboarding process
4
4
  */
@@ -2,7 +2,7 @@ import { exec } from 'child_process';
2
2
  import { promisify } from 'util';
3
3
  import fs from 'fs/promises';
4
4
  import path from 'path';
5
- import { GITHUB_REPO, SETTINGS_DIR } from '../constants.js';
5
+ import { GITHUB_REPO, SETTINGS_DIR } from '../metadatas/constants.js';
6
6
  import { Logger } from '../../utils/logger.js';
7
7
  const execAsync = promisify(exec);
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { FeedConfiguration } from "../types.js";
1
+ import { FeedConfiguration } from "../metadatas/types.js";
2
2
  export declare enum OnboardingProcessStatus {
3
3
  VALIDATING = "validating",
4
4
  VALIDATED = "validated",
@@ -1,4 +1,4 @@
1
- import { FeedConfiguration } from '../types.js';
1
+ import { FeedConfiguration } from '../metadatas/types.js';
2
2
  import { OnboardStatus, OperationType } from './OnboardStatus.js';
3
3
  export declare class OnboardStatusManager {
4
4
  private static instance;
@@ -1,6 +1,6 @@
1
1
  import fs from 'fs/promises';
2
2
  import path from 'path';
3
- import { SETTINGS_DIR } from '../constants.js';
3
+ import { SETTINGS_DIR } from '../metadatas/constants.js';
4
4
  import { OnboardingProcessStatus } from './OnboardStatus.js';
5
5
  import { Logger } from '../../utils/logger.js';
6
6
  const ONBOARD_STATUS_DIR = path.join(SETTINGS_DIR, 'onboard');
@@ -1,4 +1,4 @@
1
- import { FeedConfiguration, McpConfig } from "../types.js";
1
+ import { FeedConfiguration, McpConfig } from "../metadatas/types.js";
2
2
  /**
3
3
  * Validates feed configurations to ensure they meet required criteria
4
4
  */
@@ -1,4 +1,4 @@
1
- import { McpConfig, FeedConfiguration } from "../types.js";
1
+ import { McpConfig, FeedConfiguration } from "../metadatas/types.js";
2
2
  /**
3
3
  * Interface for MCP server configuration validators
4
4
  * Defines common validation operations for server configurations
@@ -1,4 +1,4 @@
1
- import { McpConfig, FeedConfiguration } from "../types.js";
1
+ import { McpConfig, FeedConfiguration } from "../metadatas/types.js";
2
2
  import { IServerValidator } from "./IServerValidator.js";
3
3
  /**
4
4
  * Validates MCP server configurations for SSE mode