@1mcp/agent 0.16.0 → 0.18.0
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/README.md +103 -11
- package/build/auth/sdkOAuthClientProvider.d.ts.map +1 -1
- package/build/auth/sdkOAuthClientProvider.js +1 -1
- package/build/auth/sdkOAuthClientProvider.js.map +1 -1
- package/build/commands/app/backups.d.ts +17 -0
- package/build/commands/app/backups.d.ts.map +1 -0
- package/build/commands/app/backups.js +162 -0
- package/build/commands/app/backups.js.map +1 -0
- package/build/commands/app/consolidate.d.ts +21 -0
- package/build/commands/app/consolidate.d.ts.map +1 -0
- package/build/commands/app/consolidate.js +383 -0
- package/build/commands/app/consolidate.js.map +1 -0
- package/build/commands/app/discover.d.ts +16 -0
- package/build/commands/app/discover.d.ts.map +1 -0
- package/build/commands/app/discover.js +79 -0
- package/build/commands/app/discover.js.map +1 -0
- package/build/commands/app/index.d.ts +12 -0
- package/build/commands/app/index.d.ts.map +1 -0
- package/build/commands/app/index.js +274 -0
- package/build/commands/app/index.js.map +1 -0
- package/build/commands/app/list.d.ts +16 -0
- package/build/commands/app/list.d.ts.map +1 -0
- package/build/commands/app/list.js +95 -0
- package/build/commands/app/list.js.map +1 -0
- package/build/commands/app/restore.d.ts +21 -0
- package/build/commands/app/restore.d.ts.map +1 -0
- package/build/commands/app/restore.js +265 -0
- package/build/commands/app/restore.js.map +1 -0
- package/build/commands/app/status.d.ts +16 -0
- package/build/commands/app/status.d.ts.map +1 -0
- package/build/commands/app/status.js +224 -0
- package/build/commands/app/status.js.map +1 -0
- package/build/commands/mcp/add.d.ts +19 -0
- package/build/commands/mcp/add.d.ts.map +1 -0
- package/build/commands/mcp/add.js +135 -0
- package/build/commands/mcp/add.js.map +1 -0
- package/build/commands/mcp/enable.d.ts +13 -0
- package/build/commands/mcp/enable.d.ts.map +1 -0
- package/build/commands/mcp/enable.js +100 -0
- package/build/commands/mcp/enable.js.map +1 -0
- package/build/commands/mcp/index.d.ts +12 -0
- package/build/commands/mcp/index.d.ts.map +1 -0
- package/build/commands/mcp/index.js +351 -0
- package/build/commands/mcp/index.js.map +1 -0
- package/build/commands/mcp/list.d.ts +11 -0
- package/build/commands/mcp/list.d.ts.map +1 -0
- package/build/commands/mcp/list.js +144 -0
- package/build/commands/mcp/list.js.map +1 -0
- package/build/commands/mcp/remove.d.ts +10 -0
- package/build/commands/mcp/remove.d.ts.map +1 -0
- package/build/commands/mcp/remove.js +89 -0
- package/build/commands/mcp/remove.js.map +1 -0
- package/build/commands/mcp/status.d.ts +10 -0
- package/build/commands/mcp/status.d.ts.map +1 -0
- package/build/commands/mcp/status.js +243 -0
- package/build/commands/mcp/status.js.map +1 -0
- package/build/commands/mcp/update.d.ts +18 -0
- package/build/commands/mcp/update.d.ts.map +1 -0
- package/build/commands/mcp/update.js +157 -0
- package/build/commands/mcp/update.js.map +1 -0
- package/build/commands/mcp/utils/configUtils.d.ts +64 -0
- package/build/commands/mcp/utils/configUtils.d.ts.map +1 -0
- package/build/commands/mcp/utils/configUtils.js +266 -0
- package/build/commands/mcp/utils/configUtils.js.map +1 -0
- package/build/commands/mcp/utils/doubleHyphenParser.d.ts +32 -0
- package/build/commands/mcp/utils/doubleHyphenParser.d.ts.map +1 -0
- package/build/commands/mcp/utils/doubleHyphenParser.js +61 -0
- package/build/commands/mcp/utils/doubleHyphenParser.js.map +1 -0
- package/build/commands/mcp/utils/validation.d.ts +33 -0
- package/build/commands/mcp/utils/validation.d.ts.map +1 -0
- package/build/commands/mcp/utils/validation.js +235 -0
- package/build/commands/mcp/utils/validation.js.map +1 -0
- package/build/constants.d.ts +11 -2
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +18 -5
- package/build/constants.js.map +1 -1
- package/build/core/capabilities/asyncLoadingOrchestrator.d.ts +96 -0
- package/build/core/capabilities/asyncLoadingOrchestrator.d.ts.map +1 -0
- package/build/core/capabilities/asyncLoadingOrchestrator.js +256 -0
- package/build/core/capabilities/asyncLoadingOrchestrator.js.map +1 -0
- package/build/core/capabilities/capabilityAggregator.d.ts +114 -0
- package/build/core/capabilities/capabilityAggregator.d.ts.map +1 -0
- package/build/core/capabilities/capabilityAggregator.js +234 -0
- package/build/core/capabilities/capabilityAggregator.js.map +1 -0
- package/build/core/client/clientManager.d.ts +29 -0
- package/build/core/client/clientManager.d.ts.map +1 -1
- package/build/core/client/clientManager.js +151 -2
- package/build/core/client/clientManager.js.map +1 -1
- package/build/core/loading/loadingStateTracker.d.ts +128 -0
- package/build/core/loading/loadingStateTracker.d.ts.map +1 -0
- package/build/core/loading/loadingStateTracker.js +211 -0
- package/build/core/loading/loadingStateTracker.js.map +1 -0
- package/build/core/loading/mcpLoadingManager.d.ts +156 -0
- package/build/core/loading/mcpLoadingManager.d.ts.map +1 -0
- package/build/core/loading/mcpLoadingManager.js +352 -0
- package/build/core/loading/mcpLoadingManager.js.map +1 -0
- package/build/core/notifications/notificationManager.d.ts +111 -0
- package/build/core/notifications/notificationManager.d.ts.map +1 -0
- package/build/core/notifications/notificationManager.js +232 -0
- package/build/core/notifications/notificationManager.js.map +1 -0
- package/build/core/server/agentConfig.d.ts +50 -0
- package/build/core/server/agentConfig.d.ts.map +1 -1
- package/build/core/server/agentConfig.js +68 -1
- package/build/core/server/agentConfig.js.map +1 -1
- package/build/core/server/serverManager.d.ts +1 -0
- package/build/core/server/serverManager.d.ts.map +1 -1
- package/build/core/server/serverManager.js +3 -0
- package/build/core/server/serverManager.js.map +1 -1
- package/build/core/types/transport.d.ts +2 -2
- package/build/index.js +133 -34
- package/build/index.js.map +1 -1
- package/build/logger/logger.d.ts +9 -0
- package/build/logger/logger.d.ts.map +1 -1
- package/build/logger/logger.js +49 -0
- package/build/logger/logger.js.map +1 -1
- package/build/logger/secureLogger.d.ts +22 -0
- package/build/logger/secureLogger.d.ts.map +1 -0
- package/build/logger/secureLogger.js +120 -0
- package/build/logger/secureLogger.js.map +1 -0
- package/build/server.d.ts +23 -2
- package/build/server.d.ts.map +1 -1
- package/build/server.js +83 -10
- package/build/server.js.map +1 -1
- package/build/services/configReloadService.d.ts +8 -0
- package/build/services/configReloadService.d.ts.map +1 -1
- package/build/services/configReloadService.js +68 -0
- package/build/services/configReloadService.js.map +1 -1
- package/build/transport/http/middlewares/mcpAvailabilityMiddleware.d.ts +79 -0
- package/build/transport/http/middlewares/mcpAvailabilityMiddleware.d.ts.map +1 -0
- package/build/transport/http/middlewares/mcpAvailabilityMiddleware.js +306 -0
- package/build/transport/http/middlewares/mcpAvailabilityMiddleware.js.map +1 -0
- package/build/transport/http/routes/healthRoutes.d.ts +2 -1
- package/build/transport/http/routes/healthRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/healthRoutes.js +170 -1
- package/build/transport/http/routes/healthRoutes.js.map +1 -1
- package/build/transport/http/routes/sseRoutes.d.ts +2 -1
- package/build/transport/http/routes/sseRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/sseRoutes.js +13 -1
- package/build/transport/http/routes/sseRoutes.js.map +1 -1
- package/build/transport/http/routes/streamableHttpRoutes.d.ts +2 -1
- package/build/transport/http/routes/streamableHttpRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/streamableHttpRoutes.js +13 -1
- package/build/transport/http/routes/streamableHttpRoutes.js.map +1 -1
- package/build/transport/http/server.d.ts +7 -1
- package/build/transport/http/server.d.ts.map +1 -1
- package/build/transport/http/server.js +15 -4
- package/build/transport/http/server.js.map +1 -1
- package/build/transport/transportFactory.d.ts +4 -0
- package/build/transport/transportFactory.d.ts.map +1 -1
- package/build/transport/transportFactory.js +1 -1
- package/build/transport/transportFactory.js.map +1 -1
- package/build/utils/appDiscovery.d.ts +75 -0
- package/build/utils/appDiscovery.d.ts.map +1 -0
- package/build/utils/appDiscovery.js +358 -0
- package/build/utils/appDiscovery.js.map +1 -0
- package/build/utils/appPresets.d.ts +88 -0
- package/build/utils/appPresets.d.ts.map +1 -0
- package/build/utils/appPresets.js +430 -0
- package/build/utils/appPresets.js.map +1 -0
- package/build/utils/backupManager.d.ts +61 -0
- package/build/utils/backupManager.d.ts.map +1 -0
- package/build/utils/backupManager.js +314 -0
- package/build/utils/backupManager.js.map +1 -0
- package/build/utils/urlDetection.d.ts +35 -0
- package/build/utils/urlDetection.d.ts.map +1 -0
- package/build/utils/urlDetection.js +115 -0
- package/build/utils/urlDetection.js.map +1 -0
- package/build/utils/validationHelpers.d.ts +62 -0
- package/build/utils/validationHelpers.d.ts.map +1 -0
- package/build/utils/validationHelpers.js +252 -0
- package/build/utils/validationHelpers.js.map +1 -0
- package/package.json +9 -2
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
/**
|
|
4
|
+
* Supported desktop applications with their configuration presets
|
|
5
|
+
*
|
|
6
|
+
* ⚠️ PLATFORM SUPPORT STATUS:
|
|
7
|
+
* - macOS (darwin): ✅ Fully tested and verified
|
|
8
|
+
* - Windows (win32): ⚠️ Paths researched but untested - see commented sections
|
|
9
|
+
* - Linux: ⚠️ Paths researched but untested - see commented sections
|
|
10
|
+
*
|
|
11
|
+
* 🤝 CONTRIBUTION NEEDED:
|
|
12
|
+
* If you're using Windows or Linux, please help verify these paths by:
|
|
13
|
+
* 1. Uncommenting the relevant sections for your platform
|
|
14
|
+
* 2. Testing the functionality
|
|
15
|
+
* 3. Reporting results or submitting fixes
|
|
16
|
+
*
|
|
17
|
+
* 📝 STANDARD LOCATIONS RESEARCH:
|
|
18
|
+
* The commented paths below are based on official documentation and
|
|
19
|
+
* common conventions, but have not been tested in real environments.
|
|
20
|
+
*/
|
|
21
|
+
export const APP_PRESETS = {
|
|
22
|
+
'claude-desktop': {
|
|
23
|
+
name: 'claude-desktop',
|
|
24
|
+
displayName: 'Claude Desktop',
|
|
25
|
+
configurable: true,
|
|
26
|
+
configFormat: 'claude-desktop',
|
|
27
|
+
locations: [
|
|
28
|
+
{
|
|
29
|
+
platform: 'darwin',
|
|
30
|
+
path: '~/Library/Application Support/Claude/claude_desktop_config.json',
|
|
31
|
+
level: 'user',
|
|
32
|
+
priority: 10,
|
|
33
|
+
},
|
|
34
|
+
// UNTESTED - Based on Claude Desktop documentation and Windows conventions
|
|
35
|
+
// {
|
|
36
|
+
// platform: 'win32',
|
|
37
|
+
// path: '%APPDATA%\\Claude\\claude_desktop_config.json',
|
|
38
|
+
// level: 'user',
|
|
39
|
+
// priority: 10,
|
|
40
|
+
// },
|
|
41
|
+
// UNTESTED - Based on XDG Base Directory specification and Linux conventions
|
|
42
|
+
// {
|
|
43
|
+
// platform: 'linux',
|
|
44
|
+
// path: '~/.config/claude/claude_desktop_config.json',
|
|
45
|
+
// level: 'user',
|
|
46
|
+
// priority: 10,
|
|
47
|
+
// },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
cursor: {
|
|
51
|
+
name: 'cursor',
|
|
52
|
+
displayName: 'Cursor',
|
|
53
|
+
configurable: true,
|
|
54
|
+
configFormat: 'generic',
|
|
55
|
+
locations: [
|
|
56
|
+
{
|
|
57
|
+
platform: 'all',
|
|
58
|
+
path: '.cursor/mcp.json',
|
|
59
|
+
level: 'project',
|
|
60
|
+
priority: 20,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
platform: 'darwin',
|
|
64
|
+
path: '~/.cursor/mcp.json',
|
|
65
|
+
level: 'user',
|
|
66
|
+
priority: 10,
|
|
67
|
+
},
|
|
68
|
+
// {
|
|
69
|
+
// platform: 'win32',
|
|
70
|
+
// path: '%APPDATA%\\Cursor\\User\\settings.json',
|
|
71
|
+
// level: 'user',
|
|
72
|
+
// priority: 10,
|
|
73
|
+
// },
|
|
74
|
+
// {
|
|
75
|
+
// platform: 'linux',
|
|
76
|
+
// path: '~/.cursor/mcp.json',
|
|
77
|
+
// level: 'user',
|
|
78
|
+
// priority: 10,
|
|
79
|
+
// },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
vscode: {
|
|
83
|
+
name: 'vscode',
|
|
84
|
+
displayName: 'VS Code',
|
|
85
|
+
configurable: true,
|
|
86
|
+
configFormat: 'vscode',
|
|
87
|
+
locations: [
|
|
88
|
+
{
|
|
89
|
+
platform: 'all',
|
|
90
|
+
path: '.vscode/mcp.json',
|
|
91
|
+
level: 'project',
|
|
92
|
+
priority: 20,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
platform: 'darwin',
|
|
96
|
+
path: '~/Library/Application Support/Code/User/settings.json',
|
|
97
|
+
level: 'user',
|
|
98
|
+
priority: 10,
|
|
99
|
+
},
|
|
100
|
+
// {
|
|
101
|
+
// platform: 'win32',
|
|
102
|
+
// path: '%APPDATA%\\Code\\User\\settings.json',
|
|
103
|
+
// level: 'user',
|
|
104
|
+
// priority: 10,
|
|
105
|
+
// },
|
|
106
|
+
// {
|
|
107
|
+
// platform: 'linux',
|
|
108
|
+
// path: '~/.config/Code/User/settings.json',
|
|
109
|
+
// level: 'user',
|
|
110
|
+
// priority: 10,
|
|
111
|
+
// },
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
'claude-code': {
|
|
115
|
+
name: 'claude-code',
|
|
116
|
+
displayName: 'Claude Code',
|
|
117
|
+
configurable: true,
|
|
118
|
+
configFormat: 'generic',
|
|
119
|
+
locations: [
|
|
120
|
+
{
|
|
121
|
+
platform: 'all',
|
|
122
|
+
path: '.mcp.json',
|
|
123
|
+
level: 'project',
|
|
124
|
+
priority: 20,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
'gemini-code': {
|
|
129
|
+
name: 'gemini-code',
|
|
130
|
+
displayName: 'Gemini Code',
|
|
131
|
+
configurable: true,
|
|
132
|
+
configFormat: 'generic',
|
|
133
|
+
locations: [
|
|
134
|
+
{
|
|
135
|
+
platform: 'darwin',
|
|
136
|
+
path: '~/.gemini/settings.json',
|
|
137
|
+
level: 'user',
|
|
138
|
+
priority: 10,
|
|
139
|
+
},
|
|
140
|
+
// {
|
|
141
|
+
// platform: 'win32',
|
|
142
|
+
// path: '%APPDATA%\\Gemini\\settings.json',
|
|
143
|
+
// level: 'user',
|
|
144
|
+
// priority: 10,
|
|
145
|
+
// },
|
|
146
|
+
// {
|
|
147
|
+
// platform: 'linux',
|
|
148
|
+
// path: '~/.gemini/settings.json',
|
|
149
|
+
// level: 'user',
|
|
150
|
+
// priority: 10,
|
|
151
|
+
// },
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
'augment-code': {
|
|
155
|
+
name: 'augment-code',
|
|
156
|
+
displayName: 'Augment Code',
|
|
157
|
+
configurable: true,
|
|
158
|
+
configFormat: 'augment',
|
|
159
|
+
locations: [
|
|
160
|
+
{
|
|
161
|
+
platform: 'darwin',
|
|
162
|
+
path: '~/Library/Application Support/Code/User/settings.json',
|
|
163
|
+
level: 'user',
|
|
164
|
+
priority: 10,
|
|
165
|
+
},
|
|
166
|
+
// {
|
|
167
|
+
// platform: 'win32',
|
|
168
|
+
// path: '%APPDATA%\\Code\\User\\settings.json',
|
|
169
|
+
// level: 'user',
|
|
170
|
+
// priority: 10,
|
|
171
|
+
// },
|
|
172
|
+
// {
|
|
173
|
+
// platform: 'linux',
|
|
174
|
+
// path: '~/.config/Code/User/settings.json',
|
|
175
|
+
// level: 'user',
|
|
176
|
+
// priority: 10,
|
|
177
|
+
// },
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
'roo-code': {
|
|
181
|
+
name: 'roo-code',
|
|
182
|
+
displayName: 'Roo Code',
|
|
183
|
+
configurable: true,
|
|
184
|
+
configFormat: 'generic',
|
|
185
|
+
locations: [
|
|
186
|
+
{
|
|
187
|
+
platform: 'all',
|
|
188
|
+
path: '.roo/mcp.json',
|
|
189
|
+
level: 'project',
|
|
190
|
+
priority: 20,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
platform: 'darwin',
|
|
194
|
+
path: '~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json',
|
|
195
|
+
level: 'user',
|
|
196
|
+
priority: 10,
|
|
197
|
+
},
|
|
198
|
+
// {
|
|
199
|
+
// platform: 'win32',
|
|
200
|
+
// path: '%APPDATA%\\Code\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\mcp_settings.json',
|
|
201
|
+
// level: 'user',
|
|
202
|
+
// priority: 10,
|
|
203
|
+
// },
|
|
204
|
+
// {
|
|
205
|
+
// platform: 'linux',
|
|
206
|
+
// path: '~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json',
|
|
207
|
+
// level: 'user',
|
|
208
|
+
// priority: 10,
|
|
209
|
+
// },
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
cline: {
|
|
213
|
+
name: 'cline',
|
|
214
|
+
displayName: 'Cline',
|
|
215
|
+
configurable: true,
|
|
216
|
+
configFormat: 'generic',
|
|
217
|
+
locations: [
|
|
218
|
+
{
|
|
219
|
+
platform: 'darwin',
|
|
220
|
+
path: '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
|
|
221
|
+
level: 'user',
|
|
222
|
+
priority: 10,
|
|
223
|
+
},
|
|
224
|
+
// {
|
|
225
|
+
// platform: 'win32',
|
|
226
|
+
// path: '%APPDATA%\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json',
|
|
227
|
+
// level: 'user',
|
|
228
|
+
// priority: 10,
|
|
229
|
+
// },
|
|
230
|
+
// {
|
|
231
|
+
// platform: 'linux',
|
|
232
|
+
// path: '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
|
|
233
|
+
// level: 'user',
|
|
234
|
+
// priority: 10,
|
|
235
|
+
// },
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
'cherry-studio': {
|
|
239
|
+
name: 'cherry-studio',
|
|
240
|
+
displayName: 'Cherry Studio',
|
|
241
|
+
configurable: false,
|
|
242
|
+
configFormat: 'generic',
|
|
243
|
+
locations: [],
|
|
244
|
+
manualInstructions: `
|
|
245
|
+
═══ Cherry Studio Setup Instructions ═══
|
|
246
|
+
1. Open Cherry Studio → Settings → MCP Servers
|
|
247
|
+
2. Remove any existing MCP server configurations (if any)
|
|
248
|
+
3. Add new server with these details:
|
|
249
|
+
|
|
250
|
+
Name: 1mcp
|
|
251
|
+
URL: {url}
|
|
252
|
+
|
|
253
|
+
4. Save and restart Cherry Studio
|
|
254
|
+
|
|
255
|
+
✅ After setup, Cherry Studio will connect to 1mcp which can proxy
|
|
256
|
+
to all your MCP servers from other clients!
|
|
257
|
+
|
|
258
|
+
💡 Add servers to 1mcp: npx @1mcp/agent server add <server-config>`,
|
|
259
|
+
},
|
|
260
|
+
continue: {
|
|
261
|
+
name: 'continue',
|
|
262
|
+
displayName: 'Continue (VS Code Extension)',
|
|
263
|
+
configurable: false,
|
|
264
|
+
configFormat: 'generic',
|
|
265
|
+
locations: [],
|
|
266
|
+
manualInstructions: `
|
|
267
|
+
═══ Continue (VS Code Extension) Setup Instructions ═══
|
|
268
|
+
1. Open VS Code → Extensions → Continue settings
|
|
269
|
+
2. Navigate to MCP Server configuration section
|
|
270
|
+
3. Remove any existing MCP server configurations (if any)
|
|
271
|
+
4. Add new server configuration:
|
|
272
|
+
|
|
273
|
+
URL: {url}
|
|
274
|
+
|
|
275
|
+
5. Save settings and restart VS Code
|
|
276
|
+
|
|
277
|
+
✅ After setup, Continue will connect to 1mcp which can proxy
|
|
278
|
+
to all your MCP servers from other clients!
|
|
279
|
+
|
|
280
|
+
💡 Add servers to 1mcp: npx @1mcp/agent server add <server-config>`,
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Get all supported application names
|
|
285
|
+
*/
|
|
286
|
+
export function getSupportedApps() {
|
|
287
|
+
return Object.keys(APP_PRESETS);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Get configurable applications (can be auto-consolidated)
|
|
291
|
+
*/
|
|
292
|
+
export function getConfigurableApps() {
|
|
293
|
+
return Object.entries(APP_PRESETS)
|
|
294
|
+
.filter(([_, preset]) => preset.configurable)
|
|
295
|
+
.map(([name, _]) => name);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Get manual-only applications (require manual setup instructions)
|
|
299
|
+
*/
|
|
300
|
+
export function getManualOnlyApps() {
|
|
301
|
+
return Object.entries(APP_PRESETS)
|
|
302
|
+
.filter(([_, preset]) => !preset.configurable)
|
|
303
|
+
.map(([name, _]) => name);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Get preset configuration for an application
|
|
307
|
+
*/
|
|
308
|
+
export function getAppPreset(appName) {
|
|
309
|
+
return APP_PRESETS[appName] || null;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Resolve platform-specific paths for an application
|
|
313
|
+
*/
|
|
314
|
+
export function getAppConfigPaths(appName) {
|
|
315
|
+
const preset = getAppPreset(appName);
|
|
316
|
+
if (!preset || !preset.configurable) {
|
|
317
|
+
return [];
|
|
318
|
+
}
|
|
319
|
+
const platform = process.platform;
|
|
320
|
+
const relevantLocations = preset.locations.filter((location) => location.platform === 'all' || location.platform === platform);
|
|
321
|
+
// Sort by priority (highest first)
|
|
322
|
+
relevantLocations.sort((a, b) => b.priority - a.priority);
|
|
323
|
+
return relevantLocations.map((location) => resolvePath(location.path));
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Check if the current platform has verified support for an app
|
|
327
|
+
*/
|
|
328
|
+
export function isPlatformTested(appName) {
|
|
329
|
+
const preset = getAppPreset(appName);
|
|
330
|
+
if (!preset)
|
|
331
|
+
return false;
|
|
332
|
+
const platform = process.platform;
|
|
333
|
+
// Only macOS is currently tested
|
|
334
|
+
if (platform !== 'darwin')
|
|
335
|
+
return false;
|
|
336
|
+
return preset.locations.some((loc) => loc.platform === 'darwin' || loc.platform === 'all');
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Get platform support message for CLI users
|
|
340
|
+
*/
|
|
341
|
+
export function getPlatformSupportMessage(_appName) {
|
|
342
|
+
const platform = process.platform;
|
|
343
|
+
if (platform === 'darwin') {
|
|
344
|
+
return '✅ Fully supported and tested on macOS';
|
|
345
|
+
}
|
|
346
|
+
const platformName = platform === 'win32' ? 'Windows' : 'Linux';
|
|
347
|
+
return `⚠️ ${platformName} support is experimental - paths researched but untested.
|
|
348
|
+
If you encounter issues, please contribute by:
|
|
349
|
+
1. Testing the functionality
|
|
350
|
+
2. Reporting results at https://github.com/1mcp-app/agent/issues
|
|
351
|
+
3. Submitting corrections if needed`;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Display platform support warning for CLI commands if needed
|
|
355
|
+
*/
|
|
356
|
+
export function showPlatformWarningIfNeeded() {
|
|
357
|
+
const platform = process.platform;
|
|
358
|
+
if (platform !== 'darwin') {
|
|
359
|
+
const platformName = platform === 'win32' ? 'Windows' : 'Linux';
|
|
360
|
+
console.log('⚠️ PLATFORM SUPPORT WARNING');
|
|
361
|
+
console.log(`${platformName} support is experimental - paths researched but untested.`);
|
|
362
|
+
console.log('If you encounter issues, please contribute by:');
|
|
363
|
+
console.log(' 1. Testing the functionality');
|
|
364
|
+
console.log(' 2. Reporting results at https://github.com/1mcp-app/agent/issues');
|
|
365
|
+
console.log(' 3. Submitting corrections if needed');
|
|
366
|
+
console.log('');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Resolve path with environment variable expansion
|
|
371
|
+
*/
|
|
372
|
+
function resolvePath(pathStr) {
|
|
373
|
+
// Replace ~ with home directory
|
|
374
|
+
if (pathStr.startsWith('~')) {
|
|
375
|
+
pathStr = path.join(os.homedir(), pathStr.slice(1));
|
|
376
|
+
}
|
|
377
|
+
// Replace %APPDATA% on Windows
|
|
378
|
+
if (process.platform === 'win32' && pathStr.includes('%APPDATA%')) {
|
|
379
|
+
const appData = process.env.APPDATA || '';
|
|
380
|
+
pathStr = pathStr.replace('%APPDATA%', appData);
|
|
381
|
+
}
|
|
382
|
+
// Handle other environment variables
|
|
383
|
+
pathStr = pathStr.replace(/\$\{([^}]+)\}/g, (match, envVar) => {
|
|
384
|
+
return process.env[envVar] || match;
|
|
385
|
+
});
|
|
386
|
+
return path.resolve(pathStr);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Generate manual setup instructions for an app
|
|
390
|
+
*/
|
|
391
|
+
export function generateManualInstructions(appName, url) {
|
|
392
|
+
const preset = getAppPreset(appName);
|
|
393
|
+
if (!preset || !preset.manualInstructions) {
|
|
394
|
+
return `Manual setup instructions not available for ${appName}.`;
|
|
395
|
+
}
|
|
396
|
+
return preset.manualInstructions.replace(/\{url\}/g, url);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Check if an application is supported
|
|
400
|
+
*/
|
|
401
|
+
export function isAppSupported(appName) {
|
|
402
|
+
return appName in APP_PRESETS;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Check if an application is configurable (auto-consolidation supported)
|
|
406
|
+
*/
|
|
407
|
+
export function isAppConfigurable(appName) {
|
|
408
|
+
const preset = getAppPreset(appName);
|
|
409
|
+
return preset ? preset.configurable : false;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Generate dynamic supported apps list for CLI help text
|
|
413
|
+
*/
|
|
414
|
+
export function generateSupportedAppsHelp() {
|
|
415
|
+
const configurableApps = getConfigurableApps();
|
|
416
|
+
const manualApps = getManualOnlyApps();
|
|
417
|
+
let helpText = 'SUPPORTED APPS:\n';
|
|
418
|
+
// Add configurable apps
|
|
419
|
+
configurableApps.forEach((appName) => {
|
|
420
|
+
const preset = APP_PRESETS[appName];
|
|
421
|
+
helpText += ` - ${appName}: ${preset.displayName}\n`;
|
|
422
|
+
});
|
|
423
|
+
// Add manual apps with note
|
|
424
|
+
manualApps.forEach((appName) => {
|
|
425
|
+
const preset = APP_PRESETS[appName];
|
|
426
|
+
helpText += ` - ${appName}: ${preset.displayName} (manual setup only)\n`;
|
|
427
|
+
});
|
|
428
|
+
return helpText.trimEnd();
|
|
429
|
+
}
|
|
430
|
+
//# sourceMappingURL=appPresets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appPresets.js","sourceRoot":"","sources":["../../src/utils/appPresets.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAyBpB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAA8B;IACpD,gBAAgB,EAAE;QAChB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,gBAAgB;QAC7B,YAAY,EAAE,IAAI;QAClB,YAAY,EAAE,gBAAgB;QAC9B,SAAS,EAAE;YACT;gBACE,QAAQ,EAAE,QAAQ;gBAClB,IAAI,EAAE,iEAAiE;gBACvE,KAAK,EAAE,MAAM;gBACb,QAAQ,EAAE,EAAE;aACb;YACD,2EAA2E;YAC3E,IAAI;YACJ,uBAAuB;YACvB,2DAA2D;YAC3D,mBAAmB;YACnB,kBAAkB;YAClB,KAAK;YACL,6EAA6E;YAC7E,IAAI;YACJ,uBAAuB;YACvB,yDAAyD;YACzD,mBAAmB;YACnB,kBAAkB;YAClB,KAAK;SACN;KACF;IAED,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,QAAQ;QACrB,YAAY,EAAE,IAAI;QAClB,YAAY,EAAE,SAAS;QACvB,SAAS,EAAE;YACT;gBACE,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,SAAS;gBAChB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,QAAQ,EAAE,QAAQ;gBAClB,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,MAAM;gBACb,QAAQ,EAAE,EAAE;aACb;YACD,IAAI;YACJ,uBAAuB;YACvB,oDAAoD;YACpD,mBAAmB;YACnB,kBAAkB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;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IAEvC,IAAI,QAAQ,GAAG,mBAAmB,CAAC;IAEnC,wBAAwB;IACxB,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QACpC,QAAQ,IAAI,OAAO,OAAO,KAAK,MAAM,CAAC,WAAW,IAAI,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,4BAA4B;IAC5B,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QACpC,QAAQ,IAAI,OAAO,OAAO,KAAK,MAAM,CAAC,WAAW,wBAAwB,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backup and recovery system for app configuration consolidation.
|
|
3
|
+
*
|
|
4
|
+
* Provides safe backup creation, metadata tracking, and rollback
|
|
5
|
+
* capabilities for configuration operations.
|
|
6
|
+
*/
|
|
7
|
+
export interface BackupInfo {
|
|
8
|
+
originalPath: string;
|
|
9
|
+
backupPath: string;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
checksum: string;
|
|
12
|
+
metadata: {
|
|
13
|
+
app: string;
|
|
14
|
+
operation: string;
|
|
15
|
+
version: string;
|
|
16
|
+
serverCount: number;
|
|
17
|
+
fileSize: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface BackupListItem {
|
|
21
|
+
app: string;
|
|
22
|
+
backupPath: string;
|
|
23
|
+
metaPath: string;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
operation: string;
|
|
26
|
+
serverCount: number;
|
|
27
|
+
age: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a backup of configuration file with metadata
|
|
31
|
+
*/
|
|
32
|
+
export declare function createBackup(configPath: string, app: string, operation: string, serverCount?: number): BackupInfo;
|
|
33
|
+
/**
|
|
34
|
+
* Rollback from backup file
|
|
35
|
+
*/
|
|
36
|
+
export declare function rollbackFromBackup(backup: BackupInfo): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Rollback from backup file path
|
|
39
|
+
*/
|
|
40
|
+
export declare function rollbackFromBackupPath(backupPath: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* List all available backups for a specific app
|
|
43
|
+
*/
|
|
44
|
+
export declare function listAppBackups(app?: string): BackupListItem[];
|
|
45
|
+
/**
|
|
46
|
+
* Find backup by metadata file path
|
|
47
|
+
*/
|
|
48
|
+
export declare function findBackupByMetaPath(metaPath: string): BackupInfo | null;
|
|
49
|
+
/**
|
|
50
|
+
* Clean up old backups (older than specified days)
|
|
51
|
+
*/
|
|
52
|
+
export declare function cleanupOldBackups(maxAgeDays?: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Verify backup integrity
|
|
55
|
+
*/
|
|
56
|
+
export declare function verifyBackupIntegrity(backupInfo: BackupInfo): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* File locking mechanism for atomic operations
|
|
59
|
+
*/
|
|
60
|
+
export declare function withFileLock<T>(filePath: string, operation: () => Promise<T>): Promise<T>;
|
|
61
|
+
//# sourceMappingURL=backupManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backupManager.d.ts","sourceRoot":"","sources":["../../src/utils/backupManager.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,C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