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
package/src/web/server.ts
DELETED
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
import express, { Request, Response } from 'express';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { ServerSchema } from '../core/loaders/ServerSchemaProvider.js';
|
|
5
|
-
import {
|
|
6
|
-
RequirementConfig,
|
|
7
|
-
FeedConfiguration,
|
|
8
|
-
MCPServerCategory,
|
|
9
|
-
McpConfig,
|
|
10
|
-
EnvVariableConfig
|
|
11
|
-
} from '../core/metadatas/types.js';
|
|
12
|
-
import {
|
|
13
|
-
ApiResponse,
|
|
14
|
-
ListQueryParams,
|
|
15
|
-
InstallServersRequestBody,
|
|
16
|
-
UninstallServersRequestBody,
|
|
17
|
-
OnboardRequestBody,
|
|
18
|
-
OnboardServerConfig,
|
|
19
|
-
OnboardRequirementConfig,
|
|
20
|
-
RequirementType
|
|
21
|
-
} from './contract/serverContract.js';
|
|
22
|
-
|
|
23
|
-
import { OperationStatus, OnboardingProcessStatus, OperationType } from '../core/onboard/OnboardStatus.js';
|
|
24
|
-
import { SUPPORTED_CLIENT_NAMES } from '../core/metadatas/constants.js';
|
|
25
|
-
import { serverService } from '../services/ServerService.js';
|
|
26
|
-
import { feedOnboardService } from '../core/onboard/FeedOnboardService.js';
|
|
27
|
-
import { openBrowser } from '../utils/osUtils.js';
|
|
28
|
-
import { Logger, EventType, EventStatus } from '../utils/logger.js';
|
|
29
|
-
import { configProvider } from '../core/loaders/ConfigurationProvider.js';
|
|
30
|
-
import { onboardStatusManager } from '../core/onboard/OnboardStatusManager.js';
|
|
31
|
-
import { InstallOperationManager } from '../core/loaders/InstallOperationManager.js';
|
|
32
|
-
import { systemSettingsManager } from '../core/loaders/SystemSettingsManager.js';
|
|
33
|
-
import { SystemSettings } from '../core/metadatas/types.js';
|
|
34
|
-
import { getAppVersion } from '../utils/versionUtils.js';
|
|
35
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
36
|
-
const app = express();
|
|
37
|
-
|
|
38
|
-
// Middleware
|
|
39
|
-
app.use('/', express.static(path.join(__dirname, '..', '..', 'src', 'web', 'public')));
|
|
40
|
-
app.use(express.json());
|
|
41
|
-
|
|
42
|
-
// Get available targets
|
|
43
|
-
app.get('/api/targets', async (req: Request, res: Response) => {
|
|
44
|
-
try {
|
|
45
|
-
// Get clientMcpSettings
|
|
46
|
-
const clientMcpSettings = await configProvider.getClientMcpSettings();
|
|
47
|
-
|
|
48
|
-
// Keep original format but add clientMcpSettings as additional property
|
|
49
|
-
const response: ApiResponse<string[]> & { clientMcpSettings?: Record<string, Record<string, any>> } = {
|
|
50
|
-
success: true,
|
|
51
|
-
data: SUPPORTED_CLIENT_NAMES,
|
|
52
|
-
clientMcpSettings: clientMcpSettings
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
res.json(response);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
58
|
-
res.status(500).json({
|
|
59
|
-
success: false,
|
|
60
|
-
error: message
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// List server categories
|
|
66
|
-
app.get('/api/categories', async (req: Request<{}, {}, {}, ListQueryParams>, res: Response) => {
|
|
67
|
-
try {
|
|
68
|
-
const { local } = req.query;
|
|
69
|
-
const servers = await serverService.listServerCategories({
|
|
70
|
-
local: local !== 'false'
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const response: ApiResponse<typeof servers> = {
|
|
74
|
-
success: true,
|
|
75
|
-
data: servers
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
res.json(response);
|
|
79
|
-
} catch (error) {
|
|
80
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
81
|
-
res.status(500).json({
|
|
82
|
-
success: false,
|
|
83
|
-
error: message
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// Get server schema
|
|
89
|
-
app.get('/api/categories/:categoryName/servers/:serverName/schema', async (req: Request<{ categoryName: string; serverName: string }>, res: Response) => {
|
|
90
|
-
try {
|
|
91
|
-
const { categoryName, serverName } = req.params;
|
|
92
|
-
const schema = await serverService.getServerSchema(categoryName, serverName);
|
|
93
|
-
|
|
94
|
-
if (!schema) {
|
|
95
|
-
return res.status(404).json({
|
|
96
|
-
success: false,
|
|
97
|
-
error: `Schema not found for server ${serverName} in category ${categoryName}`
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const response: ApiResponse<ServerSchema> = {
|
|
102
|
-
success: true,
|
|
103
|
-
data: schema
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
res.json(response);
|
|
107
|
-
} catch (error) {
|
|
108
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
109
|
-
res.status(500).json({
|
|
110
|
-
success: false,
|
|
111
|
-
error: `Failed to get schema for server ${req.params.serverName} in category ${req.params.categoryName}: ${message}`
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
// Get categories data (including feed configuration)
|
|
117
|
-
app.get('/api/categories/:categoryName', async (req: Request<{ categoryName: string }>, res: Response) => {
|
|
118
|
-
try {
|
|
119
|
-
const { categoryName } = req.params;
|
|
120
|
-
const serverData = await serverService.getServerCategory(categoryName);
|
|
121
|
-
|
|
122
|
-
if (!serverData) {
|
|
123
|
-
return res.status(404).json({
|
|
124
|
-
success: false,
|
|
125
|
-
error: `Server category ${categoryName} not found`
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const response: ApiResponse<any> = {
|
|
130
|
-
success: true,
|
|
131
|
-
data: serverData
|
|
132
|
-
};
|
|
133
|
-
res.json(response);
|
|
134
|
-
} catch (error) {
|
|
135
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
136
|
-
res.status(500).json({
|
|
137
|
-
success: false,
|
|
138
|
-
error: `Failed to get server category data for ${req.params.categoryName}: ${message}`
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
// Handle server category onboarding
|
|
144
|
-
|
|
145
|
-
// Install servers for a category
|
|
146
|
-
app.post('/api/categories/:categoryName/install', async (req: Request<{ categoryName: string }, {}, InstallServersRequestBody>, res: Response) => {
|
|
147
|
-
try {
|
|
148
|
-
const { categoryName } = req.params;
|
|
149
|
-
const { serverList } = req.body;
|
|
150
|
-
|
|
151
|
-
if (!serverList || Object.keys(serverList).length === 0) {
|
|
152
|
-
return res.status(400).json({
|
|
153
|
-
success: false,
|
|
154
|
-
error: 'Invalid server list provided'
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const results = await Promise.all(
|
|
159
|
-
Object.entries(serverList).map(([serverName, options]) => serverService.installMcpServer(categoryName, serverName, options))
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
const { success, messages } = serverService.formatOperationResults(results);
|
|
163
|
-
|
|
164
|
-
const response: ApiResponse<{ messages: string[] }> = {
|
|
165
|
-
success,
|
|
166
|
-
data: { messages }
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
res.json(response);
|
|
170
|
-
} catch (error) {
|
|
171
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
172
|
-
res.status(500).json({
|
|
173
|
-
success: false,
|
|
174
|
-
error: `Failed to install server for ${req.params.categoryName}: ${message}`
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// Handle server category onboarding
|
|
182
|
-
app.post('/api/categories/onboard', async (req: Request<{}, {}, OnboardRequestBody>, res: Response) => {
|
|
183
|
-
try {
|
|
184
|
-
const { categoryData, forExistingCategory } = req.body; // Extract forExistingCategory from request body
|
|
185
|
-
|
|
186
|
-
// Basic validation for categoryData presence and essential fields for this endpoint
|
|
187
|
-
if (!categoryData || !categoryData.name || !categoryData.displayName) {
|
|
188
|
-
return res.status(400).json({
|
|
189
|
-
success: false,
|
|
190
|
-
error: 'Category data, including name and display name, is required.'
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// categoryData is now expected to be a FeedConfiguration object directly from the client
|
|
195
|
-
const feedConfiguration: FeedConfiguration = categoryData as FeedConfiguration;
|
|
196
|
-
|
|
197
|
-
// Structural validation is now primarily handled by FeedOnboardService.validateStaticConfig
|
|
198
|
-
// The service will throw an error if the structure is invalid, which will be caught by the catch block below.
|
|
199
|
-
|
|
200
|
-
const operationResult = await feedOnboardService.onboardFeed(feedConfiguration, forExistingCategory);
|
|
201
|
-
|
|
202
|
-
// The response now directly reflects the OperationStatus returned by the service.
|
|
203
|
-
// The client will use data.onboardingId (which is the categoryName) to poll for status updates.
|
|
204
|
-
const response: ApiResponse<typeof operationResult> = {
|
|
205
|
-
success: operationResult.status !== OnboardingProcessStatus.FAILED, // Or a more nuanced success check
|
|
206
|
-
// Ensure data.onboardingId is the categoryName for polling
|
|
207
|
-
data: { ...operationResult, onboardingId: feedConfiguration.name }
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
res.status(operationResult.status === OnboardingProcessStatus.FAILED ? 500 : 200).json(response);
|
|
211
|
-
} catch (error) {
|
|
212
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
213
|
-
res.status(500).json({
|
|
214
|
-
success: false,
|
|
215
|
-
error: `Failed to ${req.body.isUpdate ? 'update' : 'create'} server category: ${message}`
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
// Validate feed configuration
|
|
221
|
-
app.post('/api/categories/onboard/validate', async (req: Request<{}, {}, OnboardRequestBody>, res: Response) => {
|
|
222
|
-
try {
|
|
223
|
-
const { categoryData, forExistingCategory } = req.body;
|
|
224
|
-
|
|
225
|
-
if (!categoryData || !categoryData.name) {
|
|
226
|
-
return res.status(400).json({
|
|
227
|
-
success: false,
|
|
228
|
-
error: 'Category name is required in categoryData for validation.'
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// categoryData is now expected to be a FeedConfiguration object directly from the client
|
|
233
|
-
const feedConfigurationToValidate: FeedConfiguration = categoryData as FeedConfiguration;
|
|
234
|
-
|
|
235
|
-
// Structural validation is now primarily handled by FeedOnboardService.validateStaticConfig
|
|
236
|
-
// The service will throw an error if the structure is invalid, which will be caught by the catch block below.
|
|
237
|
-
|
|
238
|
-
// Call the service, which now returns OperationStatus & { feedConfiguration? }
|
|
239
|
-
// serverName parameter has been removed from validateFeed
|
|
240
|
-
const validationOperationResult = await feedOnboardService.validateFeed(feedConfigurationToValidate, forExistingCategory);
|
|
241
|
-
|
|
242
|
-
// The response includes the operation status and the feed configuration that was validated.
|
|
243
|
-
// The client will use data.onboardingId (which is the categoryName) to poll for status updates.
|
|
244
|
-
const response: ApiResponse<typeof validationOperationResult> = {
|
|
245
|
-
success: validationOperationResult.status !== OnboardingProcessStatus.FAILED,
|
|
246
|
-
// Ensure data.onboardingId is the categoryName for polling
|
|
247
|
-
data: { ...validationOperationResult, onboardingId: feedConfigurationToValidate.name }
|
|
248
|
-
};
|
|
249
|
-
res.status(validationOperationResult.status === OnboardingProcessStatus.FAILED ? 500 : 200).json(response);
|
|
250
|
-
} catch (error) {
|
|
251
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
252
|
-
res.status(500).json({
|
|
253
|
-
success: false,
|
|
254
|
-
error: `Failed to validate server category: ${message}`
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
// Get category onboarding/validation operation status
|
|
260
|
-
app.get('/api/categories/:categoryName/onboard/status', async (req: Request<{ categoryName: string }, {}, {}, { operationType?: string }>, res: Response) => {
|
|
261
|
-
try {
|
|
262
|
-
const { categoryName } = req.params;
|
|
263
|
-
const { operationType } = req.query;
|
|
264
|
-
|
|
265
|
-
if (!operationType) {
|
|
266
|
-
return res.status(400).json({
|
|
267
|
-
success: false,
|
|
268
|
-
error: 'operationType query parameter is required.'
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// Validate operationType if necessary (e.g., check against known OperationType values)
|
|
273
|
-
// For now, we'll assume it's a valid OperationType string.
|
|
274
|
-
const validOperationType = operationType as OperationType;
|
|
275
|
-
|
|
276
|
-
const status = await onboardStatusManager.getStatus(categoryName, validOperationType);
|
|
277
|
-
|
|
278
|
-
if (!status) {
|
|
279
|
-
return res.status(404).json({
|
|
280
|
-
success: false,
|
|
281
|
-
error: `No active operation found for category ${categoryName} with operation type ${validOperationType}`
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// Construct the response data based on the retrieved OnboardStatus
|
|
286
|
-
const lastStepName = status.steps && status.steps.length > 0 ? status.steps[status.steps.length - 1].stepName : undefined;
|
|
287
|
-
const responseData: OperationStatus & { steps?: any[], feedConfiguration?: FeedConfiguration } = { // Added steps and feedConfiguration to type
|
|
288
|
-
onboardingId: status.onboardingId, // This is categoryName_operationType
|
|
289
|
-
status: status.status,
|
|
290
|
-
message: lastStepName || status.errorMessage || 'Processing...',
|
|
291
|
-
lastQueried: new Date().toISOString(),
|
|
292
|
-
steps: status.steps, // Include the steps array in the response
|
|
293
|
-
...(status.validationStatus && { validationStatus: status.validationStatus }),
|
|
294
|
-
...(status.prInfo && { prInfo: status.prInfo }),
|
|
295
|
-
...(status.result && { result: status.result }),
|
|
296
|
-
...(status.errorMessage && { errorMessage: status.errorMessage }),
|
|
297
|
-
operationType: status.operationType, // Always include operationType from the status object
|
|
298
|
-
// Attempt to include feedConfiguration if available, especially for SUCCEEDED VALIDATION_ONLY
|
|
299
|
-
...(status.operationType === 'VALIDATION_ONLY' && status.status === OnboardingProcessStatus.SUCCEEDED && status.result?.feedConfiguration && { feedConfiguration: status.result.feedConfiguration }),
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
const response: ApiResponse<typeof responseData> = {
|
|
303
|
-
success: true,
|
|
304
|
-
data: responseData
|
|
305
|
-
};
|
|
306
|
-
res.json(response);
|
|
307
|
-
} catch (error) {
|
|
308
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
309
|
-
res.status(500).json({
|
|
310
|
-
success: false,
|
|
311
|
-
error: `Failed to get operation status for category ${req.params.categoryName}: ${message}`
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
// Get installation operation status
|
|
317
|
-
app.get('/api/categories/:categoryName/servers/:serverName/installation/status', async (req: Request<{ categoryName: string; serverName: string }>, res: Response) => {
|
|
318
|
-
try {
|
|
319
|
-
const { categoryName, serverName } = req.params;
|
|
320
|
-
const details = await InstallOperationManager.getInstance(categoryName, serverName).getDetails();
|
|
321
|
-
|
|
322
|
-
if (!details) {
|
|
323
|
-
return res.status(404).json({
|
|
324
|
-
success: false,
|
|
325
|
-
error: `No installation operation found for server ${serverName} in category ${categoryName}`
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
const response: ApiResponse<typeof details> = {
|
|
330
|
-
success: true,
|
|
331
|
-
data: details
|
|
332
|
-
};
|
|
333
|
-
res.json(response);
|
|
334
|
-
} catch (error) {
|
|
335
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
336
|
-
res.status(500).json({
|
|
337
|
-
success: false,
|
|
338
|
-
error: `Failed to get installation operation status for server ${req.params.serverName} in category ${req.params.categoryName}: ${message}`
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
// Uninstall tools from a server
|
|
344
|
-
app.post('/api/categories/:categoryName/uninstall', async (req: Request<{ categoryName: string }, {}, UninstallServersRequestBody>, res: Response) => {
|
|
345
|
-
try {
|
|
346
|
-
const { categoryName } = req.params;
|
|
347
|
-
const { serverList } = req.body;
|
|
348
|
-
|
|
349
|
-
if (!serverList || Object.keys(serverList).length === 0) {
|
|
350
|
-
return res.status(400).json({
|
|
351
|
-
success: false,
|
|
352
|
-
error: 'Invalid tool list provided'
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
const { options } = req.body;
|
|
357
|
-
if (!options?.targets || options.targets.length === 0) {
|
|
358
|
-
return res.status(400).json({
|
|
359
|
-
success: false,
|
|
360
|
-
error: 'No target clients specified'
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
const results = await Promise.all(
|
|
365
|
-
Object.entries(serverList).map(([serverName, serverOptions]) =>
|
|
366
|
-
serverService.uninstallMcpServer(categoryName, serverName, {
|
|
367
|
-
...serverOptions,
|
|
368
|
-
targets: options.targets,
|
|
369
|
-
removeData: options.removeData ?? serverOptions.removeData
|
|
370
|
-
})
|
|
371
|
-
)
|
|
372
|
-
);
|
|
373
|
-
|
|
374
|
-
const { success, messages } = serverService.formatOperationResults(results);
|
|
375
|
-
|
|
376
|
-
const response: ApiResponse<{ messages: string[] }> = {
|
|
377
|
-
success,
|
|
378
|
-
data: { messages }
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
res.json(response);
|
|
382
|
-
} catch (error) {
|
|
383
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
384
|
-
res.status(500).json({
|
|
385
|
-
success: false,
|
|
386
|
-
error: `Failed to uninstall servers from ${req.params.categoryName}: ${message}`
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
// System Settings API
|
|
392
|
-
app.get('/api/settings', async (req: Request, res: Response) => {
|
|
393
|
-
try {
|
|
394
|
-
const settings = await systemSettingsManager.getSystemSettings();
|
|
395
|
-
const response: ApiResponse<SystemSettings> = {
|
|
396
|
-
success: true,
|
|
397
|
-
data: settings
|
|
398
|
-
};
|
|
399
|
-
res.json(response);
|
|
400
|
-
} catch (error) {
|
|
401
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
402
|
-
res.status(500).json({
|
|
403
|
-
success: false,
|
|
404
|
-
error: `Failed to get system settings: ${message}`
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
app.post('/api/settings', async (req: Request<{}, {}, Partial<SystemSettings>>, res: Response) => {
|
|
410
|
-
try {
|
|
411
|
-
const newSettings = req.body;
|
|
412
|
-
const updatedSettings = await systemSettingsManager.createOrUpdateSystemSettings(newSettings);
|
|
413
|
-
const response: ApiResponse<SystemSettings> = {
|
|
414
|
-
success: true,
|
|
415
|
-
data: updatedSettings
|
|
416
|
-
};
|
|
417
|
-
res.json(response);
|
|
418
|
-
} catch (error) {
|
|
419
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
420
|
-
res.status(500).json({
|
|
421
|
-
success: false,
|
|
422
|
-
error: `Failed to update system settings: ${message}`
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
|
|
427
|
-
// API to get package version
|
|
428
|
-
app.get('/api/version', async (req: Request, res: Response) => {
|
|
429
|
-
try {
|
|
430
|
-
const appVersionData = await getAppVersion();
|
|
431
|
-
const response: ApiResponse<typeof appVersionData> = {
|
|
432
|
-
success: true,
|
|
433
|
-
data: appVersionData
|
|
434
|
-
};
|
|
435
|
-
res.json(response);
|
|
436
|
-
} catch (error) {
|
|
437
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
438
|
-
res.status(500).json({
|
|
439
|
-
success: false,
|
|
440
|
-
error: `Failed to get package version: ${message}`
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
export async function startWebServer(port = 3000): Promise<void> {
|
|
446
|
-
return new Promise((resolve, reject) => {
|
|
447
|
-
const server = app.listen(port, () => {
|
|
448
|
-
const url = `http://localhost:${port}`;
|
|
449
|
-
Logger.log(`IMCP web interface running at ${url}`);
|
|
450
|
-
|
|
451
|
-
// Open the URL in the default browser
|
|
452
|
-
openBrowser(url).catch(err => {
|
|
453
|
-
console.warn(`Failed to open browser: ${err.message}`);
|
|
454
|
-
});
|
|
455
|
-
|
|
456
|
-
// Track IMCP serve event
|
|
457
|
-
Logger.trackEvent(EventType.IMCP_SERVE, {
|
|
458
|
-
status: EventStatus.SUCCESS,
|
|
459
|
-
port: port,
|
|
460
|
-
});
|
|
461
|
-
resolve();
|
|
462
|
-
});
|
|
463
|
-
|
|
464
|
-
server.on('error', (error) => {
|
|
465
|
-
Logger.trackEvent(EventType.IMCP_SERVE, {
|
|
466
|
-
status: EventStatus.FAILED,
|
|
467
|
-
errorMessage: error instanceof Error ? error.message : String(error),
|
|
468
|
-
port: port
|
|
469
|
-
});
|
|
470
|
-
reject(error);
|
|
471
|
-
});
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// Allow running directly
|
|
476
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
477
|
-
startWebServer().catch(console.error);
|
|
478
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"sourceMap": true,
|
|
14
|
-
"resolveJsonModule": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*"],
|
|
17
|
-
"exclude": ["node_modules", "dist", "**/*.test.ts"]
|
|
18
|
-
}
|
package/wiki/Installation.md
DELETED
package/wiki/Publish.md
DELETED