imcp 0.1.7 → 0.1.8-dev
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.
- package/dist/cli/commands/install.js +1 -106
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/list.js +1 -90
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/pull.js +1 -16
- package/dist/cli/commands/pull.js.map +1 -0
- package/dist/cli/commands/serve.js +1 -33
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/uninstall.js +1 -46
- package/dist/cli/commands/uninstall.js.map +1 -0
- package/dist/cli/index.js +1 -65
- package/dist/cli/index.js.map +1 -0
- package/dist/core/installers/clients/BaseClientInstaller.js +1 -282
- package/dist/core/installers/clients/BaseClientInstaller.js.map +1 -0
- package/dist/core/installers/clients/ClientInstaller.js +1 -163
- package/dist/core/installers/clients/ClientInstaller.js.map +1 -0
- package/dist/core/installers/clients/ClientInstallerFactory.js +1 -36
- package/dist/core/installers/clients/ClientInstallerFactory.js.map +1 -0
- package/dist/core/installers/clients/ClineInstaller.js +1 -30
- package/dist/core/installers/clients/ClineInstaller.js.map +1 -0
- package/dist/core/installers/clients/ExtensionInstaller.js +1 -151
- package/dist/core/installers/clients/ExtensionInstaller.js.map +1 -0
- package/dist/core/installers/clients/GithubCopilotInstaller.js +1 -68
- package/dist/core/installers/clients/GithubCopilotInstaller.js.map +1 -0
- package/dist/core/installers/clients/MSRooCodeInstaller.js +1 -28
- package/dist/core/installers/clients/MSRooCodeInstaller.js.map +1 -0
- package/dist/core/installers/index.js +1 -8
- package/dist/core/installers/index.js.map +1 -0
- package/dist/core/installers/requirements/BaseInstaller.js +1 -56
- package/dist/core/installers/requirements/BaseInstaller.js.map +1 -0
- package/dist/core/installers/requirements/CommandInstaller.js +1 -213
- package/dist/core/installers/requirements/CommandInstaller.js.map +1 -0
- package/dist/core/installers/requirements/GeneralInstaller.js +1 -126
- package/dist/core/installers/requirements/GeneralInstaller.js.map +1 -0
- package/dist/core/installers/requirements/InstallerFactory.js +1 -99
- package/dist/core/installers/requirements/InstallerFactory.js.map +1 -0
- package/dist/core/installers/requirements/NpmInstaller.js +1 -235
- package/dist/core/installers/requirements/NpmInstaller.js.map +1 -0
- package/dist/core/installers/requirements/NugetInstaller.js +1 -188
- package/dist/core/installers/requirements/NugetInstaller.js.map +1 -0
- package/dist/core/installers/requirements/PipInstaller.js +1 -192
- package/dist/core/installers/requirements/PipInstaller.js.map +1 -0
- package/dist/core/installers/requirements/RequirementInstaller.js +1 -2
- package/dist/core/installers/requirements/RequirementInstaller.js.map +1 -0
- package/dist/core/loaders/ConfigurationLoader.js +1 -256
- package/dist/core/loaders/ConfigurationLoader.js.map +1 -0
- package/dist/core/loaders/ConfigurationProvider.js +1 -383
- package/dist/core/loaders/ConfigurationProvider.js.map +1 -0
- package/dist/core/loaders/InstallOperationManager.js +1 -310
- package/dist/core/loaders/InstallOperationManager.js.map +1 -0
- package/dist/core/loaders/ServerSchemaLoader.js +1 -108
- package/dist/core/loaders/ServerSchemaLoader.js.map +1 -0
- package/dist/core/loaders/ServerSchemaProvider.js +1 -89
- package/dist/core/loaders/ServerSchemaProvider.js.map +1 -0
- package/dist/core/loaders/SystemSettingsManager.js +1 -256
- package/dist/core/loaders/SystemSettingsManager.js.map +1 -0
- package/dist/core/metadatas/constants.js +1 -100
- package/dist/core/metadatas/constants.js.map +1 -0
- package/dist/core/metadatas/recordingConstants.js +1 -46
- package/dist/core/metadatas/recordingConstants.js.map +1 -0
- package/dist/core/metadatas/types.js +1 -15
- package/dist/core/metadatas/types.js.map +1 -0
- package/dist/core/onboard/FeedOnboardService.js +1 -422
- package/dist/core/onboard/FeedOnboardService.js.map +1 -0
- package/dist/core/onboard/OnboardProcessor.js +1 -333
- package/dist/core/onboard/OnboardProcessor.js.map +1 -0
- package/dist/core/onboard/OnboardStatus.js +1 -9
- package/dist/core/onboard/OnboardStatus.js.map +1 -0
- package/dist/core/onboard/OnboardStatusManager.js +1 -360
- package/dist/core/onboard/OnboardStatusManager.js.map +1 -0
- package/dist/core/validators/FeedValidator.js +1 -133
- package/dist/core/validators/FeedValidator.js.map +1 -0
- package/dist/core/validators/IServerValidator.js +1 -1
- package/dist/core/validators/IServerValidator.js.map +1 -0
- package/dist/core/validators/SSEServerValidator.js +1 -38
- package/dist/core/validators/SSEServerValidator.js.map +1 -0
- package/dist/core/validators/ServerValidatorFactory.js +1 -44
- package/dist/core/validators/ServerValidatorFactory.js.map +1 -0
- package/dist/core/validators/StdioServerValidator.js +1 -281
- package/dist/core/validators/StdioServerValidator.js.map +1 -0
- package/dist/index.js +1 -18
- package/dist/index.js.map +1 -0
- package/dist/services/InstallationService.js +1 -81
- package/dist/services/InstallationService.js.map +1 -0
- package/dist/services/MCPManager.js +1 -197
- package/dist/services/MCPManager.js.map +1 -0
- package/dist/services/RequirementService.js +1 -548
- package/dist/services/RequirementService.js.map +1 -0
- package/dist/services/ServerService.js +1 -127
- package/dist/services/ServerService.js.map +1 -0
- package/dist/services/TelemetryService.js +1 -53
- package/dist/services/TelemetryService.js.map +1 -0
- package/dist/utils/UpdateCheckTracker.js +1 -79
- package/dist/utils/UpdateCheckTracker.js.map +1 -0
- package/dist/utils/adoUtils.js +1 -254
- package/dist/utils/adoUtils.js.map +1 -0
- package/dist/utils/clientUtils.js +1 -65
- package/dist/utils/clientUtils.js.map +1 -0
- package/dist/utils/feedUtils.js +1 -28
- package/dist/utils/feedUtils.js.map +1 -0
- package/dist/utils/githubAuth.js +1 -177
- package/dist/utils/githubAuth.js.map +1 -0
- package/dist/utils/githubUtils.js +1 -125
- package/dist/utils/githubUtils.js.map +1 -0
- package/dist/utils/logger.js +1 -176
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/macroExpressionUtils.js +1 -93
- package/dist/utils/macroExpressionUtils.js.map +1 -0
- package/dist/utils/osUtils.js +1 -664
- package/dist/utils/osUtils.js.map +1 -0
- package/dist/utils/versionUtils.js +1 -101
- package/dist/utils/versionUtils.js.map +1 -0
- package/dist/web/contract/serverContract.js +1 -1
- package/dist/web/contract/serverContract.js.map +1 -0
- package/dist/web/public/js/api.js +2 -132
- package/dist/web/public/js/api.js.map +1 -0
- package/dist/web/public/js/detailsWidget.js +2 -264
- package/dist/web/public/js/detailsWidget.js.map +1 -0
- package/dist/web/public/js/flights/flights.js +2 -127
- package/dist/web/public/js/flights/flights.js.map +1 -0
- package/dist/web/public/js/modal/index.js +2 -52
- package/dist/web/public/js/modal/index.js.map +1 -0
- package/dist/web/public/js/modal/installModal.js +2 -162
- package/dist/web/public/js/modal/installModal.js.map +1 -0
- package/dist/web/public/js/modal/installation.js +2 -266
- package/dist/web/public/js/modal/installation.js.map +1 -0
- package/dist/web/public/js/modal/loadingModal.js +2 -182
- package/dist/web/public/js/modal/loadingModal.js.map +1 -0
- package/dist/web/public/js/modal/modalSetup.js +2 -595
- package/dist/web/public/js/modal/modalSetup.js.map +1 -0
- package/dist/web/public/js/modal/modalUtils.js +2 -37
- package/dist/web/public/js/modal/modalUtils.js.map +1 -0
- package/dist/web/public/js/modal/versionUtils.js +2 -20
- package/dist/web/public/js/modal/versionUtils.js.map +1 -0
- package/dist/web/public/js/modal.js +2 -42
- package/dist/web/public/js/modal.js.map +1 -0
- package/dist/web/public/js/notifications.js +2 -137
- package/dist/web/public/js/notifications.js.map +1 -0
- package/dist/web/public/js/onboard/formProcessor.js +2 -1037
- package/dist/web/public/js/onboard/formProcessor.js.map +1 -0
- package/dist/web/public/js/onboard/index.js +2 -374
- package/dist/web/public/js/onboard/index.js.map +1 -0
- package/dist/web/public/js/onboard/publishHandler.js +2 -172
- package/dist/web/public/js/onboard/publishHandler.js.map +1 -0
- package/dist/web/public/js/onboard/state.js +2 -76
- package/dist/web/public/js/onboard/state.js.map +1 -0
- package/dist/web/public/js/onboard/templates.js +2 -342
- package/dist/web/public/js/onboard/templates.js.map +1 -0
- package/dist/web/public/js/onboard/uiHandlers.js +2 -1076
- package/dist/web/public/js/onboard/uiHandlers.js.map +1 -0
- package/dist/web/public/js/onboard/validationHandlers.js +2 -493
- package/dist/web/public/js/onboard/validationHandlers.js.map +1 -0
- package/dist/web/public/js/serverCategoryDetails.js +2 -364
- package/dist/web/public/js/serverCategoryDetails.js.map +1 -0
- package/dist/web/public/js/serverCategoryList.js +2 -241
- package/dist/web/public/js/serverCategoryList.js.map +1 -0
- package/dist/web/public/js/settings.js +2 -314
- package/dist/web/public/js/settings.js.map +1 -0
- package/dist/web/server.js +1 -404
- package/dist/web/server.js.map +1 -0
- package/package.json +8 -2
- package/.github/ISSUE_TEMPLATE/JitAccess.yml +0 -28
- package/.github/acl/access.yml +0 -20
- package/.github/compliance/inventory.yml +0 -5
- package/.github/policies/jit.yml +0 -19
- package/.github/workflows/build.yml +0 -28
- package/.roo/rules-code/rules.md +0 -88
- package/dist/cli/commands/start.d.ts +0 -2
- package/dist/cli/commands/start.js +0 -32
- package/dist/cli/commands/sync.d.ts +0 -2
- package/dist/cli/commands/sync.js +0 -17
- package/dist/core/ConfigurationLoader.d.ts +0 -32
- package/dist/core/ConfigurationLoader.js +0 -236
- package/dist/core/ConfigurationProvider.d.ts +0 -35
- package/dist/core/ConfigurationProvider.js +0 -375
- package/dist/core/InstallationService.d.ts +0 -50
- package/dist/core/InstallationService.js +0 -350
- package/dist/core/MCPManager.d.ts +0 -28
- package/dist/core/MCPManager.js +0 -188
- package/dist/core/RequirementService.d.ts +0 -40
- package/dist/core/RequirementService.js +0 -110
- package/dist/core/ServerSchemaLoader.d.ts +0 -11
- package/dist/core/ServerSchemaLoader.js +0 -43
- package/dist/core/ServerSchemaProvider.d.ts +0 -17
- package/dist/core/ServerSchemaProvider.js +0 -120
- package/dist/core/constants.d.ts +0 -47
- package/dist/core/constants.js +0 -94
- package/dist/core/installers/BaseInstaller.d.ts +0 -74
- package/dist/core/installers/BaseInstaller.js +0 -253
- package/dist/core/installers/ClientInstaller.d.ts +0 -23
- package/dist/core/installers/ClientInstaller.js +0 -564
- package/dist/core/installers/CommandInstaller.d.ts +0 -37
- package/dist/core/installers/CommandInstaller.js +0 -173
- package/dist/core/installers/GeneralInstaller.d.ts +0 -33
- package/dist/core/installers/GeneralInstaller.js +0 -85
- package/dist/core/installers/InstallerFactory.d.ts +0 -54
- package/dist/core/installers/InstallerFactory.js +0 -97
- package/dist/core/installers/NpmInstaller.d.ts +0 -26
- package/dist/core/installers/NpmInstaller.js +0 -127
- package/dist/core/installers/PipInstaller.d.ts +0 -28
- package/dist/core/installers/PipInstaller.js +0 -127
- package/dist/core/installers/RequirementInstaller.d.ts +0 -33
- package/dist/core/installers/RequirementInstaller.js +0 -3
- package/dist/core/types.d.ts +0 -166
- package/dist/core/types.js +0 -16
- package/dist/services/InstallRequestValidator.d.ts +0 -21
- package/dist/services/InstallRequestValidator.js +0 -99
- package/dist/web/public/js/modal/installHandler.js +0 -227
- package/dist/web/public/js/modal/loadingUI.js +0 -74
- package/dist/web/public/js/modal/messageQueue.js +0 -112
- package/dist/web/public/js/modal/modalUI.js +0 -214
- package/dist/web/public/js/modal/version.js +0 -20
- package/dist/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +0 -370
- package/docs/ONBOARDING_PAGE_DESIGN.md +0 -260
- package/docs/Telemetry.md +0 -136
- package/memory-bank/activeContext.md +0 -26
- package/memory-bank/decisionLog.md +0 -91
- package/memory-bank/productContext.md +0 -41
- package/memory-bank/progress.md +0 -35
- package/memory-bank/systemPatterns.md +0 -10
- package/src/cli/commands/install.ts +0 -139
- package/src/cli/commands/list.ts +0 -113
- package/src/cli/commands/pull.ts +0 -16
- package/src/cli/commands/serve.ts +0 -39
- package/src/cli/commands/uninstall.ts +0 -64
- package/src/cli/index.ts +0 -82
- package/src/core/installers/clients/BaseClientInstaller.ts +0 -341
- package/src/core/installers/clients/ClientInstaller.ts +0 -222
- package/src/core/installers/clients/ClientInstallerFactory.ts +0 -43
- package/src/core/installers/clients/ClineInstaller.ts +0 -35
- package/src/core/installers/clients/ExtensionInstaller.ts +0 -165
- package/src/core/installers/clients/GithubCopilotInstaller.ts +0 -79
- package/src/core/installers/clients/MSRooCodeInstaller.ts +0 -32
- package/src/core/installers/index.ts +0 -11
- package/src/core/installers/requirements/BaseInstaller.ts +0 -85
- package/src/core/installers/requirements/CommandInstaller.ts +0 -231
- package/src/core/installers/requirements/GeneralInstaller.ts +0 -133
- package/src/core/installers/requirements/InstallerFactory.ts +0 -114
- package/src/core/installers/requirements/NpmInstaller.ts +0 -271
- package/src/core/installers/requirements/NugetInstaller.ts +0 -203
- package/src/core/installers/requirements/PipInstaller.ts +0 -207
- package/src/core/installers/requirements/RequirementInstaller.ts +0 -42
- package/src/core/loaders/ConfigurationLoader.ts +0 -298
- package/src/core/loaders/ConfigurationProvider.ts +0 -462
- package/src/core/loaders/InstallOperationManager.ts +0 -367
- package/src/core/loaders/ServerSchemaLoader.ts +0 -117
- package/src/core/loaders/ServerSchemaProvider.ts +0 -99
- package/src/core/loaders/SystemSettingsManager.ts +0 -278
- package/src/core/metadatas/constants.ts +0 -122
- package/src/core/metadatas/recordingConstants.ts +0 -65
- package/src/core/metadatas/types.ts +0 -202
- package/src/core/onboard/FeedOnboardService.ts +0 -501
- package/src/core/onboard/OnboardProcessor.ts +0 -356
- package/src/core/onboard/OnboardStatus.ts +0 -60
- package/src/core/onboard/OnboardStatusManager.ts +0 -416
- package/src/core/validators/FeedValidator.ts +0 -135
- package/src/core/validators/IServerValidator.ts +0 -21
- package/src/core/validators/SSEServerValidator.ts +0 -43
- package/src/core/validators/ServerValidatorFactory.ts +0 -51
- package/src/core/validators/StdioServerValidator.ts +0 -313
- package/src/index.ts +0 -44
- package/src/services/InstallationService.ts +0 -102
- package/src/services/MCPManager.ts +0 -249
- package/src/services/RequirementService.ts +0 -627
- package/src/services/ServerService.ts +0 -161
- package/src/services/TelemetryService.ts +0 -59
- package/src/utils/UpdateCheckTracker.ts +0 -86
- package/src/utils/adoUtils.ts +0 -293
- package/src/utils/clientUtils.ts +0 -72
- package/src/utils/feedUtils.ts +0 -31
- package/src/utils/githubAuth.ts +0 -212
- package/src/utils/githubUtils.ts +0 -164
- package/src/utils/logger.ts +0 -195
- package/src/utils/macroExpressionUtils.ts +0 -104
- package/src/utils/osUtils.ts +0 -700
- package/src/utils/versionUtils.ts +0 -114
- package/src/web/contract/serverContract.ts +0 -74
- package/src/web/public/css/detailsWidget.css +0 -235
- package/src/web/public/css/modal.css +0 -757
- package/src/web/public/css/notifications.css +0 -101
- package/src/web/public/css/onboard.css +0 -107
- package/src/web/public/css/serverCategoryList.css +0 -120
- package/src/web/public/css/serverDetails.css +0 -139
- package/src/web/public/index.html +0 -359
- package/src/web/public/js/api.js +0 -132
- package/src/web/public/js/detailsWidget.js +0 -264
- package/src/web/public/js/flights/flights.js +0 -127
- package/src/web/public/js/modal/index.js +0 -52
- package/src/web/public/js/modal/installModal.js +0 -162
- package/src/web/public/js/modal/installation.js +0 -266
- package/src/web/public/js/modal/loadingModal.js +0 -182
- package/src/web/public/js/modal/modalSetup.js +0 -595
- package/src/web/public/js/modal/modalUtils.js +0 -37
- package/src/web/public/js/modal/versionUtils.js +0 -20
- package/src/web/public/js/modal.js +0 -42
- package/src/web/public/js/notifications.js +0 -137
- package/src/web/public/js/onboard/formProcessor.js +0 -1037
- package/src/web/public/js/onboard/index.js +0 -374
- package/src/web/public/js/onboard/publishHandler.js +0 -172
- package/src/web/public/js/onboard/state.js +0 -76
- package/src/web/public/js/onboard/templates.js +0 -342
- package/src/web/public/js/onboard/uiHandlers.js +0 -1076
- package/src/web/public/js/onboard/validationHandlers.js +0 -493
- package/src/web/public/js/serverCategoryDetails.js +0 -364
- package/src/web/public/js/serverCategoryList.js +0 -241
- package/src/web/public/js/settings.js +0 -314
- package/src/web/public/modal.html +0 -84
- package/src/web/public/onboard.html +0 -296
- package/src/web/public/settings.html +0 -135
- package/src/web/public/styles.css +0 -277
- package/src/web/server.ts +0 -478
- package/tsconfig.json +0 -18
- package/wiki/Installation.md +0 -3
- package/wiki/Publish.md +0 -3
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { queueMessage } from './messageQueue.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Display the installation loading modal and prepare it for messages
|
|
5
|
-
* @param {string} operation Operation name to display
|
|
6
|
-
*/
|
|
7
|
-
export function showLoadingModal(operation = 'Installing') {
|
|
8
|
-
const elements = getLoadingElements();
|
|
9
|
-
if (!elements) {
|
|
10
|
-
console.error('[LoadingModal] Required elements not found');
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
elements.modal.style.display = 'block';
|
|
15
|
-
elements.messageContainer.innerHTML = '';
|
|
16
|
-
elements.title.textContent = `${operation}...`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Hide the installation loading modal
|
|
21
|
-
*/
|
|
22
|
-
export function hideLoadingModal() {
|
|
23
|
-
const modal = document.getElementById('installLoadingModal');
|
|
24
|
-
if (!modal) {
|
|
25
|
-
console.error('[LoadingModal] Loading modal not found');
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
modal.style.display = 'none';
|
|
30
|
-
refreshPageWithCategory();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Append a message to the loading modal
|
|
35
|
-
* @param {string} message Message to display
|
|
36
|
-
* @param {boolean} isCompletion Whether this is a completion message
|
|
37
|
-
*/
|
|
38
|
-
export function appendLoadingMessage(message, isCompletion = false) {
|
|
39
|
-
queueMessage(message, isCompletion);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get the loading modal elements
|
|
44
|
-
* @private
|
|
45
|
-
* @returns {Object|null} Object containing modal elements or null if not found
|
|
46
|
-
*/
|
|
47
|
-
function getLoadingElements() {
|
|
48
|
-
const modal = document.getElementById('installLoadingModal');
|
|
49
|
-
const messageContainer = document.getElementById('installLoadingMessage');
|
|
50
|
-
const title = document.querySelector('.loading-title');
|
|
51
|
-
|
|
52
|
-
if (!modal || !messageContainer || !title) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return { modal, messageContainer, title };
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Refresh the page maintaining category selection
|
|
61
|
-
* @private
|
|
62
|
-
*/
|
|
63
|
-
function refreshPageWithCategory() {
|
|
64
|
-
const lastSelected = localStorage.getItem('lastSelectedCategory');
|
|
65
|
-
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
if (lastSelected) {
|
|
68
|
-
window.location.href = window.location.pathname +
|
|
69
|
-
'?category=' + encodeURIComponent(lastSelected);
|
|
70
|
-
} else {
|
|
71
|
-
location.reload();
|
|
72
|
-
}
|
|
73
|
-
}, 100);
|
|
74
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/** @type {boolean} Flag indicating if a message is currently being appended */
|
|
2
|
-
let isAppending = false;
|
|
3
|
-
|
|
4
|
-
/** @type {boolean} Flag indicating if completion UI update is pending */
|
|
5
|
-
let completionPending = false;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Message queue for delayed loading modal updates.
|
|
9
|
-
* @type {Array<{msg: string, isCompletion: boolean}>}
|
|
10
|
-
*/
|
|
11
|
-
let messageQueue = [];
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Process messages in the queue with a delay between each message.
|
|
15
|
-
* When the queue is empty and completion is pending, triggers the completion UI.
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
function processMessageQueue() {
|
|
19
|
-
if (isAppending || messageQueue.length === 0) {
|
|
20
|
-
// Only update completion UI if all messages have been displayed
|
|
21
|
-
if (messageQueue.length === 0 && completionPending) {
|
|
22
|
-
// Add small delay before showing completion to ensure last message is visible
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
updateCompletionUI();
|
|
25
|
-
completionPending = false;
|
|
26
|
-
}, 500);
|
|
27
|
-
}
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
isAppending = true;
|
|
32
|
-
const { msg, isCompletion } = messageQueue.shift();
|
|
33
|
-
|
|
34
|
-
if (isCompletion) {
|
|
35
|
-
completionPending = true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
appendInstallLoadingMessage(msg);
|
|
39
|
-
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
isAppending = false;
|
|
42
|
-
processMessageQueue();
|
|
43
|
-
}, 1000);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Queue a message to be displayed with a delay.
|
|
48
|
-
* Messages are displayed sequentially with a 1-second delay between each.
|
|
49
|
-
* @param {string} msg The message to display
|
|
50
|
-
* @param {boolean} [isCompletion=false] If true, triggers completion UI after message display
|
|
51
|
-
*/
|
|
52
|
-
export function delayedAppendInstallLoadingMessage(msg, isCompletion = false) {
|
|
53
|
-
messageQueue.push({ msg, isCompletion });
|
|
54
|
-
processMessageQueue();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function updateCompletionUI() {
|
|
58
|
-
const loadingTitle = document.querySelector('.loading-title');
|
|
59
|
-
const loadingIcon = document.querySelector('.loading-icon');
|
|
60
|
-
|
|
61
|
-
if (loadingTitle) {
|
|
62
|
-
loadingTitle.textContent = 'Completed';
|
|
63
|
-
loadingTitle.classList.add('completed');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (loadingIcon) {
|
|
67
|
-
loadingIcon.innerHTML = `
|
|
68
|
-
<svg width="48" height="48" viewBox="0 0 48 48" fill="none">
|
|
69
|
-
<circle cx="24" cy="24" r="20" stroke="#059669" stroke-width="4"/>
|
|
70
|
-
<path d="M16 24l6 6 12-12" stroke="#059669" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
71
|
-
</svg>
|
|
72
|
-
`;
|
|
73
|
-
loadingIcon.classList.add('completed');
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Internal function to append a message to the loading modal with formatting.
|
|
79
|
-
* @private
|
|
80
|
-
* @param {string} message - The message to append
|
|
81
|
-
*/
|
|
82
|
-
function appendInstallLoadingMessage(message) {
|
|
83
|
-
const loadingMsg = document.getElementById('installLoadingMessage');
|
|
84
|
-
if (loadingMsg) {
|
|
85
|
-
// Split message on newlines
|
|
86
|
-
const lines = message.split('\n');
|
|
87
|
-
|
|
88
|
-
lines.forEach(line => {
|
|
89
|
-
// Check if line contains an error
|
|
90
|
-
const isError = line.toLowerCase().includes('error') ||
|
|
91
|
-
line.toLowerCase().includes('failed') ||
|
|
92
|
-
line.toLowerCase().includes('timeout');
|
|
93
|
-
|
|
94
|
-
const formattedMessage = line;
|
|
95
|
-
|
|
96
|
-
// Create message container
|
|
97
|
-
const messageDiv = document.createElement('div');
|
|
98
|
-
messageDiv.className = 'message-line';
|
|
99
|
-
|
|
100
|
-
// Apply yellow color for error messages
|
|
101
|
-
if (isError) {
|
|
102
|
-
messageDiv.style.color = '#f59e0b';
|
|
103
|
-
}
|
|
104
|
-
messageDiv.innerHTML = formattedMessage;
|
|
105
|
-
|
|
106
|
-
loadingMsg.appendChild(messageDiv);
|
|
107
|
-
loadingMsg.scrollTop = loadingMsg.scrollHeight;
|
|
108
|
-
});
|
|
109
|
-
} else {
|
|
110
|
-
console.error('[LoadingModal] Element not found: installLoadingMessage');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { showConfirm } from '../notifications.js';
|
|
2
|
-
import { handleInstallation, handleUninstallation } from './installHandler.js';
|
|
3
|
-
import { showLoadingModal } from './loadingUI.js';
|
|
4
|
-
import { compareVersions } from './version.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Show installation modal for MCP tools
|
|
8
|
-
* @param {string} categoryName Category name
|
|
9
|
-
* @param {string} serverName Server name
|
|
10
|
-
*/
|
|
11
|
-
export async function showInstallModal(categoryName, serverName) {
|
|
12
|
-
console.log("Showing install modal for:", serverName);
|
|
13
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
14
|
-
|
|
15
|
-
const elements = getModalElements();
|
|
16
|
-
if (!elements) return;
|
|
17
|
-
|
|
18
|
-
initializeModal(elements, serverName);
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
const { targetData, serverData } = await fetchModalData(categoryName);
|
|
22
|
-
const mcpServer = findMcpServer(serverData, serverName);
|
|
23
|
-
|
|
24
|
-
renderModalContent(elements, {
|
|
25
|
-
targetData,
|
|
26
|
-
serverData,
|
|
27
|
-
mcpServer,
|
|
28
|
-
categoryName,
|
|
29
|
-
serverName
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
setupFormHandler(elements, categoryName, serverName, serverData);
|
|
33
|
-
elements.modal.style.display = "block";
|
|
34
|
-
} catch (error) {
|
|
35
|
-
handleModalError(error, elements.targetDiv);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Close modal and refresh with selected category
|
|
41
|
-
*/
|
|
42
|
-
export function closeModal() {
|
|
43
|
-
const modal = document.getElementById('installModal');
|
|
44
|
-
if (modal) {
|
|
45
|
-
modal.style.display = "none";
|
|
46
|
-
refreshWithCategory();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Setup click outside modal handler
|
|
52
|
-
*/
|
|
53
|
-
export function setupModalOutsideClick() {
|
|
54
|
-
window.onclick = function (event) {
|
|
55
|
-
const modal = document.getElementById('installModal');
|
|
56
|
-
if (event.target === modal) {
|
|
57
|
-
closeModal();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Private helper functions
|
|
63
|
-
|
|
64
|
-
function getModalElements() {
|
|
65
|
-
const modal = document.getElementById('installModal');
|
|
66
|
-
if (!modal) {
|
|
67
|
-
console.error('Modal container not found');
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const elements = {
|
|
72
|
-
modal,
|
|
73
|
-
title: modal.querySelector('#modalTitle'),
|
|
74
|
-
envInputs: modal.querySelector('#modalEnvInputs'),
|
|
75
|
-
targetDiv: modal.querySelector('#modalTargets'),
|
|
76
|
-
requirements: modal.querySelector('#modalRequirements'),
|
|
77
|
-
arguments: modal.querySelector('#modalArguments')
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
if (!Object.values(elements).every(Boolean)) {
|
|
81
|
-
console.error('Required modal elements not found');
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return elements;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function initializeModal(elements, serverName) {
|
|
89
|
-
window.selectedClients = [];
|
|
90
|
-
elements.title.textContent = `Install ${serverName}`;
|
|
91
|
-
clearModalSections(elements);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function clearModalSections(elements) {
|
|
95
|
-
['envInputs', 'targetDiv', 'requirements', 'arguments'].forEach(section => {
|
|
96
|
-
elements[section].innerHTML = '';
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
async function fetchModalData(categoryName) {
|
|
101
|
-
const [targetResponse, serverResponse] = await Promise.all([
|
|
102
|
-
fetch('/api/targets'),
|
|
103
|
-
fetch(`/api/categories/${categoryName}`)
|
|
104
|
-
]);
|
|
105
|
-
|
|
106
|
-
if (!targetResponse.ok || !serverResponse.ok) {
|
|
107
|
-
throw new Error('Failed to fetch required data');
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const [targetData, serverData] = await Promise.all([
|
|
111
|
-
targetResponse.json(),
|
|
112
|
-
serverResponse.json()
|
|
113
|
-
]);
|
|
114
|
-
|
|
115
|
-
if (!targetData.success || !serverData.success) {
|
|
116
|
-
throw new Error('Invalid data received');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return { targetData, serverData };
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function findMcpServer(serverData, serverName) {
|
|
123
|
-
const mcpServer = serverData.data.feedConfiguration.mcpServers
|
|
124
|
-
.find(server => server.name === serverName);
|
|
125
|
-
|
|
126
|
-
if (!mcpServer) {
|
|
127
|
-
throw new Error('Server configuration not found');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return mcpServer;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function renderModalContent(elements, data) {
|
|
134
|
-
const { targetData, serverData, mcpServer, categoryName, serverName } = data;
|
|
135
|
-
const installationStatus = serverData.data.installationStatus || {};
|
|
136
|
-
const serverStatuses = installationStatus.serversStatus || {};
|
|
137
|
-
const serverStatus = serverStatuses[serverName] || { installedStatus: {} };
|
|
138
|
-
|
|
139
|
-
renderClientSection(elements.targetDiv, targetData.data, serverStatus, serverName, categoryName);
|
|
140
|
-
renderEnvironmentSection(elements.envInputs, mcpServer, targetData.clientMcpSettings, serverName);
|
|
141
|
-
renderArgumentsSection(elements.arguments, mcpServer);
|
|
142
|
-
renderRequirementsSection(elements.requirements, mcpServer, serverData, categoryName, serverName);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function setupFormHandler(elements, categoryName, serverName, serverData) {
|
|
146
|
-
const form = document.getElementById('installForm');
|
|
147
|
-
form.onsubmit = (e) => handleFormSubmit(e, {
|
|
148
|
-
elements,
|
|
149
|
-
categoryName,
|
|
150
|
-
serverName,
|
|
151
|
-
serverData
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function handleFormSubmit(event, options) {
|
|
156
|
-
event.preventDefault();
|
|
157
|
-
const { elements, categoryName, serverName, serverData } = options;
|
|
158
|
-
|
|
159
|
-
const formData = collectFormData(elements);
|
|
160
|
-
if (!validateFormData(formData)) return;
|
|
161
|
-
|
|
162
|
-
const installOptions = buildInstallOptions(formData, serverData, serverName);
|
|
163
|
-
handleInstallation(categoryName, serverName, formData.targets, installOptions);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function collectFormData(elements) {
|
|
167
|
-
return {
|
|
168
|
-
envVars: getEnvironmentVariables(elements.envInputs),
|
|
169
|
-
args: getArguments(elements.arguments),
|
|
170
|
-
pythonEnv: getPythonEnvironment(),
|
|
171
|
-
targets: getSelectedTargets(),
|
|
172
|
-
requirements: getSelectedRequirements()
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function validateFormData(formData) {
|
|
177
|
-
const { targets, requirements } = formData;
|
|
178
|
-
if (targets.length === 0 && requirements.length === 0) {
|
|
179
|
-
showError('Please select at least one client or requirement to update.');
|
|
180
|
-
return false;
|
|
181
|
-
}
|
|
182
|
-
return true;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function handleModalError(error, targetDiv) {
|
|
186
|
-
console.error("Error loading data:", error);
|
|
187
|
-
targetDiv.innerHTML = `<p class="text-red-500">Error: ${error.message}</p>`;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function refreshWithCategory() {
|
|
191
|
-
const lastSelected = localStorage.getItem('lastSelectedCategory');
|
|
192
|
-
setTimeout(() => {
|
|
193
|
-
if (lastSelected) {
|
|
194
|
-
window.location.href = window.location.pathname + '?category=' + encodeURIComponent(lastSelected);
|
|
195
|
-
} else {
|
|
196
|
-
location.reload();
|
|
197
|
-
}
|
|
198
|
-
}, 100);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Add CSS styles for the toggle switch
|
|
202
|
-
const styleElement = document.createElement('style');
|
|
203
|
-
styleElement.textContent = `
|
|
204
|
-
.toggle-bg.bg-blue-500 {
|
|
205
|
-
background-color: #3b82f6;
|
|
206
|
-
}
|
|
207
|
-
.toggle-bg {
|
|
208
|
-
transition: background-color 0.3s;
|
|
209
|
-
}
|
|
210
|
-
.toggle-bg div {
|
|
211
|
-
transition: transform 0.3s;
|
|
212
|
-
}
|
|
213
|
-
`;
|
|
214
|
-
document.head.appendChild(styleElement);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple version comparison function
|
|
3
|
-
* @param {string} v1 First version
|
|
4
|
-
* @param {string} v2 Second version
|
|
5
|
-
* @returns {number} 1 if v1 > v2, -1 if v1 < v2, 0 if equal
|
|
6
|
-
*/
|
|
7
|
-
export function compareVersions(v1, v2) {
|
|
8
|
-
const v1Parts = v1.split('.').map(Number);
|
|
9
|
-
const v2Parts = v2.split('.').map(Number);
|
|
10
|
-
|
|
11
|
-
for (let i = 0; i < Math.max(v1Parts.length, v2Parts.length); i++) {
|
|
12
|
-
const v1Part = v1Parts[i] || 0;
|
|
13
|
-
const v2Part = v2Parts[i] || 0;
|
|
14
|
-
|
|
15
|
-
if (v1Part > v2Part) return 1;
|
|
16
|
-
if (v1Part < v2Part) return -1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return 0;
|
|
20
|
-
}
|