imcp 0.0.19 → 0.1.2

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 (183) hide show
  1. package/.roo/rules-code/rules.md +88 -0
  2. package/dist/cli/index.js +1 -45
  3. package/dist/core/installers/clients/BaseClientInstaller.d.ts +1 -5
  4. package/dist/core/installers/clients/BaseClientInstaller.js +40 -38
  5. package/dist/core/installers/clients/ClientInstaller.d.ts +9 -9
  6. package/dist/core/installers/clients/ClientInstaller.js +105 -99
  7. package/dist/core/installers/requirements/BaseInstaller.d.ts +9 -1
  8. package/dist/core/installers/requirements/CommandInstaller.d.ts +9 -1
  9. package/dist/core/installers/requirements/CommandInstaller.js +46 -12
  10. package/dist/core/installers/requirements/GeneralInstaller.d.ts +11 -1
  11. package/dist/core/installers/requirements/GeneralInstaller.js +46 -10
  12. package/dist/core/installers/requirements/InstallerFactory.d.ts +3 -1
  13. package/dist/core/installers/requirements/InstallerFactory.js +3 -2
  14. package/dist/core/installers/requirements/NpmInstaller.d.ts +4 -2
  15. package/dist/core/installers/requirements/NpmInstaller.js +38 -22
  16. package/dist/core/installers/requirements/PipInstaller.d.ts +3 -1
  17. package/dist/core/installers/requirements/PipInstaller.js +58 -36
  18. package/dist/core/installers/requirements/RequirementInstaller.d.ts +4 -1
  19. package/dist/core/loaders/InstallOperationManager.d.ts +115 -0
  20. package/dist/core/loaders/InstallOperationManager.js +311 -0
  21. package/dist/core/loaders/SystemSettingsManager.d.ts +54 -0
  22. package/dist/core/loaders/SystemSettingsManager.js +257 -0
  23. package/dist/core/metadatas/constants.d.ts +7 -0
  24. package/dist/core/metadatas/constants.js +7 -0
  25. package/dist/core/metadatas/recordingConstants.d.ts +44 -0
  26. package/dist/core/metadatas/recordingConstants.js +45 -0
  27. package/dist/core/metadatas/types.d.ts +21 -0
  28. package/dist/core/onboard/FeedOnboardService.d.ts +7 -3
  29. package/dist/core/onboard/FeedOnboardService.js +52 -5
  30. package/dist/core/onboard/InstallOperationManager.d.ts +23 -0
  31. package/dist/core/onboard/InstallOperationManager.js +144 -0
  32. package/dist/core/onboard/OnboardStatusManager.js +2 -1
  33. package/dist/core/validators/StdioServerValidator.js +4 -3
  34. package/dist/services/InstallationService.d.ts +2 -37
  35. package/dist/services/InstallationService.js +45 -313
  36. package/dist/services/MCPManager.d.ts +1 -1
  37. package/dist/services/MCPManager.js +53 -47
  38. package/dist/services/RequirementService.d.ts +85 -12
  39. package/dist/services/RequirementService.js +488 -49
  40. package/dist/services/ServerService.d.ts +0 -6
  41. package/dist/services/ServerService.js +0 -74
  42. package/dist/services/TelemetryService.d.ts +15 -0
  43. package/dist/services/TelemetryService.js +54 -0
  44. package/dist/utils/adoUtils.js +6 -3
  45. package/dist/utils/githubAuth.js +65 -0
  46. package/dist/utils/logger.d.ts +16 -0
  47. package/dist/utils/logger.js +78 -1
  48. package/dist/utils/macroExpressionUtils.js +3 -25
  49. package/dist/utils/osUtils.d.ts +22 -1
  50. package/dist/utils/osUtils.js +92 -1
  51. package/dist/utils/versionUtils.d.ts +20 -0
  52. package/dist/utils/versionUtils.js +76 -0
  53. package/dist/web/public/css/modal.css +292 -1
  54. package/dist/web/public/css/serverCategoryList.css +120 -0
  55. package/dist/web/public/css/serverDetails.css +14 -1
  56. package/dist/web/public/index.html +126 -21
  57. package/dist/web/public/js/flights/flights.js +1 -1
  58. package/dist/web/public/js/modal/index.js +8 -14
  59. package/dist/web/public/js/modal/installModal.js +3 -4
  60. package/dist/web/public/js/modal/installation.js +122 -137
  61. package/dist/web/public/js/modal/loadingModal.js +155 -25
  62. package/dist/web/public/js/modal/messageQueue.js +45 -101
  63. package/dist/web/public/js/modal/modalSetup.js +125 -43
  64. package/dist/web/public/js/modal/modalUtils.js +0 -12
  65. package/dist/web/public/js/modal.js +23 -10
  66. package/dist/web/public/js/onboard/formProcessor.js +18 -11
  67. package/dist/web/public/js/onboard/publishHandler.js +35 -3
  68. package/dist/web/public/js/onboard/templates.js +5 -1
  69. package/dist/web/public/js/onboard/uiHandlers.js +266 -39
  70. package/dist/web/public/js/onboard/validationHandlers.js +71 -39
  71. package/dist/web/public/js/serverCategoryDetails.js +60 -11
  72. package/dist/web/public/js/serverCategoryList.js +93 -9
  73. package/dist/web/public/js/settings.js +314 -0
  74. package/dist/web/public/onboard.html +2 -2
  75. package/dist/web/public/settings.html +135 -0
  76. package/dist/web/public/styles.css +32 -0
  77. package/dist/web/server.js +93 -1
  78. package/{src/web/public/js/onboard → docs}/ONBOARDING_PAGE_DESIGN.md +15 -125
  79. package/docs/Telemetry.md +136 -0
  80. package/memory-bank/activeContext.md +26 -0
  81. package/memory-bank/decisionLog.md +91 -0
  82. package/memory-bank/productContext.md +41 -0
  83. package/memory-bank/progress.md +35 -0
  84. package/memory-bank/systemPatterns.md +10 -0
  85. package/package.json +2 -1
  86. package/src/cli/index.ts +1 -48
  87. package/src/core/installers/clients/BaseClientInstaller.ts +64 -50
  88. package/src/core/installers/clients/ClientInstaller.ts +130 -130
  89. package/src/core/installers/requirements/BaseInstaller.ts +9 -1
  90. package/src/core/installers/requirements/CommandInstaller.ts +47 -13
  91. package/src/core/installers/requirements/GeneralInstaller.ts +48 -10
  92. package/src/core/installers/requirements/InstallerFactory.ts +4 -3
  93. package/src/core/installers/requirements/NpmInstaller.ts +90 -68
  94. package/src/core/installers/requirements/PipInstaller.ts +81 -55
  95. package/src/core/installers/requirements/RequirementInstaller.ts +4 -3
  96. package/src/core/loaders/InstallOperationManager.ts +367 -0
  97. package/src/core/loaders/SystemSettingsManager.ts +278 -0
  98. package/src/core/metadatas/constants.ts +9 -0
  99. package/src/core/metadatas/recordingConstants.ts +62 -0
  100. package/src/core/metadatas/types.ts +23 -0
  101. package/src/core/onboard/FeedOnboardService.ts +59 -5
  102. package/src/core/onboard/OnboardStatusManager.ts +2 -1
  103. package/src/core/validators/StdioServerValidator.ts +4 -3
  104. package/src/services/InstallationService.ts +54 -399
  105. package/src/services/MCPManager.ts +61 -64
  106. package/src/services/RequirementService.ts +564 -67
  107. package/src/services/ServerService.ts +0 -90
  108. package/src/services/TelemetryService.ts +59 -0
  109. package/src/utils/adoUtils.ts +6 -4
  110. package/src/utils/githubAuth.ts +84 -1
  111. package/src/utils/logger.ts +83 -1
  112. package/src/utils/macroExpressionUtils.ts +4 -21
  113. package/src/utils/osUtils.ts +92 -1
  114. package/src/utils/versionUtils.ts +98 -13
  115. package/src/web/public/css/modal.css +292 -1
  116. package/src/web/public/css/serverCategoryList.css +120 -0
  117. package/src/web/public/css/serverDetails.css +14 -1
  118. package/src/web/public/index.html +126 -21
  119. package/src/web/public/js/flights/flights.js +1 -1
  120. package/src/web/public/js/modal/index.js +8 -14
  121. package/src/web/public/js/modal/installModal.js +3 -4
  122. package/src/web/public/js/modal/installation.js +122 -137
  123. package/src/web/public/js/modal/loadingModal.js +155 -25
  124. package/src/web/public/js/modal/modalSetup.js +125 -43
  125. package/src/web/public/js/modal/modalUtils.js +0 -12
  126. package/src/web/public/js/modal.js +23 -10
  127. package/src/web/public/js/onboard/formProcessor.js +18 -11
  128. package/src/web/public/js/onboard/publishHandler.js +35 -3
  129. package/src/web/public/js/onboard/templates.js +5 -1
  130. package/src/web/public/js/onboard/uiHandlers.js +266 -39
  131. package/src/web/public/js/onboard/validationHandlers.js +71 -39
  132. package/src/web/public/js/serverCategoryDetails.js +60 -11
  133. package/src/web/public/js/serverCategoryList.js +93 -9
  134. package/src/web/public/js/settings.js +314 -0
  135. package/src/web/public/onboard.html +2 -2
  136. package/src/web/public/settings.html +135 -0
  137. package/src/web/public/styles.css +32 -0
  138. package/src/web/server.ts +96 -1
  139. package/dist/cli/commands/start.d.ts +0 -2
  140. package/dist/cli/commands/start.js +0 -32
  141. package/dist/cli/commands/sync.d.ts +0 -2
  142. package/dist/cli/commands/sync.js +0 -17
  143. package/dist/core/ConfigurationLoader.d.ts +0 -32
  144. package/dist/core/ConfigurationLoader.js +0 -236
  145. package/dist/core/ConfigurationProvider.d.ts +0 -35
  146. package/dist/core/ConfigurationProvider.js +0 -375
  147. package/dist/core/InstallationService.d.ts +0 -50
  148. package/dist/core/InstallationService.js +0 -350
  149. package/dist/core/MCPManager.d.ts +0 -28
  150. package/dist/core/MCPManager.js +0 -188
  151. package/dist/core/RequirementService.d.ts +0 -40
  152. package/dist/core/RequirementService.js +0 -110
  153. package/dist/core/ServerSchemaLoader.d.ts +0 -11
  154. package/dist/core/ServerSchemaLoader.js +0 -43
  155. package/dist/core/ServerSchemaProvider.d.ts +0 -17
  156. package/dist/core/ServerSchemaProvider.js +0 -120
  157. package/dist/core/constants.d.ts +0 -47
  158. package/dist/core/constants.js +0 -94
  159. package/dist/core/installers/BaseInstaller.d.ts +0 -74
  160. package/dist/core/installers/BaseInstaller.js +0 -253
  161. package/dist/core/installers/ClientInstaller.d.ts +0 -23
  162. package/dist/core/installers/ClientInstaller.js +0 -564
  163. package/dist/core/installers/CommandInstaller.d.ts +0 -37
  164. package/dist/core/installers/CommandInstaller.js +0 -173
  165. package/dist/core/installers/GeneralInstaller.d.ts +0 -33
  166. package/dist/core/installers/GeneralInstaller.js +0 -85
  167. package/dist/core/installers/InstallerFactory.d.ts +0 -54
  168. package/dist/core/installers/InstallerFactory.js +0 -97
  169. package/dist/core/installers/NpmInstaller.d.ts +0 -26
  170. package/dist/core/installers/NpmInstaller.js +0 -127
  171. package/dist/core/installers/PipInstaller.d.ts +0 -28
  172. package/dist/core/installers/PipInstaller.js +0 -127
  173. package/dist/core/installers/RequirementInstaller.d.ts +0 -33
  174. package/dist/core/installers/RequirementInstaller.js +0 -3
  175. package/dist/core/types.d.ts +0 -166
  176. package/dist/core/types.js +0 -16
  177. package/dist/services/InstallRequestValidator.d.ts +0 -21
  178. package/dist/services/InstallRequestValidator.js +0 -99
  179. package/dist/web/public/js/modal/installHandler.js +0 -227
  180. package/dist/web/public/js/modal/loadingUI.js +0 -74
  181. package/dist/web/public/js/modal/modalUI.js +0 -214
  182. package/dist/web/public/js/modal/version.js +0 -20
  183. package/src/web/public/js/modal/messageQueue.js +0 -112
