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
@@ -6,9 +6,12 @@ import { SUPPORTED_CLIENT_NAMES } from '../core/metadatas/constants.js';
6
6
  import { serverService } from '../services/ServerService.js';
7
7
  import { feedOnboardService } from '../core/onboard/FeedOnboardService.js';
8
8
  import { openBrowser } from '../utils/osUtils.js';
9
- import { Logger } from '../utils/logger.js';
9
+ import { Logger, EventType, EventStatus } from '../utils/logger.js';
10
10
  import { configProvider } from '../core/loaders/ConfigurationProvider.js';
11
11
  import { onboardStatusManager } from '../core/onboard/OnboardStatusManager.js';
12
+ import { InstallOperationManager } from '../core/loaders/InstallOperationManager.js';
13
+ import { systemSettingsManager } from '../core/loaders/SystemSettingsManager.js';
14
+ import { getAppVersion } from '../utils/versionUtils.js';
12
15
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
13
16
  const app = express();
14
17
  // Middleware
@@ -252,6 +255,31 @@ app.get('/api/categories/:categoryName/onboard/status', async (req, res) => {
252
255
  });
253
256
  }
254
257
  });
258
+ // Get installation operation status
259
+ app.get('/api/categories/:categoryName/servers/:serverName/installation/status', async (req, res) => {
260
+ try {
261
+ const { categoryName, serverName } = req.params;
262
+ const details = await InstallOperationManager.getInstance(categoryName, serverName).getDetails();
263
+ if (!details) {
264
+ return res.status(404).json({
265
+ success: false,
266
+ error: `No installation operation found for server ${serverName} in category ${categoryName}`
267
+ });
268
+ }
269
+ const response = {
270
+ success: true,
271
+ data: details
272
+ };
273
+ res.json(response);
274
+ }
275
+ catch (error) {
276
+ const message = error instanceof Error ? error.message : 'Unknown error';
277
+ res.status(500).json({
278
+ success: false,
279
+ error: `Failed to get installation operation status for server ${req.params.serverName} in category ${req.params.categoryName}: ${message}`
280
+ });
281
+ }
282
+ });
255
283
  // Uninstall tools from a server
256
284
  app.post('/api/categories/:categoryName/uninstall', async (req, res) => {
257
285
  try {
@@ -290,6 +318,60 @@ app.post('/api/categories/:categoryName/uninstall', async (req, res) => {
290
318
  });
291
319
  }
292
320
  });
