imcp 0.0.19 → 0.1.1
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/.roo/rules-code/rules.md +88 -0
- package/dist/cli/index.js +0 -0
- package/dist/core/metadatas/constants.d.ts +7 -0
- package/dist/core/metadatas/constants.js +7 -0
- package/dist/core/onboard/FeedOnboardService.d.ts +7 -3
- package/dist/core/onboard/FeedOnboardService.js +52 -5
- package/dist/services/MCPManager.js +66 -6
- package/dist/services/TelemetryService.d.ts +15 -0
- package/dist/services/TelemetryService.js +54 -0
- package/dist/utils/githubAuth.js +65 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.js +78 -1
- package/dist/utils/versionUtils.d.ts +1 -0
- package/dist/utils/versionUtils.js +29 -0
- package/dist/web/public/css/serverCategoryList.css +120 -0
- package/dist/web/public/index.html +6 -3
- package/dist/web/public/js/flights/flights.js +0 -1
- package/dist/web/public/js/onboard/formProcessor.js +18 -11
- package/dist/web/public/js/onboard/publishHandler.js +30 -0
- package/dist/web/public/js/onboard/templates.js +5 -1
- package/dist/web/public/js/onboard/uiHandlers.js +266 -39
- package/dist/web/public/js/onboard/validationHandlers.js +71 -39
- package/dist/web/public/js/serverCategoryList.js +91 -7
- package/dist/web/public/onboard.html +2 -2
- package/dist/web/server.js +11 -1
- package/{src/web/public/js/onboard → docs}/ONBOARDING_PAGE_DESIGN.md +15 -125
- package/docs/Telemetry.md +136 -0
- package/memory-bank/activeContext.md +14 -0
- package/memory-bank/decisionLog.md +28 -0
- package/memory-bank/productContext.md +41 -0
- package/memory-bank/progress.md +5 -0
- package/memory-bank/systemPatterns.md +3 -0
- package/package.json +2 -1
- package/src/core/metadatas/constants.ts +9 -0
- package/src/core/onboard/FeedOnboardService.ts +59 -5
- package/src/services/MCPManager.ts +78 -8
- package/src/services/TelemetryService.ts +59 -0
- package/src/utils/githubAuth.ts +84 -1
- package/src/utils/logger.ts +83 -1
- package/src/utils/versionUtils.ts +33 -0
- package/src/web/public/css/serverCategoryList.css +120 -0
- package/src/web/public/index.html +6 -3
- package/src/web/public/js/onboard/formProcessor.js +18 -11
- package/src/web/public/js/onboard/publishHandler.js +30 -0
- package/src/web/public/js/onboard/templates.js +5 -1
- package/src/web/public/js/onboard/uiHandlers.js +266 -39
- package/src/web/public/js/onboard/validationHandlers.js +71 -39
- package/src/web/public/js/serverCategoryList.js +91 -7
- package/src/web/public/onboard.html +2 -2
- package/src/web/server.ts +11 -1
- 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/modalUI.js +0 -214
- package/dist/web/public/js/modal/version.js +0 -20
|
@@ -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,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
|
-
}
|