@@ -1,253 +0,0 @@
1
- import path from 'path';
2
- import fs from 'fs/promises';
3
- import { SETTINGS_DIR } from '../constants.js';
4
- import { extractZipFile } from '../../utils/clientUtils.js';
5
- import { Logger } from '../../utils/logger.js';
6
- /**
7
- * Abstract base class with common functionality for all requirement installers
8
- */
9
- export class BaseInstaller {
10
- execPromise;
11
- downloadsDir;
12
- constructor(execPromise) {
13
- this.execPromise = execPromise;
14
- this.downloadsDir = path.join(SETTINGS_DIR, 'downloads');
15
- }
16
- /**
17
- * Check if updates are available for the requirement
18
- * @param requirement The requirement to check
19
- * @param currentStatus The current status of the requirement
20
- * @returns The status of the requirement with update information
21
- */
22
- async checkForUpdates(requirement, currentStatus) {
23
- try {
24
- // If requirement is not installed, no need to check for updates
25
- if (!currentStatus.installed) {
26
- return currentStatus;
27
- }
28
- // If the version doesn't contain "latest", no update check needed
29
- if (!requirement.version.includes('latest')) {
30
- return currentStatus;
31
- }
32
- let latestVersion;
33
- // Check based on registry type
34
- if (requirement.registry?.githubRelease) {
35
- latestVersion = await this.getGitHubLatestVersion(requirement.registry.githubRelease.repository);
36
- }
37
- else {
38
- // Use common practice based on requirement type
39
- switch (requirement.type) {
40
- case 'npm':
41
- latestVersion = await this.getNpmLatestVersion(requirement.name);
42
- break;
43
- case 'pip':
44
- latestVersion = await this.getPipLatestVersion(requirement.name);
45
- break;
46
- // Add other types as needed
47
- }
48
- }
49
- // If we found a latest version and it's different from current
50
- if (latestVersion && latestVersion !== currentStatus.version) {
51
- return {
52
- ...currentStatus,
53
- availableUpdate: {
54
- version: latestVersion,
55
- message: `Update available: ${currentStatus.version} → ${latestVersion}`
56
- },
57
- lastCheckTime: new Date().toISOString()
58
- };
59
- }
60
- else {
61
- return {
62
- ...currentStatus,
63
- lastCheckTime: new Date().toISOString()
64
- };
65
- }
66
- }
67
- catch (error) {
68
- // Don't update status on error, just log it
69
- console.warn(`Error checking for updates for ${requirement.name}: ${error instanceof Error ? error.message : String(error)}`);
70
- return currentStatus;
71
- }
72
- }
73
- /**
74
- * Helper method to ensure downloads directory exists
75
- */
76
- async ensureDownloadsDir() {
77
- await fs.mkdir(this.downloadsDir, { recursive: true });
78
- }
79
- /**
80
- * Helper to handle GitHub release downloads
81
- * @param requirement The requirement configuration
82
- * @param registry The GitHub release registry configuration
83
- * @returns The path to the downloaded file
84
- */
85
- async handleGitHubRelease(requirement, registry) {
86
- if (!registry) {
87
- throw new Error('GitHub release registry configuration is required');
88
- }
89
- await this.ensureDownloadsDir();
90
- const { repository, assetsName, assetName } = registry;
91
- if (!repository) {
92
- throw new Error('GitHub repository is required for GitHub release downloads');
93
- }
94
- let version = requirement.version;
95
- let resolvedAssetName = assetName || '';
96
- let resolvedAssetsName = assetsName || '';
97
- const { stdout } = await this.execPromise(`gh release view --repo ${repository} --json tagName --jq .tagName`);
98
- const latestTag = stdout.trim();
99
- let latestVersion = latestTag;
100
- const tagWithVPrefix = latestVersion.startsWith('v');
101
- if (tagWithVPrefix)
102
- latestVersion = latestVersion.substring(1); // Remove 'v' prefix if present
103
- version = version.includes("latest") ? latestVersion : version;
104
- if (assetsName) {
105
- resolvedAssetsName = assetsName.replace('${latest}', version).replace('${version}', version);
106
- }
107
- if (assetName) {
108
- resolvedAssetName = assetName.replace('${latest}', version).replace('${version}', version);
109
- }
110
- Logger.debug(`Downloading ${requirement.name} from GitHub release ${repository} version ${version}`);
111
- Logger.debug(`ResolvedAssetsName} ${resolvedAssetName}; ResolvedAsetName} ${resolvedAssetName}`);
112
- const pattern = resolvedAssetsName ? resolvedAssetsName : resolvedAssetName;
113
- Logger.debug(`Resolved pattern: ${pattern}`);
114
- if (!pattern) {
115
- throw new Error('Either assetsName or assetName must be specified for GitHub release downloads');
116
- }
117
- // Download the release asset
118
- const downloadPath = path.join(this.downloadsDir, path.basename(pattern));
119
- if (!await this.fileExists(downloadPath)) {
120
- await this.execPromise(`gh release download ${tagWithVPrefix ? `v${version}` : version} --repo ${repository} --pattern "${pattern}" -O "${downloadPath}"`);
121
- }
122
- // Handle zip file extraction if the downloaded file is a zip
123
- if (downloadPath.endsWith('.zip')) {
124
- const extractDir = path.join(this.downloadsDir, path.basename(pattern, '.zip'));
125
- await fs.mkdir(extractDir, { recursive: true });
126
- // Extract the zip file
127
- await extractZipFile(downloadPath, { dir: extractDir });
128
- let assetPath = '';
129
- // If resolvedAssetName is specified, look for it in the extracted directory
130
- if (resolvedAssetName) {
131
- assetPath = path.join(extractDir, resolvedAssetName);
132
- try {
133
- await fs.access(assetPath);
134
- return { resolvedVersion: version, resolvedPath: assetPath };
135
- }
136
- catch (error) {
137
- throw new Error(`Asset ${resolvedAssetName} not found in extracted directory ${extractDir}`);
138
- }
139
- }
140
- else {
141
- assetPath = path.join(extractDir, path.basename(pattern, '.zip') + '.tgz');
142
- }
143
- // If no specific asset is required, return the extraction directory
144
- return { resolvedVersion: version, resolvedPath: extractDir };
145
- }
146
- return { resolvedVersion: version, resolvedPath: downloadPath };
147
- }
148
- /**
149
- * Helper to handle artifact registry downloads
150
- * @param requirement The requirement configuration
151
- * @param registry The artifacts registry configuration
152
- * @returns The registry URL
153
- */
154
- async handleArtifactsRegistry(requirement, registry) {
155
- if (!registry) {
156
- throw new Error('Artifacts registry configuration is required');
157
- }
158
- const { registryUrl, assetName } = registry;
159
- if (!registryUrl) {
160
- throw new Error('Registry URL is required for artifacts downloads');
161
- }
162
- return registryUrl;
163
- }
164
- /**
165
- * Helper to handle local path registry
166
- * @param requirement The requirement configuration
167
- * @param registry The local registry configuration
168
- * @returns The local path or extracted asset path
169
- */
170
- async handleLocalRegistry(requirement, registry) {
171
- if (!registry) {
172
- throw new Error('Local registry configuration is required');
173
- }
174
- const { localPath, assetName } = registry;
175
- if (!localPath) {
176
- throw new Error('Local path is required for local registry');
177
- }
178
- // Verify the local path exists
179
- try {
180
- await fs.access(localPath);
181
- }
182
- catch (error) {
183
- throw new Error(`Local path ${localPath} does not exist or is not accessible`);
184
- }
185
- // If the path is a zip file and assetName is specified, extract it
186
- if (localPath.endsWith('.zip') && assetName) {
187
- const extractDir = path.join(this.downloadsDir, path.basename(localPath, '.zip'));
188
- await fs.mkdir(extractDir, { recursive: true });
189
- // Extract the zip file
190
- await extractZipFile(localPath, { dir: extractDir });
191
- // Find the asset in the extracted directory
192
- const assetPath = path.join(extractDir, assetName);
193
- try {
194
- await fs.access(assetPath);
195
- return assetPath;
196
- }
197
- catch (error) {
198
- throw new Error(`Asset ${assetName} not found in extracted directory ${extractDir}`);
199
- }
200
- }
201
- return localPath;
202
- }
203
- async fileExists(filePath) {
204
- try {
205
- await fs.access(filePath);
206
- return true;
207
- }
208
- catch {
209
- return false;
210
- }
211
- }
212
- /**
213
- * Get the latest version available for a GitHub repository
214
- * @param repository The GitHub repository in format 'owner/repo'
215
- * @returns The latest version or tag
216
- */
217
- async getGitHubLatestVersion(repository) {
218
- try {
219
- // Use GitHub CLI to get the latest release
220
- const { stdout } = await this.execPromise(`gh release view --repo ${repository} --json tagName --jq .tagName`);
221
- const latestTag = stdout.trim();
222
- // Remove 'v' prefix if present
223
- return latestTag.startsWith('v') ? latestTag.substring(1) : latestTag;
224
- }
225
- catch (error) {
226
- // If gh command fails, try to get the latest tag
227
- const { stdout } = await this.execPromise(`git ls-remote --tags --refs https://github.com/${repository}.git | sort -t '/' -k 3 -V | tail -n 1 | awk -F/ '{print $3}'`);
228
- let latestTag = stdout.trim();
229
- // Remove 'v' prefix if present
230
- return latestTag.startsWith('v') ? latestTag.substring(1) : latestTag;
231
- }
232
- }
233
- /**
234
- * Get the latest version available for an NPM package
235
- * @param packageName The name of the NPM package
236
- * @returns The latest version
237
- */
238
- async getNpmLatestVersion(packageName) {
239
- const { stdout } = await this.execPromise(`npm view ${packageName} version`);
240
- return stdout.trim();
241
- }
242
- /**
243
- * Get the latest version available for a pip package
244
- * @param packageName The name of the pip package
245
- * @returns The latest version
246
- */
247
- async getPipLatestVersion(packageName, options) {
248
- const pythonCmd = options?.settings?.pythonEnv || 'python';
249
- const { stdout } = await this.execPromise(`${pythonCmd} -m pip index versions ${packageName} --pre=0 | grep -oP "(?<=Latest:\\s)[^\\s]+" | head -1`);
250
- return stdout.trim();
251
- }
252
- }
253
- //# sourceMappingURL=BaseInstaller.js.map
@@ -1,23 +0,0 @@
1
- import { ServerOperationResult, ServerInstallOptions } from '../types.js';
2
- export declare class ClientInstaller {
3
- private categoryName;
4
- private serverName;
5
- private clients;
6
- private configProvider;
7
- private operationStatuses;
8
- constructor(categoryName: string, serverName: string, clients: string[]);
9
- private generateOperationId;
10
- private getNpmPath;
11
- /**
12
- * Check if a command is available on the system
13
- * @param command The command to check
14
- * @returns True if the command is available, false otherwise
15
- */
16
- private isCommandAvailable;
17
- private installClient;
18
- private processInstallation;
19
- private installClientConfig;
20
- private updateClineOrMSRooSettings;
21
- private updateGithubCopilotSettings;
22
- install(options: ServerInstallOptions): Promise<ServerOperationResult>;
23
- }