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,264 +0,0 @@
|
|
|
1
|
-
export class DetailsWidget {
|
|
2
|
-
constructor(container) {
|
|
3
|
-
this.container = container;
|
|
4
|
-
this.isExpanded = false;
|
|
5
|
-
this.expandedTool = null;
|
|
6
|
-
this.init();
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
init() {
|
|
10
|
-
// Create and append stylesheet
|
|
11
|
-
const link = document.createElement('link');
|
|
12
|
-
link.rel = 'stylesheet';
|
|
13
|
-
link.href = '/css/detailsWidget.css';
|
|
14
|
-
document.head.appendChild(link);
|
|
15
|
-
// Create wrapper to maintain proper width alignment
|
|
16
|
-
this.containerWrapper = document.createElement('div');
|
|
17
|
-
this.containerWrapper.className = 'details-widget-container';
|
|
18
|
-
this.containerWrapper.style.width = '100%';
|
|
19
|
-
this.containerWrapper.style.boxSizing = 'border-box';
|
|
20
|
-
this.containerWrapper.style.maxWidth = '100%';
|
|
21
|
-
this.containerWrapper.style.overflow = 'hidden';
|
|
22
|
-
|
|
23
|
-
// Create the widget element
|
|
24
|
-
this.widgetElement = document.createElement('div');
|
|
25
|
-
this.widgetElement.className = 'details-widget';
|
|
26
|
-
this.widgetElement.style.width = '100%';
|
|
27
|
-
this.widgetElement.style.boxSizing = 'border-box';
|
|
28
|
-
this.widgetElement.style.maxWidth = '100%';
|
|
29
|
-
|
|
30
|
-
// Create the content element
|
|
31
|
-
this.contentElement = document.createElement('div');
|
|
32
|
-
this.contentElement.className = 'details-widget-content';
|
|
33
|
-
this.contentElement.style.width = '100%';
|
|
34
|
-
this.contentElement.style.boxSizing = 'border-box';
|
|
35
|
-
|
|
36
|
-
// Build the DOM structure
|
|
37
|
-
this.widgetElement.appendChild(this.contentElement);
|
|
38
|
-
this.containerWrapper.appendChild(this.widgetElement);
|
|
39
|
-
|
|
40
|
-
// Insert after the server item while maintaining proper structure
|
|
41
|
-
this.container.after(this.containerWrapper);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
setContent(content) {
|
|
45
|
-
if (typeof content === 'string') {
|
|
46
|
-
this.contentElement.innerHTML = `
|
|
47
|
-
<div class="description-text">
|
|
48
|
-
${content || 'No description available.'}
|
|
49
|
-
</div>
|
|
50
|
-
`;
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Handle direct schema object or wrapped schema object
|
|
55
|
-
if (typeof content === 'object') {
|
|
56
|
-
const schemaData = content.schema || content; // Handle both {schema: data} and direct data
|
|
57
|
-
this.renderToolsList(schemaData);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
this.contentElement.innerHTML = '<p>Invalid content format</p>';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Maintain compatibility with old toggle behavior
|
|
65
|
-
toggle() {
|
|
66
|
-
if (this.isExpanded) {
|
|
67
|
-
this.collapse();
|
|
68
|
-
} else {
|
|
69
|
-
this.expand();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
expand() {
|
|
74
|
-
this.isExpanded = true;
|
|
75
|
-
this.widgetElement.classList.add('expanded');
|
|
76
|
-
|
|
77
|
-
// Ensure proper dimensions based on container
|
|
78
|
-
const containerWidth = this.container.offsetWidth;
|
|
79
|
-
this.containerWrapper.style.width = `${containerWidth}px`;
|
|
80
|
-
this.containerWrapper.style.maxWidth = '100%';
|
|
81
|
-
this.containerWrapper.style.display = 'block';
|
|
82
|
-
|
|
83
|
-
// Add expanded state to container
|
|
84
|
-
if (this.container) {
|
|
85
|
-
this.container.classList.add('expanded');
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
collapse() {
|
|
90
|
-
this.isExpanded = false;
|
|
91
|
-
this.widgetElement.classList.remove('expanded');
|
|
92
|
-
if (this.container) {
|
|
93
|
-
this.container.classList.remove('expanded');
|
|
94
|
-
}
|
|
95
|
-
// Reset expanded tool state
|
|
96
|
-
this.expandedTool = null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
renderToolsList(schemaContent) {
|
|
100
|
-
if (!schemaContent || typeof schemaContent !== 'object') {
|
|
101
|
-
this.contentElement.innerHTML = '<p>Invalid schema format</p>';
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
let html = `
|
|
106
|
-
<div class="tools-list">
|
|
107
|
-
`;
|
|
108
|
-
|
|
109
|
-
Object.entries(schemaContent).forEach(([toolName, toolInfo]) => {
|
|
110
|
-
if (!toolInfo) return;
|
|
111
|
-
|
|
112
|
-
html += `<div class="tool-card" data-tool="${this.escapeHtml(toolName)}">
|
|
113
|
-
<div class="tool-card-header">
|
|
114
|
-
<div class="tool-header">
|
|
115
|
-
<h3 class="text-md font-semibold text-blue-600">${toolInfo.name || toolName}</h3>
|
|
116
|
-
<div class="text-gray-600 text-sm">${toolInfo.description || 'No description available'}</div>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
<div class="tool-details hidden" data-tool-details="${this.escapeHtml(toolName)}">
|
|
120
|
-
${this.renderInputSchema(toolInfo.inputSchema)}
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
`;
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
html += `
|
|
127
|
-
</div>
|
|
128
|
-
`;
|
|
129
|
-
|
|
130
|
-
this.contentElement.innerHTML = html;
|
|
131
|
-
|
|
132
|
-
// Add event listeners to tool cards
|
|
133
|
-
this.contentElement.querySelectorAll('.tool-card').forEach(card => {
|
|
134
|
-
const header = card.querySelector('.tool-card-header');
|
|
135
|
-
header.addEventListener('click', (e) => {
|
|
136
|
-
e.stopPropagation(); // Prevent click from bubbling up to server-item
|
|
137
|
-
const toolName = card.dataset.tool;
|
|
138
|
-
this.toggleToolDetails(toolName, card);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// Add click handler for the details area to prevent bubbling
|
|
142
|
-
const details = card.querySelector('.tool-details');
|
|
143
|
-
details.addEventListener('click', (e) => {
|
|
144
|
-
e.stopPropagation(); // Prevent click from bubbling up
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
toggleToolDetails(toolName, card) {
|
|
150
|
-
const detailsElement = card.querySelector(`[data-tool-details="${toolName}"]`);
|
|
151
|
-
const isExpanded = !detailsElement.classList.contains('hidden');
|
|
152
|
-
|
|
153
|
-
// Collapse all other expanded tools
|
|
154
|
-
if (this.expandedTool && this.expandedTool !== toolName) {
|
|
155
|
-
const prevCard = this.contentElement.querySelector(`[data-tool="${this.expandedTool}"]`);
|
|
156
|
-
if (prevCard) {
|
|
157
|
-
const prevDetails = prevCard.querySelector(`[data-tool-details="${this.expandedTool}"]`);
|
|
158
|
-
prevDetails?.classList.add('hidden');
|
|
159
|
-
prevCard.classList.remove('active');
|
|
160
|
-
setTimeout(() => {
|
|
161
|
-
prevDetails.classList.remove('visible');
|
|
162
|
-
}, 0);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Toggle current tool with animation
|
|
167
|
-
if (isExpanded) {
|
|
168
|
-
detailsElement.classList.remove('visible');
|
|
169
|
-
card.classList.remove('active');
|
|
170
|
-
setTimeout(() => {
|
|
171
|
-
detailsElement.classList.add('hidden');
|
|
172
|
-
}, 300); // Match transition duration from CSS
|
|
173
|
-
this.expandedTool = null;
|
|
174
|
-
} else {
|
|
175
|
-
detailsElement.classList.remove('hidden');
|
|
176
|
-
card.classList.add('active');
|
|
177
|
-
setTimeout(() => {
|
|
178
|
-
detailsElement.classList.add('visible');
|
|
179
|
-
}, 0);
|
|
180
|
-
this.expandedTool = toolName;
|
|
181
|
-
detailsElement.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
renderInputSchema(schema) {
|
|
186
|
-
if (!schema || typeof schema !== 'object') {
|
|
187
|
-
return '<p>No input schema available</p>';
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (!schema.properties || Object.keys(schema.properties).length === 0) {
|
|
191
|
-
return '<p>No input properties defined</p>';
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
let html = '<div class="properties-list">';
|
|
195
|
-
|
|
196
|
-
try {
|
|
197
|
-
// Render each property
|
|
198
|
-
Object.entries(schema.properties).forEach(([propName, propDetails]) => {
|
|
199
|
-
if (!propDetails) return;
|
|
200
|
-
|
|
201
|
-
const isRequired = schema.required?.includes(propName);
|
|
202
|
-
const type = this.getPropertyType(propDetails);
|
|
203
|
-
|
|
204
|
-
html += `<div class="property-item ${isRequired ? 'required' : ''}">
|
|
205
|
-
<div class="property-header">
|
|
206
|
-
<span class="property-name">${this.escapeHtml(propName)}${isRequired ? '<span class="required-star">*</span>' : ''}</span><span class="property-type">${this.escapeHtml(type)}</span>${propDetails.description ? `<span class="property-desc">${this.escapeHtml(propDetails.description)}</span>` : ''}
|
|
207
|
-
${propDetails.default !== undefined ? `<div class="property-default">Default: <code>${this.escapeHtml(JSON.stringify(propDetails.default))}</code></div>` : ''}
|
|
208
|
-
</div>
|
|
209
|
-
${this.renderNestedProperties(propDetails)}
|
|
210
|
-
</div>
|
|
211
|
-
`;
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
return html + '</div>';
|
|
215
|
-
} catch (error) {
|
|
216
|
-
console.error('Error rendering input schema:', error);
|
|
217
|
-
return '<p>Error rendering input schema</p>';
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
renderNestedProperties(propDetails) {
|
|
222
|
-
if (propDetails.properties) {
|
|
223
|
-
let html = '<div class="nested-properties">';
|
|
224
|
-
Object.entries(propDetails.properties).forEach(([name, details]) => {
|
|
225
|
-
const type = this.getPropertyType(details);
|
|
226
|
-
html += `
|
|
227
|
-
<div class="nested-property-item">
|
|
228
|
-
<span class="property-name">${this.escapeHtml(name)}</span><span class="property-type">${this.escapeHtml(type)}</span>
|
|
229
|
-
${details.description ? `<div class="property-desc">${this.escapeHtml(details.description)}</div>` : ''}
|
|
230
|
-
</div>
|
|
231
|
-
`;
|
|
232
|
-
});
|
|
233
|
-
return html + '</div>';
|
|
234
|
-
}
|
|
235
|
-
return '';
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
getPropertyType(propDetails) {
|
|
239
|
-
if (propDetails.anyOf) {
|
|
240
|
-
return `oneOf: [${propDetails.anyOf.map(type => type.type || 'any').join(', ')}]`;
|
|
241
|
-
}
|
|
242
|
-
if (propDetails.type === 'array') {
|
|
243
|
-
const itemType = propDetails.items?.type || 'any';
|
|
244
|
-
return `array<${itemType}>`;
|
|
245
|
-
}
|
|
246
|
-
return propDetails.type || 'any';
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
escapeHtml(unsafe) {
|
|
250
|
-
if (unsafe === undefined || unsafe === null) {
|
|
251
|
-
return '';
|
|
252
|
-
}
|
|
253
|
-
return String(unsafe)
|
|
254
|
-
.replace(/&/g, "&")
|
|
255
|
-
.replace(/</g, "<")
|
|
256
|
-
.replace(/>/g, ">")
|
|
257
|
-
.replace(/"/g, """)
|
|
258
|
-
.replace(/'/g, "'");
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
isVisible() {
|
|
262
|
-
return this.isExpanded;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Centralized flight control configuration
|
|
2
|
-
|
|
3
|
-
const FLIGHT_STORAGE_KEY = 'activeFlightSettings';
|
|
4
|
-
|
|
5
|
-
// Default flight settings
|
|
6
|
-
const defaultFlights = {
|
|
7
|
-
enableOnboard: true, // Default: Onboarding is enabled. Set to false to disable.
|
|
8
|
-
// Add other default flights here, e.g., newFeatureX: false,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
let effectiveFlightSettings = {};
|
|
12
|
-
|
|
13
|
-
// Initialize flight settings
|
|
14
|
-
function initializeFlightSettings() {
|
|
15
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
16
|
-
let settingsToStore = {};
|
|
17
|
-
let sourcedFromUrl = false;
|
|
18
|
-
|
|
19
|
-
// Check URL parameters first
|
|
20
|
-
for (const key in defaultFlights) {
|
|
21
|
-
if (urlParams.has(key)) {
|
|
22
|
-
const paramValue = urlParams.get(key);
|
|
23
|
-
settingsToStore[key] = (paramValue === 'true') ? true : (paramValue === 'false' ? false : paramValue);
|
|
24
|
-
sourcedFromUrl = true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (sourcedFromUrl) {
|
|
29
|
-
// If any flight was set via URL, these override sessionStorage for this load
|
|
30
|
-
// and then update sessionStorage.
|
|
31
|
-
// Fill any missing flights with defaults before storing.
|
|
32
|
-
for (const key in defaultFlights) {
|
|
33
|
-
if (!Object.hasOwnProperty.call(settingsToStore, key)) {
|
|
34
|
-
settingsToStore[key] = defaultFlights[key];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
sessionStorage.setItem(FLIGHT_STORAGE_KEY, JSON.stringify(settingsToStore));
|
|
39
|
-
effectiveFlightSettings = settingsToStore;
|
|
40
|
-
} catch (e) {
|
|
41
|
-
console.error("Failed to write to sessionStorage:", e);
|
|
42
|
-
effectiveFlightSettings = settingsToStore; // Use them anyway for this page load
|
|
43
|
-
}
|
|
44
|
-
} else {
|
|
45
|
-
// No flight params in URL, try sessionStorage
|
|
46
|
-
try {
|
|
47
|
-
const storedSettings = sessionStorage.getItem(FLIGHT_STORAGE_KEY);
|
|
48
|
-
if (storedSettings) {
|
|
49
|
-
effectiveFlightSettings = JSON.parse(storedSettings);
|
|
50
|
-
// Ensure all default keys are present, add if missing (e.g., new flight added)
|
|
51
|
-
for (const key in defaultFlights) {
|
|
52
|
-
if (!Object.hasOwnProperty.call(effectiveFlightSettings, key)) {
|
|
53
|
-
effectiveFlightSettings[key] = defaultFlights[key];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
// Not in sessionStorage, use defaults and store them
|
|
58
|
-
effectiveFlightSettings = { ...defaultFlights };
|
|
59
|
-
sessionStorage.setItem(FLIGHT_STORAGE_KEY, JSON.stringify(effectiveFlightSettings));
|
|
60
|
-
}
|
|
61
|
-
} catch (e) {
|
|
62
|
-
console.error("Failed to read/write sessionStorage:", e);
|
|
63
|
-
effectiveFlightSettings = { ...defaultFlights }; // Fallback to defaults
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
initializeFlightSettings();
|
|
69
|
-
|
|
70
|
-
// The `flights` object provides these effective values.
|
|
71
|
-
const flights = {};
|
|
72
|
-
for (const key in defaultFlights) { // Iterate defaultFlights to define getters for all known flights
|
|
73
|
-
if (Object.hasOwnProperty.call(defaultFlights, key)) {
|
|
74
|
-
Object.defineProperty(flights, key, {
|
|
75
|
-
get: () => effectiveFlightSettings[key] !== undefined ? effectiveFlightSettings[key] : defaultFlights[key],
|
|
76
|
-
enumerable: true,
|
|
77
|
-
configurable: false
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Helper to build a URLSearchParams object with the effective flight values.
|
|
84
|
-
* @returns {URLSearchParams}
|
|
85
|
-
*/
|
|
86
|
-
function _buildFlightParams() {
|
|
87
|
-
const flightParams = new URLSearchParams();
|
|
88
|
-
for (const flightName in effectiveFlightSettings) {
|
|
89
|
-
if (Object.hasOwnProperty.call(effectiveFlightSettings, flightName)) {
|
|
90
|
-
// Only add if it's a recognized flight from defaultFlights to avoid polluting URL
|
|
91
|
-
// with unrelated sessionStorage items if FLIGHT_STORAGE_KEY was somehow corrupted.
|
|
92
|
-
if (Object.hasOwnProperty.call(defaultFlights, flightName)) {
|
|
93
|
-
flightParams.set(flightName, String(effectiveFlightSettings[flightName]));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return flightParams;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Constructs a URL with the effective flight parameters and any additional parameters.
|
|
102
|
-
* @param {string} baseUrl The base URL (e.g., "index.html").
|
|
103
|
-
* @param {object} [additionalParams={}] - An object of additional key-value pairs to include.
|
|
104
|
-
* @returns {string} A full URL with query string.
|
|
105
|
-
*/
|
|
106
|
-
export function buildUrlWithFlights(baseUrl, additionalParams = {}) {
|
|
107
|
-
const params = _buildFlightParams(); // Start with all effective flight values
|
|
108
|
-
|
|
109
|
-
for (const key in additionalParams) {
|
|
110
|
-
if (Object.hasOwnProperty.call(additionalParams, key) && additionalParams[key] !== undefined) {
|
|
111
|
-
params.set(key, additionalParams[key]);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const queryString = params.toString();
|
|
115
|
-
return `${baseUrl}${queryString ? `?${queryString}` : ''}`;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Gets a query string containing only the effective flight parameters.
|
|
120
|
-
* @returns {string} A query string like "?enableOnboard=true" or empty.
|
|
121
|
-
*/
|
|
122
|
-
export function getFlightQueryParameters() {
|
|
123
|
-
const queryString = _buildFlightParams().toString();
|
|
124
|
-
return queryString ? `?${queryString}` : '';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export default flights;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Import all modal-related functionality
|
|
2
|
-
import { compareVersions } from './versionUtils.js';
|
|
3
|
-
// import { delayedAppendInstallLoadingMessage } from './messageQueue.js'; // Removed
|
|
4
|
-
import { showInstallLoadingModal, hideInstallLoadingModal, updateOverallInstallStatus, addInstallationStep } from './loadingModal.js'; // Removed appendInstallLoadingMessage, added new fns
|
|
5
|
-
import { closeModal } from './modalUtils.js';
|
|
6
|
-
import { handleBulkClientInstall, uninstallTools } from './installation.js';
|
|
7
|
-
import { showInstallModal } from './installModal.js';
|
|
8
|
-
import {
|
|
9
|
-
setupClientItems,
|
|
10
|
-
setupEnvironmentVariables,
|
|
11
|
-
setupInstallationArguments,
|
|
12
|
-
setupServerRequirements,
|
|
13
|
-
setupFormSubmitHandler
|
|
14
|
-
} from './modalSetup.js';
|
|
15
|
-
|
|
16
|
-
// Export all modal functionality
|
|
17
|
-
export {
|
|
18
|
-
// Version utilities
|
|
19
|
-
compareVersions,
|
|
20
|
-
|
|
21
|
-
// Message queue - (delayedAppendInstallLoadingMessage removed)
|
|
22
|
-
|
|
23
|
-
// Loading modal
|
|
24
|
-
showInstallLoadingModal,
|
|
25
|
-
// appendInstallLoadingMessage, // Removed
|
|
26
|
-
hideInstallLoadingModal,
|
|
27
|
-
updateOverallInstallStatus, // Added
|
|
28
|
-
addInstallationStep, // Added
|
|
29
|
-
|
|
30
|
-
// Modal utilities
|
|
31
|
-
closeModal,
|
|
32
|
-
// Installation
|
|
33
|
-
handleBulkClientInstall,
|
|
34
|
-
uninstallTools,
|
|
35
|
-
|
|
36
|
-
// Install modal
|
|
37
|
-
showInstallModal,
|
|
38
|
-
|
|
39
|
-
// Modal setup
|
|
40
|
-
setupClientItems,
|
|
41
|
-
setupEnvironmentVariables,
|
|
42
|
-
setupInstallationArguments,
|
|
43
|
-
setupServerRequirements,
|
|
44
|
-
setupFormSubmitHandler
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// Make certain functions available globally
|
|
48
|
-
window.showInstallModal = showInstallModal;
|
|
49
|
-
window.showInstallLoadingModal = showInstallLoadingModal;
|
|
50
|
-
// window.appendInstallLoadingMessage = appendInstallLoadingMessage; // Removed
|
|
51
|
-
window.hideInstallLoadingModal = hideInstallLoadingModal;
|
|
52
|
-
window.uninstallTools = uninstallTools;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { showToast, showConfirm } from '../notifications.js';
|
|
2
|
-
import { compareVersions } from './versionUtils.js';
|
|
3
|
-
// import { delayedAppendInstallLoadingMessage } from './messageQueue.js'; // No longer needed here
|
|
4
|
-
import { showInstallLoadingModal } from './loadingModal.js';
|
|
5
|
-
import { closeModal, setupToggleStyles } from './modalUtils.js';
|
|
6
|
-
import { handleBulkClientInstall, uninstallTools } from './installation.js';
|
|
7
|
-
import {
|
|
8
|
-
setupClientItems,
|
|
9
|
-
setupEnvironmentVariables,
|
|
10
|
-
setupInstallationArguments,
|
|
11
|
-
setupServerRequirements,
|
|
12
|
-
setupFormSubmitHandler
|
|
13
|
-
} from './modalSetup.js';
|
|
14
|
-
|
|
15
|
-
// Initialize modal functionality when DOM is loaded
|
|
16
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
17
|
-
setupToggleStyles();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Show install modal for MCP tools
|
|
22
|
-
* @param {string} categoryName - The category name
|
|
23
|
-
* @param {string} serverName - The server name
|
|
24
|
-
* @param {Function} callback - Optional callback function
|
|
25
|
-
*/
|
|
26
|
-
export async function showInstallModal(categoryName, serverName, callback) {
|
|
27
|
-
console.log("Showing install modal for:", serverName);
|
|
28
|
-
|
|
29
|
-
// Wait for a short delay to ensure modal is loaded
|
|
30
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
31
|
-
|
|
32
|
-
const modal = document.getElementById('installModal');
|
|
33
|
-
if (!modal) {
|
|
34
|
-
console.error('Modal container not found');
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const title = modal.querySelector('#modalTitle');
|
|
39
|
-
const envInputsDiv = modal.querySelector('#modalEnvInputs');
|
|
40
|
-
const targetDiv = modal.querySelector('#modalTargets');
|
|
41
|
-
const modalRequirements = modal.querySelector('#modalRequirements');
|
|
42
|
-
const modalArguments = modal.querySelector('#modalArguments');
|
|
43
|
-
|
|
44
|
-
// Global array to track selected clients
|
|
45
|
-
window.selectedClients = [];
|
|
46
|
-
|
|
47
|
-
// Verify all required modal elements exist
|
|
48
|
-
if (!title || !envInputsDiv || !targetDiv || !modalRequirements || !modalArguments) {
|
|
49
|
-
console.error('Required modal elements not found');
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
title.textContent = `Install ${serverName}`;
|
|
54
|
-
envInputsDiv.innerHTML = ''; // Clear previous inputs
|
|
55
|
-
targetDiv.innerHTML = ''; // Clear previous targets
|
|
56
|
-
modalRequirements.innerHTML = ''; // Clear previous requirements
|
|
57
|
-
modalArguments.innerHTML = ''; // Clear previous arguments
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
// Fetch both targets and server data simultaneously
|
|
61
|
-
const [targetResponse, serverResponse] = await Promise.all([
|
|
62
|
-
fetch('/api/targets'),
|
|
63
|
-
fetch(`/api/categories/${categoryName}`)
|
|
64
|
-
]);
|
|
65
|
-
|
|
66
|
-
if (!targetResponse.ok || !serverResponse.ok) {
|
|
67
|
-
throw new Error('Failed to fetch required data');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const [targetData, serverData] = await Promise.all([
|
|
71
|
-
targetResponse.json(),
|
|
72
|
-
serverResponse.json()
|
|
73
|
-
]);
|
|
74
|
-
|
|
75
|
-
if (!targetData.success || !serverData.success) {
|
|
76
|
-
throw new Error('Invalid data received');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const mcpServer = serverData.data.feedConfiguration.mcpServers.find(server => server.name === serverName);
|
|
80
|
-
if (!mcpServer) {
|
|
81
|
-
throw new Error('Server configuration not found');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Add mode indicator
|
|
85
|
-
const modeSpan = document.createElement('span');
|
|
86
|
-
modeSpan.textContent = mcpServer.mode || 'stdio';
|
|
87
|
-
modeSpan.className = 'ml-2 px-2 py-0.5 text-xs bg-gray-200 text-gray-600 rounded';
|
|
88
|
-
title.appendChild(modeSpan);
|
|
89
|
-
const installationStatus = serverData.data.installationStatus || {};
|
|
90
|
-
const serverStatuses = installationStatus.serversStatus || {};
|
|
91
|
-
const serverStatus = serverStatuses[serverName] || { installedStatus: {} };
|
|
92
|
-
|
|
93
|
-
await setupModalContent(
|
|
94
|
-
targetData,
|
|
95
|
-
mcpServer,
|
|
96
|
-
serverStatus,
|
|
97
|
-
categoryName,
|
|
98
|
-
serverName,
|
|
99
|
-
serverStatuses,
|
|
100
|
-
serverData,
|
|
101
|
-
targetDiv,
|
|
102
|
-
envInputsDiv,
|
|
103
|
-
modalArguments,
|
|
104
|
-
modalRequirements
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
} catch (error) {
|
|
108
|
-
console.error("Error loading data:", error);
|
|
109
|
-
targetDiv.innerHTML = `<p class="text-red-500">Error: ${error.message}</p>`;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
modal.style.display = "block";
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Set up the modal content including client list, environment variables, and requirements
|
|
117
|
-
* @private
|
|
118
|
-
*/
|
|
119
|
-
async function setupModalContent(
|
|
120
|
-
targetData,
|
|
121
|
-
mcpServer,
|
|
122
|
-
serverStatus,
|
|
123
|
-
categoryName,
|
|
124
|
-
serverName,
|
|
125
|
-
serverStatuses,
|
|
126
|
-
serverData,
|
|
127
|
-
targetDiv,
|
|
128
|
-
envInputsDiv,
|
|
129
|
-
modalArguments,
|
|
130
|
-
modalRequirements
|
|
131
|
-
) {
|
|
132
|
-
// Create client items
|
|
133
|
-
setupClientItems(targetData.data, serverStatus, categoryName, serverName, targetDiv);
|
|
134
|
-
|
|
135
|
-
// Handle environment variables section
|
|
136
|
-
setupEnvironmentVariables(mcpServer, envInputsDiv, targetData);
|
|
137
|
-
|
|
138
|
-
// Handle installation arguments section
|
|
139
|
-
setupInstallationArguments(mcpServer.installation, modalArguments, categoryName, mcpServer);
|
|
140
|
-
|
|
141
|
-
// Handle server requirements section
|
|
142
|
-
setupServerRequirements(mcpServer, serverData, categoryName, serverName, modalRequirements);
|
|
143
|
-
|
|
144
|
-
// Set up the install form submit handler
|
|
145
|
-
const installForm = document.getElementById('installForm');
|
|
146
|
-
setupFormSubmitHandler(
|
|
147
|
-
installForm,
|
|
148
|
-
envInputsDiv,
|
|
149
|
-
modalArguments,
|
|
150
|
-
modalRequirements,
|
|
151
|
-
categoryName,
|
|
152
|
-
serverName,
|
|
153
|
-
serverStatuses,
|
|
154
|
-
serverData,
|
|
155
|
-
mcpServer
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Make functions available globally
|
|
160
|
-
window.showInstallModal = showInstallModal;
|
|
161
|
-
window.closeModal = closeModal;
|
|
162
|
-
window.uninstallTools = uninstallTools;
|