321
+ // System Settings API
322
+ app.get('/api/settings', async (req, res) => {
323
+ try {
324
+ const settings = await systemSettingsManager.getSystemSettings();
325
+ const response = {
326
+ success: true,
327
+ data: settings
328
+ };
329
+ res.json(response);
330
+ }
331
+ catch (error) {
332
+ const message = error instanceof Error ? error.message : 'Unknown error';
333
+ res.status(500).json({
334
+ success: false,
335
+ error: `Failed to get system settings: ${message}`
336
+ });
337
+ }
338
+ });
339
+ app.post('/api/settings', async (req, res) => {
340
+ try {
341
+ const newSettings = req.body;
342
+ const updatedSettings = await systemSettingsManager.createOrUpdateSystemSettings(newSettings);
343
+ const response = {
344
+ success: true,
345
+ data: updatedSettings
346
+ };
347
+ res.json(response);
348
+ }
349
+ catch (error) {
350
+ const message = error instanceof Error ? error.message : 'Unknown error';
351
+ res.status(500).json({
352
+ success: false,
353
+ error: `Failed to update system settings: ${message}`
354
+ });
355
+ }
356
+ });
357
+ // API to get package version
358
+ app.get('/api/version', async (req, res) => {
359
+ try {
360
+ const appVersionData = await getAppVersion();
361
+ const response = {
362
+ success: true,
363
+ data: appVersionData
364
+ };
365
+ res.json(response);
366
+ }
367
+ catch (error) {
368
+ const message = error instanceof Error ? error.message : 'Unknown error';
369
+ res.status(500).json({
370
+ success: false,
371
+ error: `Failed to get package version: ${message}`
372
+ });
373
+ }
374
+ });
293
375
  export async function startWebServer(port = 3000) {
294
376
  return new Promise((resolve, reject) => {
295
377
  const server = app.listen(port, () => {
@@ -299,9 +381,19 @@ export async function startWebServer(port = 3000) {
299
381
  openBrowser(url).catch(err => {
300
382
  console.warn(`Failed to open browser: ${err.message}`);
301
383
  });
384
+ // Track IMCP serve event
385
+ Logger.trackEvent(EventType.IMCP_SERVE, {
386
+ status: EventStatus.SUCCESS,
387
+ port: port,
388
+ });
302
389
  resolve();
303
390
  });
304
391
  server.on('error', (error) => {
392
+ Logger.trackEvent(EventType.IMCP_SERVE, {
393
+ status: EventStatus.FAILED,
394
+ errorMessage: error instanceof Error ? error.message : String(error),
395
+ port: port
396
+ });
305
397
  reject(error);
306
398
  });
307
399
  });
@@ -15,8 +15,6 @@ The JavaScript logic is modularized into several files within `src/web/public/js
15
15
  - **`publishHandler.js`**: Manages the publishing process. This includes initiating publish requests (`handlePublish`), and utilizing shared functions from `validationHandlers.js` for polling status and displaying results.
16
16
  - **`templates.js`**: Contains HTML string templates for dynamically generated form sections (e.g., server items, environment variables, requirements).
17
17
  - **`state.js`**: Manages client-side state, primarily counters for dynamically added elements (servers, env vars per server, requirements per server).
18
- - **`templates.js`**: Contains HTML string templates for dynamically generated form sections (e.g., server items, environment variables, requirements).
19
- - **`state.js`**: Manages client-side state, primarily counters for dynamically added elements (servers, env vars per server, requirements per server).
20
18
 
21
19
  ---
22
20
 
@@ -73,7 +71,7 @@ Located in `formProcessor.js`, this function populates the HTML form using a `Fe
73
71
  - **Environment Variables:** Iterates `server.installation.env`, calls `window.addEnvVariable()` for each, and populates its fields.
74
72
  - **Package Dependencies:**
75
73
  - Iterates through `server.dependencies.requirements` (which are `{name, version, order}` objects, referred to as `depReq`).
76
- - For each `depReq`, searches the top-level `feedConfig.requirements` array to find the corresponding full `RequirementConfig` object (`fullReq`) by matching `fullReq.name === depReq.name` AND `fullReq.version === depReq.version`.
74
+ - For each `depReq`, searches the top-level `feedConfig.requirements` array to find the corresponding full `RequirementConfig` object (`fullReq`) by matching `fullReq.name === depReq.name`.
77
75
  - If `fullReq` is found, `window.addServerRequirement()` is called to create the UI block for this requirement within the server.
78
76
  - All fields of the requirement (`type`, `version`, `alias`, `registry` details) are then populated using data from `fullReq` and `depReq.order`.
79
77
  - Conditional UI elements (alias field, specific registry config sections) are toggled based on the requirement's type and selected registry.
@@ -197,132 +195,22 @@ This summary covers the main design patterns and implementation choices made for
197
195
 
198
196
  ---
199
197
 
200
- ## 9. Recent Fixes and Changes (May 2025)
198
+ ## 9. Recent Changes (May 2025)
201
199
 
202
- This section documents significant fixes and behavior changes implemented recently.
203
-
204
- - **Visibility of Existing Category Servers:**
200
+ - **Requirement Lookup in `populateForm`:**
201
+ Requirement lookup for server dependencies now matches by `name` only (not `name` and `version`).
205
202
 
206
- - **Issue:** When selecting an existing category in the "Create Server in Existing Category" tab, the container holding the list of existing MCP servers (`existingCategoryMcpServersContainer`) and the servers themselves were not becoming visible, even though the data was being fetched and `populateForm` was called.
207
- - **Root Cause Analysis:** Extensive logging revealed that `existingCategoryMcpServersContainer` was being correctly unhidden before `populateForm` was called. However, immediately after `populateForm` completed, the container was found to be hidden again. The exact mechanism causing this re-hiding was elusive but seemed to occur synchronously within or immediately after `populateForm`'s execution, despite `populateForm` itself not directly hiding the container. Standard form reset (`form.reset()`) was ruled out as the cause.
208
- - **Solution:**
209
- 1. In `templates.js`, the `serverTemplate` was modified to ensure that the main content `div` of a server item (`server-content-${serverIndex}`) includes the `hidden` class by default. This allows the `toggleSectionContent` function to correctly manage its visibility.
210
- 2. In `uiHandlers.js`, within the `addServer` function, if a server is being rendered as `isReadOnly` (i.e., an existing server), its content section (`#server-content-${newServerIndex}`) is explicitly made visible by removing the `hidden` class. This ensures that existing servers are expanded by default when displayed.
211
- 3. **Crucially**, in `index.js`, within the `handleExistingCategorySelection` function, after `populateForm` is called to display the existing servers, a line was added to explicitly call `mcpServersContainer.classList.remove('hidden');`. This ensures that the main container for these servers is visible, overriding whatever was causing it to become hidden.
212
- - **Outcome:** Existing servers for a selected category are now correctly displayed and visible.
203
+ - **UI and Validation Improvements:**
213
204
 
214
- - **Requirement Lookup in `populateForm`:**
205
+ - Unique IDs are used for validation panels and buttons per tab to avoid cross-tab issues.
206
+ - Switching between tabs and view modes now preserves form data and ensures correct UI state.
207
+ - The JSON editor view is now properly toggled and content is preserved as expected.
208
+ - Polling for operation status (validation/publish) is more robust and status checks are case-insensitive.
209
+ - Progress steps for operations are now shown in a collapsible section for better feedback.
215
210
 
216
- - **Issue:** The logic in `formProcessor.js` (`populateForm`) for finding the full `RequirementConfig` for a server's dependency was matching on both `name` and `version`.
217
- - **Change Request:** The lookup should only be based on the requirement `name`, ignoring the `version` specified in the server's dependency list when matching against the global `feedConfig.requirements`.
218
- - **Solution:** In `formProcessor.js`, the line:
219
- `const fullReq = (feedConfig.requirements || []).find(r => r.name === depReq.name && r.version === depReq.version);`
220
- was changed to:
221
- `const fullReq = (feedConfig.requirements || []).find(r => r.name === depReq.name);`
222
- The associated warning message was also updated to reflect this change in lookup behavior.
223
-
224
- - **Code Cleanup:**
225
-
226
- - All diagnostic `console.log` statements added during the debugging of the visibility issue were removed from `index.js`, `formProcessor.js`, and `uiHandlers.js`.
227
- - The experimental `requestAnimationFrame` logic for forcing a reflow in `formProcessor.js` was removed as it was not the solution to the visibility problem.
228
-
229
- - **Tab Switching and View Mode Toggling Enhancements:**
230
-
231
- - **Context:** A series of changes were made to improve the user experience related to switching between the main onboarding tabs ("Create New Category", "Create Server in Existing Category") and toggling between the Form view and JSON editor view.
232
- - **Issues Addressed & Solutions:**
233
- 1. **JSON View Buttons Hidden (`uiHandlers.js`):**
234
- - **Problem:** Buttons like "Cancel" and "Publish JSON" were visible in the JSON editor view, which was not desired.
235
- - **Solution:** The `toggleViewMode` function in `uiHandlers.js` was updated to explicitly hide the `jsonEditorActionsContainer` when switching to JSON view.
236
- 2. **JSON View Content Preservation (`uiHandlers.js`):**
237
- - **Problem:** Clicking the JSON view toggle switch again while already in JSON view would cause the editor's content to be re-processed or cleared.
238
- - **Solution:** The `toggleViewMode` function in `uiHandlers.js` now checks if the target view (Form or JSON) is already active. If so, it returns early, preventing unnecessary re-rendering and preserving the current content.
239
- 3. \*\*Tab Switching Logic Improvements (`index.js`):
240
- - **Problem 1:** Clicking on a main navigation tab that was already active would still trigger tab switching logic, potentially causing unnecessary view updates.
241
- - **Solution 1:** The `switchTab` function in `index.js` now checks if the `targetTab` is the same as the `activeTab`. If so, it returns immediately.
242
- - **Problem 2:** When switching away from the "Create New Category" tab and then back to it (without being in an edit-category scenario), any entered form data was lost due to an automatic form reset.
243
- - **Solution 2:** The automatic call to `resetOnboardFormDynamicContent('onboardForm')` within `switchTab` for the "Create New Category" tab (in non-edit scenarios) was removed. This allows form data to be preserved when tabbing away and back.
244
- - **Problem 3:** If the JSON view was active and a user clicked on a different main navigation tab, the new tab's form content could render on top of or alongside the still-visible JSON editor.
245
- - **Solution 3:** The `switchTab` function in `index.js` was updated. If the JSON view is active when a tab switch is initiated, it now first calls `toggleViewMode(false, ...)` to programmatically switch back to the Form view (for the currently active tab) before proceeding to display the content of the newly selected tab. This ensures a clean transition from JSON view to the new tab's form view.
246
- - **Outcome:** These changes provide a more stable, predictable, and user-friendly experience when navigating between tabs and view modes. Data entered by the user is better preserved, and UI rendering artifacts during transitions are avoided.
247
-
248
- - **Dropdown Reset, Form Disappearance, and Misplaced Validation (May 2025 - Current Session):**
249
- - **Context:** A series of interconnected issues were addressed to improve the stability and correctness of the "Create New Server in Existing Category" tab and its interaction with view toggling and validation.
250
- - **Issues Addressed & Solutions:**
251
- 1. **Existing Category Dropdown Reset (`formProcessor.js`):**
252
- - **Problem:** After selecting a category from the `existingCategorySelect` dropdown on the "Create New Server in Existing Category" tab, the dropdown would immediately reset to its default "Select a category" or "Loading..." state.
253
- - **Root Cause:** The `populateForm` function, called upon category selection, invoked `resetOnboardFormDynamicContent`. Inside `resetOnboardFormDynamicContent`, the line `formToReset.reset()` was being called for the `onboardServerForm` (the form containing the dropdown). This `HTMLFormElement.reset()` method reverts all form controls to their initial HTML values.
254
- - **Solution:** The `resetOnboardFormDynamicContent` function in `formProcessor.js` was modified. The `formToReset.reset()` call is now conditional: it is skipped if `formId` is `'onboardServerForm'`, thus preserving the dropdown's selected value. Other dynamic content clearing (server list, counters) within the function remains active.
255
- 2. **Form Disappearance on JSON Toggle (Existing Category Tab - `formProcessor.js`):**
256
- - **Problem:** On the "Create New Server in Existing Category" tab, if a category was selected (displaying its basic info and servers), then the view was toggled to JSON and back to Form view, the displayed category information would vanish.
257
- - **Root Cause:** When `toggleViewMode` (in `uiHandlers.js`) switched from JSON back to Form view, it called `populateForm`. However, `populateForm` lacked specific logic to re-populate the basic category information fields (name, display name, description, repository) for the `onboardServerForm`. Additionally, the containers for this basic info (`existingCategoryBasicInfoContainer`) and the MCP servers (`existingCategoryMcpServersContainer`) were not being explicitly made visible again after `resetOnboardFormDynamicContent` (called by `populateForm`) might have hidden them or cleared their content.
258
- - **Solution:**
259
- - An `else if (formId === 'onboardServerForm' && feedConfig)` block was added to `populateForm` in `formProcessor.js`. This block now explicitly populates the read-only basic category information fields using the `feedConfig` data.
260
- - Within this new block, `existingCategoryBasicInfoContainer.classList.remove('hidden')` and `existingCategoryMcpServersContainer.classList.remove('hidden')` are called to ensure these sections are visible.
261
- 3. **Validation Results on Wrong Tab (Multiple Files):**
262
- - **Problem:** Clicking the "Validate" button on the "Create New Server in Existing Category" tab would display the validation results in the validation panel of the "Create New Category" tab.
263
- - **Root Cause:** Validation panels, content areas, and buttons on both tabs shared common HTML IDs (e.g., `validationStatusPanel`, `validateButton`). JavaScript's `getElementById` would typically find the first matching element in the DOM, leading to the incorrect panel being targeted.
264
- - **Solution (Multi-file update):**
265
- - **HTML (`onboard.html`):** All relevant validation-related element IDs were made unique for each tab (e.g., `validationStatusPanelNewCategory`, `validateButtonNewCategory`, `validationStatusPanelExistingCategory`, `validateButtonExistingCategory`).
266
- - **Event Listeners (`index.js`):** Event listeners for the "Validate" buttons were updated to target these new unique IDs.
267
- - **Validation Logic (`validationHandlers.js`):**
268
- - The `handleValidation` function was updated to accept `activeTab` and `currentSelectedCategoryData` as parameters. It now dynamically determines the correct, unique element IDs for the panel, content area, form, validate button, and publish button based on the `activeTab`.
269
- - The `pollValidationStatus` function was modified to accept these dynamic element IDs as parameters, ensuring it updates the UI on the correct tab during polling.
270
- - The call to `getFormData` within `handleValidation` was adjusted to pass the `forExistingCategoryTab` flag and `currentSelectedCategoryData` when validating for the "Create Server in Existing Category" tab.
271
- - **Form Reset Logic (`formProcessor.js`):**
272
- - The `resetOnboardFormDynamicContent` function was updated. When resetting validation panels, it now determines the correct unique panel ID and content ID based on the `formId` parameter, ensuring it hides and clears the appropriate panel for the active tab.
273
- - **Outcome:** These fixes ensure that the "Create New Server in Existing Category" tab functions correctly with respect to category selection, view toggling, and validation display, providing a more robust and intuitive user experience.
274
-
275
- - **API Data Integrity and UI State for "Create Server" Tab (May 2025 - Current Session):**
276
- - **Context:** Two issues were addressed related to the "Create Server in Existing Category" tab's interaction with backend APIs and UI feedback during operations.
277
- - **Issues Addressed & Solutions:**
278
- 1. **Incomplete Data Sent to API:**
279
- - **Problem:** When using the "Validate" or "Publish" buttons on the "Create Server in Existing Category" tab, only the data for the newly added server(s) was being sent to the backend, omitting the data of the existing category to which they were being added.
280
- - **Solution:**
281
- - The `handleValidation` function in `validationHandlers.js` was updated. It now retrieves the new server data using `getFormData` and then merges it with the `currentSelectedCategoryData` (the full data of the existing category) before sending the combined `FeedConfiguration` to the `/api/categories/onboard/validate` endpoint.
282
- - Similarly, the `handlePublish` function in `publishHandler.js` was updated to perform the same merge of new server data with `currentSelectedCategoryData` before sending the complete payload to the `/api/categories/onboard` endpoint.
283
- - **Outcome:** The backend now receives the full, correct `FeedConfiguration` when a new server is validated or published within an existing category.
284
- 2. **Persistent Spinner on Publish Failure:**
285
- - **Problem:** If a publish operation failed (e.g., backend returns a "FAILED" status), the "Publish" button would remain in its loading state (displaying a spinner icon) instead of reverting to its active state.
286
- - **Root Cause:** The status check within the `pollOperationStatus` function (in `validationHandlers.js`) was case-sensitive when comparing the received status string (e.g., "failed") against expected terminal states (e.g., "FAILED"). If the casing didn't match, the logic to reset button states wasn't triggered.
287
- - **Solution:**
288
- - The `pollOperationStatus` function in `validationHandlers.js` was modified to convert the received status string to uppercase before comparing it against 'COMPLETED', 'FAILED', or 'SUCCEEDED'. This makes the check case-insensitive.
289
- - Additionally, the direct error/failure handling paths within `handlePublish` (in `publishHandler.js`) were enhanced to ensure both "Publish" and "Validate" buttons are comprehensively reset (disabling, innerHTML, and opacity classes) if the initial publish call itself fails or returns a terminal status immediately.
290
- - **Outcome:** The "Publish" and "Validate" buttons now reliably revert to their default active states when an operation (validation or publish) concludes with a failure, regardless of the casing of the status string from the backend or whether the failure occurs immediately or during polling.
291
- - **Overall Outcome:** These changes improve the reliability of data submission and provide more accurate UI feedback for asynchronous operations on the "Create Server in Existing Category" tab.
292
-
293
- - **Enhanced Operation Status Polling and Display (May 2025 - Current Session):**
294
- - **Context:** Significant improvements were made to the handling of asynchronous operations (validation and publishing), including more detailed progress display, robust polling, and clearer API interactions.
295
- - **Issues Addressed & Solutions:**
296
- 1. **Server-Side API (`server.ts` - `/api/categories/:categoryName/onboard/status`):**
297
- - The endpoint now requires an `operationType` query parameter (e.g., `VALIDATION_ONLY`, `FULL_ONBOARDING`).
298
- - The response payload (`OperationStatus`) was enhanced to include:
299
- - `steps`: An array of objects detailing each step of the operation (name, serverName, timestamp, status, errorMessage).
300
- - `operationType`: Reflects the type of operation being tracked, taken from the status object.
301
- - `feedConfiguration`: Conditionally included for successful `VALIDATION_ONLY` operations if present in the result.
302
- - The `onboardingId` in the response is `categoryName_operationType`.
303
- - The `message` field in the response now prioritizes the last step's name or an overall error message.
304
- 2. **Client-Side Polling Logic (`validationHandlers.js` - `pollOperationStatus`):**
305
- - The function now accepts an `operationType` parameter, which is passed to the API.
306
- - It returns a boolean promise (`Promise<boolean>`) indicating whether polling should continue, allowing the caller (`handleValidation` or `handlePublish`) to manage `clearInterval`.
307
- - Calls `ensureProgressToggleListener` to ensure the UI for displaying progress steps is interactive.
308
- - Status comparisons (`COMPLETED`, `FAILED`, `SUCCEEDED`) are now case-insensitive.
309
- 3. **Operation Initiation (`publishHandler.js` - `handlePublish`, `validationHandlers.js` - `handleValidation`):**
310
- - When initiating polling, these functions now pass the correct `operationType` (`FULL_ONBOARDING` for publish, `VALIDATION_ONLY` for validate) and use the original `finalFeedConfiguration.name` as the `categoryName` for the polling request.
311
- - They now manage `clearInterval` based on the boolean returned by `pollOperationStatus`.
312
- - Both handlers call `ensureProgressToggleListener` at the beginning to prepare the UI for status updates.
313
- - `handlePublish` includes improved error handling for the initial publish request, ensuring UI elements are correctly updated even if the initial call fails or returns a terminal status.
314
- 4. **UI Display (`validationHandlers.js` - `updateOperationDisplay`):**
315
- - A new collapsible "Progress" section is displayed, showing detailed `steps` from the API response. Each step includes:
316
- - A status icon (error, in-progress spinner, success).
317
- - The step name, server name (if applicable), and timestamp.
318
- - An error message for the step, if any.
319
- - The visibility of the "Progress" section is managed by `ensureProgressToggleListener` (which attaches a click handler to the section header) and the `toggleSectionContent` utility.
320
- - The `operationType` is now displayed.
321
- - The logic for displaying the overall status spinner has been updated to cover more in-progress states (e.g., `PENDING`, `VALIDATING`, `PRCREATING`, `PUBLISHING`) and uses case-insensitive comparisons.
322
- 5. **Progress Section Toggling (`validationHandlers.js` - `ensureProgressToggleListener`):**
323
- - A new exported utility function, `ensureProgressToggleListener`, was added. It attaches a click event listener to the status content element. This listener delegates to `toggleSectionContent` (from `uiHandlers.js`) when the progress section header is clicked, allowing users to expand or collapse the detailed list of progress steps. The listener is attached only once per status content element.
324
- - **Outcome:** These changes provide users with more granular and interactive feedback on long-running operations, improve the robustness and accuracy of status polling, and align client-server communication for tracking asynchronous onboarding tasks.
325
- ---
211
+ - **General Cleanup:**
212
+ - Redundant diagnostic logs and experimental code were removed.
213
+ - Form reset logic was improved to avoid unwanted clearing of dropdowns or form fields.
326
214
 
327
215
  ## 10. Server Validation System
328
216
 
@@ -331,6 +219,7 @@ The server validation system consists of multiple components that work together
331
219
  ### Server Validator Architecture
332
220
 
333
221
  - **`IServerValidator` Interface**: Defines the common validation contract for all server validators:
222
+
334
223
  - `validateServer(server: McpConfig, config: FeedConfiguration): Promise<boolean>`
335
224
  - Implementations throw errors with descriptive messages when validation fails
336
225
 
@@ -342,6 +231,7 @@ The server validation system consists of multiple components that work together
342
231
  ### Validator Implementations
343
232
 
344
233
  1. **StdioServerValidator**:
234
+
345
235
  - Validates stdio-mode MCP server configurations
346
236
  - Key validation steps:
347
237
  - Verifies installation command exists and is executable
@@ -0,0 +1,136 @@
1
+ # Application Insights Telemetry Integration
2
+
3
+ This document describes the telemetry implementation in the MCP SDK using Azure Application Insights.
4
+
5
+ ## Overview
6
+
7
+ The MCP SDK integrates Azure Application Insights for telemetry tracking across various operations. This provides insights into server operations, requirement updates, and system health.
8
+
9
+ ## Implementation Details
10
+
11
+ ### TelemetryService
12
+
13
+ Located in `src/services/TelemetryService.ts`, this service provides a centralized interface for telemetry operations:
14
+
15
+ - Initialization with Application Insights configuration
16
+ - Event tracking
17
+ - Exception tracking
18
+ - Trace logging
19
+ - Metric tracking
20
+ - Data flushing capability
21
+
22
+ ```typescript
23
+ // Example usage:
24
+ TelemetryService.trackEvent("eventName", { property: "value" });
25
+ TelemetryService.trackException(error, { context: "operation" });
26
+ ```
27
+
28
+ ### Key Features
29
+
30
+ 1. **Cloud Role Tagging**: Services are tagged as 'imcp' for clear identification in Application Insights
31
+ 2. **Batch Processing**: Configured with a max batch size of 250 events
32
+ 3. **Automatic Error Handling**: Graceful handling of initialization failures
33
+
34
+ ## Integration Points
35
+ The telemetry service is integrated at key points throughout the system:
36
+
37
+ ### User Identity Tracking
38
+ - GitHub user information persistence for Mac/Linux systems
39
+ - Automatic alias extraction from Microsoft accounts
40
+ - Cross-platform username resolution (using OS username for Windows)
41
+
42
+ ### Server Operations
43
+ - Server installation/uninstallation tracking
44
+ - Operation success/failure monitoring
45
+ - Target client tracking
46
+
47
+ ### Requirement Management
48
+ - Requirement update tracking
49
+ - Version change monitoring
50
+ - Update operation status tracking
51
+
52
+ ### Feed Management
53
+ - Feed onboarding process monitoring
54
+ - Sync operations tracking
55
+ - Configuration changes tracking
56
+
57
+ ## Event Types
58
+
59
+ The system tracks several types of events:
60
+
61
+ 1. **Server Events**
62
+ - Installation (`SERVER_INSTALL`)
63
+ - Uninstallation (`SERVER_UNINSTALL`)
64
+
65
+ 2. **Requirement Events**
66
+ - Updates (`REQUIREMENT_UPDATE`)
67
+
68
+ 3. **Feed Events**
69
+ - Onboard (`FEED_ONBOARD`)
70
+ - Validate (`FEED_VALIDATE`)
71
+
72
+ 4 **IMCP Events**
73
+ - IMCP serve (`IMCP_SERVE`)
74
+
75
+ ## Best Practices
76
+ 1. **Error Tracking**
77
+ - Always include error messages in failed operations
78
+ - Track operation context with properties
79
+
80
+ 2. **Event Properties**
81
+ - Include relevant identifiers (categoryName, serverName)
82
+ - Track operation status
83
+ - Include version information when applicable
84
+ - Include user alias in events (automatically handled by Logger)
85
+
86
+ 3. **User Identity Persistence**
87
+ - Store GitHub user information (alias, name, email) for Mac/Linux users
88
+ - Skip persistence for Windows users (uses OS username)
89
+ - Only persist for Microsoft accounts (username ending with _microsoft)
90
+ - Cache user information to avoid repeated API calls
91
+ - Include version information when applicable
92
+
93
+ 4. **Performance Monitoring**
94
+ - Use metric tracking for performance-sensitive operations
95
+ - Implement proper batching for high-volume events
96
+
97
+ ## Configuration
98
+
99
+ The telemetry service is configured with:
100
+ - Azure resource: [imcp-telemetry](https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/b211ffce-ec5c-4267-b15c-138d440e3fbc/resourcegroups/aicoder/providers/microsoft.insights/components/imcp-telemetry/overview)
101
+ - Instrumentation Key: `c5fc06c7-a96c-4d80-9aff-bc9c933db0d1`
102
+ - Cloud Role: `imcp`
103
+ - Batch Size: 250 events
104
+
105
+ ## User Identity in Telemetry
106
+
107
+ The system implements user identity tracking through the Logger class (`src/utils/logger.ts`):
108
+
109
+ 1. **User Resolution**
110
+ - Windows: Uses OS username directly via `os.userInfo()`
111
+ - Mac/Linux: Uses GitHub alias stored in user info file
112
+ - Falls back to OS username if user info is unavailable
113
+
114
+ 2. **Identity Storage**
115
+ - Location: Stored in system-specific settings directory
116
+ - Format: JSON file containing alias, name, and email
117
+ - Updates: Managed during GitHub authentication
118
+
119
+ 3. **Identity Usage**
120
+ - All telemetry events automatically include username/alias
121
+ - Consistent user tracking across sessions
122
+ - Microsoft account validation ensures organizational identity
123
+
124
+ ## Future Improvements
125
+
126
+ 1. **Enhanced Metrics**
127
+ - Add performance metrics for key operations
128
+ - Implement custom metric dimensions
129
+
130
+ 2. **Error Analysis**
131
+ - Implement more detailed error categorization
132
+ - Add correlation IDs for related operations
133
+
134
+ 3. **User Analytics**
135
+ - Track user interaction patterns
136
+ - Monitor feature usage statistics
@@ -0,0 +1,26 @@
1
+ ru# Active Context
2
+
3
+ ## Current Focus
4
+
5
+ - [2025-05-16 09:22:21] - Task completed: Made "IMCP Server Manager" title in `src/web/public/index.html` clickable, linking to `index.html`.
6
+ - [YYYY-MM-DD HH:MM:SS] - Initializing Memory Bank.
7
+
8
+ ## Recent Changes
9
+
10
+ - [YYYY-MM-DD HH:MM:SS] - Created activeContext.md.
11
+ - [2025-05-16 13:28:00] - Refactored `InstallationService` to delegate requirement handling to the new `RequirementService`. Updated `RequirementService` to correctly handle `reqConfig` scoping and type fallbacks in `processRequirementUpdates`.
12
+
13
+ ## Open Questions/Issues
14
+
15
+ - None
16
+
17
+ [2025-05-16 16:07:29] - Current Focus: Completed redesign of installation operation status and polling. New InstallOperationManager and associated types/APIs implemented. Step recording integrated into relevant services and installers.
18
+ [2025-05-17 00:26:11] - Refactoring InstallOperationManager: Now instance-based per category/server, with new file structure for status persistence. Current focus is on updating all usages and ensuring compatibility with the new API and file layout.
19
+ [2025-05-17 15:02:39] - Current Focus: Completed refactoring of `RequirementService.ts` to use the new instance-based `InstallOperationManager` and its `recording`/`recordingAsync` methods. This aligns it with the updated `InstallOperationManager` architecture.
20
+ [2025-05-17 15:26:20] - Current focus: Refactored all requirement installer classes and factory to support InstallOperationManager step recording. All install methods now accept a recorder and log critical steps for install operations.
21
+ [2025-05-18 13:21:30] - Current Focus: Completed implementation of main modal refresh logic. This involved:
22
+ - Modifying `loadingModal.js` to dispatch a `refreshMainModalContent` event on close.
23
+ - Updating `installation.js` to store `categoryName` and `serverName` in `localStorage`.
24
+ - Adding an event listener in `modal.js` to retrieve these values and call `showInstallModal` with both parameters, resolving previous "Server configuration not found" errors.
25
+ - This replaces the previous page reload behavior, improving UX.
26
+ [2025-05-18 11:33:18] - Current Focus: Standardized all step recording names for installation/onboarding operations by introducing `src/core/metadatas/recordingConstants.ts`. This file now serves as the single source of truth for static step names and documents dynamic step name patterns, ensuring consistency across backend and frontend.
@@ -0,0 +1,91 @@
1
+ # Decision Log
2
+
3
+ This file records significant architectural or technical decisions, including rationale and implications.
4
+ Update this file with a timestamped entry whenever a major decision is made.
5
+
6
+ ---
7
+
8
+ ---
9
+
10
+ [2025-05-15 19:56:12] - Memory Bank updated to reflect onboarding page architecture and features as described in [`docs/ONBOARDING_PAGE_DESIGN.md`](../docs/ONBOARDING_PAGE_DESIGN.md).
11
+
12
+ - Modular JS architecture for onboarding UI, form-to-JSON, validation, publishing, and state.
13
+ - Central `FeedConfiguration` model for category/server/requirement data.
14
+ - Enhanced UX: dynamic sections, toggling, notifications, robust validation/publishing.
15
+ - Recent improvements: server visibility, requirement lookup, async feedback, tab/view handling.
16
+ [2025-05-15 20:48:27] - Implemented MCP Server Duplication Feature.
17
+ - Added a duplicate button to the right of the delete button in the server item template (`src/web/public/js/onboard/templates.js`).
18
+ - Modified `duplicateServer` function in `src/web/public/js/onboard/uiHandlers.js` to correctly retrieve data from the server to be duplicated, even if it's read-only. This was achieved by temporarily enabling form fields of the source server item before calling `getFormData`.
19
+ - Ensured that the duplicated server is always created as a new, editable server, and all its content (including environment variables and requirements) is copied from the original server.
20
+ - The `populateServerManually` function ensures that sub-items (env vars, requirements) of the duplicated server are also created in an editable state.
21
+ - This functionality applies to both "Create New Category" and "Create Server in Existing Category" tabs.
22
+ - Fixed the error "Could not retrieve data for the server to duplicate" when duplicating read-only servers.
23
+
24
+ [2025-05-16 00:34:40] - [Fixed duplicate server functionality]
25
+ - Issue: Duplicating non-first servers failed with "Could not retrieve data" error
26
+ - Fix: Modified duplicateServer() to temporarily enable ALL disabled fields before form submission
27
+ - Impact: Ensures complete server data is captured regardless of position in list
28
+ - Files affected: src/web/public/js/onboard/uiHandlers.js
29
+ [2025-05-16 13:27:43] - Refactored requirement management logic from `InstallationService` into a new dedicated `RequirementService`. `InstallationService` now delegates requirement-related tasks (checking status, installing, updating) to `RequirementService`. This improves separation of concerns and modularity.
30
+
31
+ [2025-05-16 16:07:20] - Redesigned the operation status and polling mechanism for Installation in both frontend and backend. This involved creating a new InstallOperationManager, new types for operation details, an API endpoint for status retrieval, and integrating step recording into InstallationService, RequirementService, and BaseClientInstaller. This provides more granular tracking of installation progress.
32
+
33
+ [2025-05-16 16:50:05] - Added 'overallStatus' to InstallOperationDetails and updated InstallOperationManager to manage it. Modified frontend polling in 'src/web/public/js/modal/installation.js' to use the new installation status API and display detailed steps.
34
+
35
+ [2025-05-16 17:03:17] - Enhanced the display of installation steps in the loading modal. Modified 'messageQueue.js' to support step-specific formatting (icons, success/failure states) and updated 'installation.js' to pass these options. Added CSS in 'modal.css' for the new step display styles.
36
+
37
+ [2025-05-16 17:08:31] - Refined installation step display: made fonts smaller, increased compactness, and added timestamps for each step. Updated 'modal.css' and 'messageQueue.js' accordingly. 'installation.js' now passes the timestamp.
38
+
39
+ [2025-05-16 17:19:37] - Overhauled the installation loading modal UI. 'loadingModal.js' now dynamically creates a new structure with an overall status (icon + text) and a detailed steps list. 'installation.js' was updated to use new functions in 'loadingModal.js' for status and step updates. 'messageQueue.js' was simplified as direct DOM manipulation for steps is now in 'loadingModal.js'. Added extensive CSS in 'modal.css' for the new layout and styling.
40
+
41
+ [2025-05-16 17:23:42] - Fixed error caused by removed 'delayedAppendInstallLoadingMessage'. Updated 'modalSetup.js' and 'installation.js' (uninstallTools function) to use the new 'updateOverallInstallStatus' from 'loadingModal.js' for general status messages during uninstallation.
42
+
43
+ [2025-05-16 17:26:13] - Final fix for 'delayedAppendInstallLoadingMessage' error: removed unused import from 'installModal.js'.
44
+
45
+ [2025-05-16 17:29:59] - Corrected 'src/web/public/js/modal/index.js' barrel file: removed imports and re-exports of 'delayedAppendInstallLoadingMessage' and 'appendInstallLoadingMessage' as they no longer exist. Added new exports for 'updateOverallInstallStatus' and 'addInstallationStep'.
46
+
47
+ [2025-05-16 17:31:35] - Corrected 'src/web/public/js/modal.js' (another barrel file): removed import and global assignment of 'appendInstallLoadingMessage'. Added missing exports for 'showInstallLoadingModal' and 'hideInstallLoadingModal'.
48
+
49
+ [2025-05-16 17:46:59] - Implemented reset of installation operation status. Added `resetOperation` method to `InstallOperationManager.ts` to delete existing status for a server. Called this method at the beginning of `InstallationService.ts#install` to ensure a clean state for new installations.
50
+
51
+ [2025-05-16 17:51:01] - UI adjustments for installation loading modal:
52
+ - Added a close button (X) to the top-right corner with functionality to hide the modal.
53
+ - Ensured installation steps are explicitly left-aligned using `justify-content: flex-start`.
54
+ - Modified the 'completed' status icon to be a checkmark within a green circle.
55
+ - Reviewed and confirmed the 'in-progress' spinner icon.
56
+
57
+ [2025-05-16 17:53:42] - Refined step message alignment in installation loading modal: Added `align-items: flex-start` and `text-align: left` to `.step-info`, and `text-align: left` with `width: 100%` to `.step-message` in `modal.css` to ensure text content is fully left-aligned.
58
+
59
+ [2025-05-16 17:55:32] - UI adjustment for installation loading modal: Removed the "Details" header text from above the steps list in `loadingModal.js`.
60
+
61
+ [2025-05-16 17:57:02] - Corrected removal of "Details" header in installation loading modal: Entire line `<div class="steps-list-header">Details</div>` was removed from `loadingModal.js` instead of being commented out with an invalid HTML comment.
62
+
63
+ [2025-05-17 00:26:02] - Refactored InstallOperationManager to require categoryName and serverName in the constructor, removed singleton/static pattern, and changed status file storage to per-category/server at Settings_Dir/InstallOperationStatus/CategoryName/ServerName.json. This enables instance-based management and more granular status persistence.
64
+
65
+ [2025-05-17 15:02:27] - Refactored `RequirementService.ts` to use instance-based `InstallOperationManager`.
66
+ - The `processRequirementUpdates` and `checkAndInstallRequirements` (including its helper `installRequirementsInBackground`) methods in [`src/services/RequirementService.ts`](src/services/RequirementService.ts:0) were updated.
67
+ - They now obtain an `InstallOperationManager` instance using `InstallOperationManager.getInstance(categoryName, serverName)`.
68
+ - The core logic within these methods, and the individual requirement processing loops, are now wrapped with `iom.recording()` or `iom.recordingAsync()` for robust step tracking and error handling.
69
+ - This change aligns `RequirementService.ts` with the new instance-based, per-category/server architecture of `InstallOperationManager` introduced in [2025-05-17 00:26:02].
70
+ - Rationale: Simplifies step recording, centralizes status management within the `InstallOperationManager` instance, and improves consistency across services.
71
+ - Implications: Removed direct calls to the deprecated global `installOperationManager.recordStep` and adopted the more structured `recording` pattern.
72
+
73
+ [2025-05-17 15:26:09] - Updated all requirement installer classes and interface to support step recording via InstallOperationManager. All install methods now accept an optional recorder and record critical steps using recordStep/recording.
74
+
75
+ [2025-05-18 13:21:30] - Implemented main modal refresh on loading modal close, replacing page reload.
76
+ - Rationale: Improve UX by maintaining main modal context and avoiding disruptive page reloads after installation/uninstallation operations shown in the loading modal.
77
+ - Implementation Details:
78
+ - `src/web/public/js/modal/loadingModal.js`: Modified `hideInstallLoadingModal` to dispatch a custom event `refreshMainModalContent` instead of causing a page reload.
79
+ - `src/web/public/js/modal/installation.js`: Modified `handleBulkClientInstall` to store `categoryName` as `lastSelectedCategory` and `serverName` as `lastSelectedServerName` in `localStorage` when an installation process begins. This ensures the context is available for the refresh.
80
+ - `src/web/public/js/modal.js`: Added an event listener for `refreshMainModalContent`. This listener retrieves `lastSelectedCategory` and `lastSelectedServerName` from `localStorage`. If both are valid, it calls `window.showInstallModal(lastSelectedCategory, lastSelectedServerName)` to refresh the content of the main installation modal.
81
+ - Debugging: Iteratively refined the logic in `modal.js` to correctly handle and validate `lastSelectedCategory` and `lastSelectedServerName` to prevent errors when calling `showInstallModal`. This was crucial for ensuring `showInstallModal` received the necessary `serverName` argument, resolving "Server configuration not found" errors.
82
+ [2025-05-18 11:33:12] - Added `src/core/metadatas/recordingConstants.ts` as the canonical source for all step recording names used in installation and onboarding operations. This file centralizes all static step names as constants and documents dynamic step name patterns, improving consistency and discoverability for step-based operation tracking across backend and frontend.
83
+
84
+ [2025-05-18 20:46:46] - Reduced the height and key size in the System Environment Variables section of the settings UI for a more compact and modern appearance. This involved decreasing row padding, shrinking the key column width, and reducing the key font size in `src/web/public/js/settings.js`.
85
+
86
+ [2025-05-18 21:00:26] - Macro resolution logic updated: Now resolves macro values (${PYTHON_PACKAGE}, ${NPMPATH}, ${BROWSER_PATH}) by first checking SystemSettingsManager (system settings), and only falls back to previous behavior if not found. This centralizes macro configuration and improves consistency across the system.
87
+
88
+ [2025-05-19 00:14:06] - Updated settings page UI and functionality:
89
+ - Removed "NPM Global Package Path" field from `src/web/public/settings.html` and `src/web/public/js/settings.js`.
90
+ - Added a descriptive prompt "Stored and used for mcp server installation environments." with a question icon (`bx-help-circle`) on the same line as the "User Configurations" title in `src/web/public/settings.html`.
91
+ - Modified `src/web/public/js/settings.js` to render user configuration values as `type="password"` if the key contains "key". Added an eye icon button *inside* the value input field to toggle visibility for these password fields, maintaining original input box sizes.
@@ -0,0 +1,41 @@
1
+ # Product Context
2
+
3
+ This file contains the high-level project description, goals, features, and overall architecture for the onboarding page and related systems.
4
+
5
+ ---
6
+
7
+ ## Onboarding Page Overview
8
+
9
+ - **Purpose:** Dynamic onboarding UI for configuring new server categories and MCP servers.
10
+ - **Frontend Structure:** Modular JavaScript in [`src/web/public/js/onboard/`](src/web/public/js/onboard):
11
+ - `index.js`: Entry point, tab switching, event listeners, loading/editing categories.
12
+ - `formProcessor.js`: Converts form ↔ JSON (`FeedConfiguration`), validation, populating UI.
13
+ - `uiHandlers.js`: Dynamic UI (add/remove servers, env vars, requirements), view toggling, section collapsing.
14
+ - `templates.js`: HTML templates for servers, env vars, requirements.
15
+ - `state.js`: Tracks counters for dynamic elements.
16
+ - `validationHandlers.js`: Validation logic, polling, progress display.
17
+ - `publishHandler.js`: Handles publishing, status polling, and feedback.
18
+
19
+ ---
20
+
21
+ ## Core Data Model
22
+
23
+ - **FeedConfiguration** (see [`src/core/types.ts`](src/core/types.ts)):
24
+ - `name`, `displayName`, `description`, `repository`
25
+ - `mcpServers`: Array of server configs (mode, install, env, dependencies)
26
+ - `requirements`: Unique, fully defined requirements (type, name, version, registry, alias)
27
+
28
+ ---
29
+
30
+ ## Key Features
31
+
32
+ - Dynamic form sections for servers, environment variables, and requirements.
33
+ - Toggle between form and JSON editor views.
34
+ - Robust validation and publishing flows with polling and progress UI.
35
+ - Custom notification system for user feedback.
36
+ - Enhanced UX for editing, tab switching, and error handling.
37
+ - All code and UI logic is aligned with [`docs/ONBOARDING_PAGE_DESIGN.md`](../docs/ONBOARDING_PAGE_DESIGN.md).
38
+
39
+ ---
40
+
41
+ _Last updated: 2025-05-15_