@tostudy-ai/mcp-setup 1.0.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 +149 -0
- package/bin/cli.js +6 -0
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.d.ts +52 -0
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.d.ts.map +1 -0
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.js +720 -0
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.js.map +1 -0
- package/dist/__tests__/e2e-wizard-flow.test.d.ts +43 -0
- package/dist/__tests__/e2e-wizard-flow.test.d.ts.map +1 -0
- package/dist/__tests__/e2e-wizard-flow.test.js +407 -0
- package/dist/__tests__/e2e-wizard-flow.test.js.map +1 -0
- package/dist/__tests__/ide-handlers.test.d.ts +10 -0
- package/dist/__tests__/ide-handlers.test.d.ts.map +1 -0
- package/dist/__tests__/ide-handlers.test.js +336 -0
- package/dist/__tests__/ide-handlers.test.js.map +1 -0
- package/dist/__tests__/install-command.test.d.ts +10 -0
- package/dist/__tests__/install-command.test.d.ts.map +1 -0
- package/dist/__tests__/install-command.test.js +237 -0
- package/dist/__tests__/install-command.test.js.map +1 -0
- package/dist/config.d.ts +51 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +117 -0
- package/dist/config.js.map +1 -0
- package/dist/detect.d.ts +42 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +277 -0
- package/dist/detect.js.map +1 -0
- package/dist/diagnose.d.ts +36 -0
- package/dist/diagnose.d.ts.map +1 -0
- package/dist/diagnose.js +512 -0
- package/dist/diagnose.js.map +1 -0
- package/dist/ide-handlers/base.d.ts +36 -0
- package/dist/ide-handlers/base.d.ts.map +1 -0
- package/dist/ide-handlers/base.js +41 -0
- package/dist/ide-handlers/base.js.map +1 -0
- package/dist/ide-handlers/claude-code.d.ts +15 -0
- package/dist/ide-handlers/claude-code.d.ts.map +1 -0
- package/dist/ide-handlers/claude-code.js +50 -0
- package/dist/ide-handlers/claude-code.js.map +1 -0
- package/dist/ide-handlers/cursor.d.ts +15 -0
- package/dist/ide-handlers/cursor.d.ts.map +1 -0
- package/dist/ide-handlers/cursor.js +61 -0
- package/dist/ide-handlers/cursor.js.map +1 -0
- package/dist/ide-handlers/desktop.d.ts +16 -0
- package/dist/ide-handlers/desktop.d.ts.map +1 -0
- package/dist/ide-handlers/desktop.js +26 -0
- package/dist/ide-handlers/desktop.js.map +1 -0
- package/dist/ide-handlers/index.d.ts +21 -0
- package/dist/ide-handlers/index.d.ts.map +1 -0
- package/dist/ide-handlers/index.js +49 -0
- package/dist/ide-handlers/index.js.map +1 -0
- package/dist/ide-handlers/manual.d.ts +16 -0
- package/dist/ide-handlers/manual.d.ts.map +1 -0
- package/dist/ide-handlers/manual.js +34 -0
- package/dist/ide-handlers/manual.js.map +1 -0
- package/dist/ide-handlers/opencode.d.ts +15 -0
- package/dist/ide-handlers/opencode.d.ts.map +1 -0
- package/dist/ide-handlers/opencode.js +57 -0
- package/dist/ide-handlers/opencode.js.map +1 -0
- package/dist/ide-handlers/vscode.d.ts +16 -0
- package/dist/ide-handlers/vscode.d.ts.map +1 -0
- package/dist/ide-handlers/vscode.js +62 -0
- package/dist/ide-handlers/vscode.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +501 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +23 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +68 -0
- package/dist/prompts.js.map +1 -0
- package/dist/repair.d.ts +50 -0
- package/dist/repair.d.ts.map +1 -0
- package/dist/repair.js +588 -0
- package/dist/repair.js.map +1 -0
- package/package.json +54 -0
package/dist/repair.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP Auto-Repair Module
|
|
4
|
+
*
|
|
5
|
+
* Provides automatic repair functions for common MCP configuration issues.
|
|
6
|
+
* Works in conjunction with diagnose.ts to fix detected problems.
|
|
7
|
+
*/
|
|
8
|
+
import { DiagnosticIssue, DiagnosticReport } from './diagnose.js';
|
|
9
|
+
export interface RepairResult {
|
|
10
|
+
issueId: string;
|
|
11
|
+
success: boolean;
|
|
12
|
+
message: string;
|
|
13
|
+
action?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RepairReport {
|
|
16
|
+
timestamp: string;
|
|
17
|
+
repairsAttempted: number;
|
|
18
|
+
repairsSucceeded: number;
|
|
19
|
+
repairsFailed: number;
|
|
20
|
+
results: RepairResult[];
|
|
21
|
+
requiresUserInput: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if an issue requires user input to repair
|
|
25
|
+
*/
|
|
26
|
+
export declare function issueRequiresUserInput(issueId: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Repair a single issue
|
|
29
|
+
*/
|
|
30
|
+
export declare function repairIssue(issue: DiagnosticIssue, apiKey?: string, platformUrl?: string): RepairResult;
|
|
31
|
+
/**
|
|
32
|
+
* Repair all auto-fixable issues from a diagnostic report
|
|
33
|
+
*/
|
|
34
|
+
export declare function repairAllIssues(report: DiagnosticReport, apiKey?: string, platformUrl?: string): RepairReport;
|
|
35
|
+
/**
|
|
36
|
+
* Run diagnostics and repair all issues automatically
|
|
37
|
+
*/
|
|
38
|
+
export declare function diagnoseAndRepair(apiKey?: string, platformUrl?: string): Promise<{
|
|
39
|
+
diagnostic: DiagnosticReport;
|
|
40
|
+
repair: RepairReport;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Print repair report to console
|
|
44
|
+
*/
|
|
45
|
+
export declare function printRepairReport(report: RepairReport): void;
|
|
46
|
+
/**
|
|
47
|
+
* Export repair report as JSON
|
|
48
|
+
*/
|
|
49
|
+
export declare function exportRepairReportJson(report: RepairReport): string;
|
|
50
|
+
//# sourceMappingURL=repair.d.ts.map
|
|
@@ -0,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AM,CAEnE"}
|
package/dist/repair.js
ADDED
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP Auto-Repair Module
|
|
4
|
+
*
|
|
5
|
+
* Provides automatic repair functions for common MCP configuration issues.
|
|
6
|
+
* Works in conjunction with diagnose.ts to fix detected problems.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, mkdirSync, writeFileSync, copyFileSync } from 'node:fs';
|
|
9
|
+
import { dirname } from 'node:path';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
import { getClaudeConfigPath, readClaudeConfig, writeClaudeConfig, addTostudyMcpServer, } from './config.js';
|
|
12
|
+
import { runDiagnostics } from './diagnose.js';
|
|
13
|
+
const DEFAULT_PLATFORM_URL = 'https://tostudy.com';
|
|
14
|
+
function println(message = '') {
|
|
15
|
+
process.stdout.write(`${message}\n`);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create missing config directory and empty config file
|
|
19
|
+
*/
|
|
20
|
+
function repairMissingConfig() {
|
|
21
|
+
const configPath = getClaudeConfigPath();
|
|
22
|
+
const configDir = dirname(configPath);
|
|
23
|
+
try {
|
|
24
|
+
// Ensure directory exists
|
|
25
|
+
if (!existsSync(configDir)) {
|
|
26
|
+
mkdirSync(configDir, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
// Create empty config with mcpServers
|
|
29
|
+
const initialConfig = {
|
|
30
|
+
mcpServers: {},
|
|
31
|
+
};
|
|
32
|
+
writeFileSync(configPath, JSON.stringify(initialConfig, null, 2), 'utf-8');
|
|
33
|
+
return {
|
|
34
|
+
issueId: 'config-missing',
|
|
35
|
+
success: true,
|
|
36
|
+
message: 'Arquivo de configuracao criado com sucesso.',
|
|
37
|
+
action: `Criado: ${configPath}`,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return {
|
|
42
|
+
issueId: 'config-missing',
|
|
43
|
+
success: false,
|
|
44
|
+
message: `Falha ao criar arquivo de configuracao: ${error instanceof Error ? error.message : String(error)}`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Fix invalid JSON by backing up and recreating config
|
|
50
|
+
*/
|
|
51
|
+
function repairInvalidJson() {
|
|
52
|
+
const configPath = getClaudeConfigPath();
|
|
53
|
+
try {
|
|
54
|
+
// Backup the corrupted file
|
|
55
|
+
if (existsSync(configPath)) {
|
|
56
|
+
const backupPath = `${configPath}.corrupted.${Date.now()}`;
|
|
57
|
+
copyFileSync(configPath, backupPath);
|
|
58
|
+
// Create fresh config
|
|
59
|
+
const freshConfig = {
|
|
60
|
+
mcpServers: {},
|
|
61
|
+
};
|
|
62
|
+
writeFileSync(configPath, JSON.stringify(freshConfig, null, 2), 'utf-8');
|
|
63
|
+
return {
|
|
64
|
+
issueId: 'config-invalid-json',
|
|
65
|
+
success: true,
|
|
66
|
+
message: 'Arquivo de configuracao recriado. Backup salvo.',
|
|
67
|
+
action: `Backup: ${backupPath}`,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
issueId: 'config-invalid-json',
|
|
72
|
+
success: false,
|
|
73
|
+
message: 'Arquivo de configuracao nao existe.',
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
return {
|
|
78
|
+
issueId: 'config-invalid-json',
|
|
79
|
+
success: false,
|
|
80
|
+
message: `Falha ao reparar JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Configure MCP server with provided API key
|
|
86
|
+
*/
|
|
87
|
+
function repairMcpNotConfigured(apiKey, platformUrl = DEFAULT_PLATFORM_URL) {
|
|
88
|
+
try {
|
|
89
|
+
addTostudyMcpServer(apiKey, platformUrl);
|
|
90
|
+
return {
|
|
91
|
+
issueId: 'mcp-not-configured',
|
|
92
|
+
success: true,
|
|
93
|
+
message: 'Servidor MCP da Catalyst configurado com sucesso.',
|
|
94
|
+
action: 'Servidor tostudy adicionado',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
return {
|
|
99
|
+
issueId: 'mcp-not-configured',
|
|
100
|
+
success: false,
|
|
101
|
+
message: `Falha ao configurar MCP: ${error instanceof Error ? error.message : String(error)}`,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Fix missing API key header
|
|
107
|
+
*/
|
|
108
|
+
function repairApiKeyMissing(apiKey, platformUrl = DEFAULT_PLATFORM_URL) {
|
|
109
|
+
try {
|
|
110
|
+
// Re-add the server with the correct API key
|
|
111
|
+
addTostudyMcpServer(apiKey, platformUrl);
|
|
112
|
+
return {
|
|
113
|
+
issueId: 'api-key-missing',
|
|
114
|
+
success: true,
|
|
115
|
+
message: 'API key configurada com sucesso.',
|
|
116
|
+
action: 'Header Authorization adicionado',
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
return {
|
|
121
|
+
issueId: 'api-key-missing',
|
|
122
|
+
success: false,
|
|
123
|
+
message: `Falha ao configurar API key: ${error instanceof Error ? error.message : String(error)}`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Fix invalid API key format (missing Bearer prefix)
|
|
129
|
+
*/
|
|
130
|
+
function repairApiKeyFormat() {
|
|
131
|
+
const config = readClaudeConfig();
|
|
132
|
+
const mcpConfig = config.mcpServers?.['tostudy'];
|
|
133
|
+
if (!mcpConfig) {
|
|
134
|
+
return {
|
|
135
|
+
issueId: 'api-key-invalid-format',
|
|
136
|
+
success: false,
|
|
137
|
+
message: 'Servidor MCP nao esta configurado.',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
const authHeader = mcpConfig.headers?.['Authorization'] || '';
|
|
142
|
+
// If it's just the key without Bearer prefix, add it
|
|
143
|
+
if (authHeader && !authHeader.startsWith('Bearer ')) {
|
|
144
|
+
if (!mcpConfig.headers) {
|
|
145
|
+
mcpConfig.headers = {};
|
|
146
|
+
}
|
|
147
|
+
mcpConfig.headers['Authorization'] = `Bearer ${authHeader}`;
|
|
148
|
+
writeClaudeConfig(config);
|
|
149
|
+
return {
|
|
150
|
+
issueId: 'api-key-invalid-format',
|
|
151
|
+
success: true,
|
|
152
|
+
message: 'Formato de API key corrigido.',
|
|
153
|
+
action: 'Prefixo "Bearer " adicionado',
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
issueId: 'api-key-invalid-format',
|
|
158
|
+
success: false,
|
|
159
|
+
message: 'API key nao encontrada para corrigir.',
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
return {
|
|
164
|
+
issueId: 'api-key-invalid-format',
|
|
165
|
+
success: false,
|
|
166
|
+
message: `Falha ao corrigir formato: ${error instanceof Error ? error.message : String(error)}`,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Fix missing or invalid server URL
|
|
172
|
+
*/
|
|
173
|
+
function repairServerUrl(platformUrl = DEFAULT_PLATFORM_URL) {
|
|
174
|
+
const config = readClaudeConfig();
|
|
175
|
+
const mcpConfig = config.mcpServers?.['tostudy'];
|
|
176
|
+
if (!mcpConfig) {
|
|
177
|
+
return {
|
|
178
|
+
issueId: 'server-url-missing',
|
|
179
|
+
success: false,
|
|
180
|
+
message: 'Servidor MCP nao esta configurado.',
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
// Construct the correct MCP SSE URL
|
|
185
|
+
const mcpServerUrl = platformUrl.replace(':3700', ':3701');
|
|
186
|
+
mcpConfig.url = `${mcpServerUrl}/mcp/sse`;
|
|
187
|
+
mcpConfig.type = 'sse';
|
|
188
|
+
writeClaudeConfig(config);
|
|
189
|
+
return {
|
|
190
|
+
issueId: 'server-url-missing',
|
|
191
|
+
success: true,
|
|
192
|
+
message: 'URL do servidor configurada.',
|
|
193
|
+
action: `URL: ${mcpConfig.url}`,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
return {
|
|
198
|
+
issueId: 'server-url-missing',
|
|
199
|
+
success: false,
|
|
200
|
+
message: `Falha ao configurar URL: ${error instanceof Error ? error.message : String(error)}`,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Fix URL with wrong protocol
|
|
206
|
+
*/
|
|
207
|
+
function repairServerUrlProtocol(platformUrl = DEFAULT_PLATFORM_URL) {
|
|
208
|
+
const config = readClaudeConfig();
|
|
209
|
+
const mcpConfig = config.mcpServers?.['tostudy'];
|
|
210
|
+
if (!mcpConfig?.url) {
|
|
211
|
+
return {
|
|
212
|
+
issueId: 'server-url-invalid-protocol',
|
|
213
|
+
success: false,
|
|
214
|
+
message: 'URL do servidor nao configurada.',
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
// Parse the existing URL and fix the protocol
|
|
219
|
+
const existingUrl = mcpConfig.url;
|
|
220
|
+
// Replace invalid protocol with https
|
|
221
|
+
const fixedUrl = existingUrl.replace(/^[a-z]+:/, 'https:');
|
|
222
|
+
mcpConfig.url = fixedUrl;
|
|
223
|
+
writeClaudeConfig(config);
|
|
224
|
+
return {
|
|
225
|
+
issueId: 'server-url-invalid-protocol',
|
|
226
|
+
success: true,
|
|
227
|
+
message: 'Protocolo da URL corrigido para HTTPS.',
|
|
228
|
+
action: `URL: ${fixedUrl}`,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
return {
|
|
233
|
+
issueId: 'server-url-invalid-protocol',
|
|
234
|
+
success: false,
|
|
235
|
+
message: `Falha ao corrigir protocolo: ${error instanceof Error ? error.message : String(error)}`,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Fix URL missing /mcp/sse path
|
|
241
|
+
*/
|
|
242
|
+
function repairServerUrlPath() {
|
|
243
|
+
const config = readClaudeConfig();
|
|
244
|
+
const mcpConfig = config.mcpServers?.['tostudy'];
|
|
245
|
+
if (!mcpConfig?.url) {
|
|
246
|
+
return {
|
|
247
|
+
issueId: 'server-url-missing-sse-path',
|
|
248
|
+
success: false,
|
|
249
|
+
message: 'URL do servidor nao configurada.',
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
try {
|
|
253
|
+
let url = mcpConfig.url;
|
|
254
|
+
// Parse URL and fix path
|
|
255
|
+
const parsedUrl = new URL(url);
|
|
256
|
+
// Remove trailing slash and add /mcp/sse
|
|
257
|
+
parsedUrl.pathname = parsedUrl.pathname.replace(/\/$/, '');
|
|
258
|
+
if (!parsedUrl.pathname.endsWith('/mcp/sse')) {
|
|
259
|
+
// If it ends with /mcp, just add /sse
|
|
260
|
+
if (parsedUrl.pathname.endsWith('/mcp')) {
|
|
261
|
+
parsedUrl.pathname += '/sse';
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
parsedUrl.pathname += '/mcp/sse';
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
mcpConfig.url = parsedUrl.toString();
|
|
268
|
+
writeClaudeConfig(config);
|
|
269
|
+
return {
|
|
270
|
+
issueId: 'server-url-missing-sse-path',
|
|
271
|
+
success: true,
|
|
272
|
+
message: 'Path /mcp/sse adicionado a URL.',
|
|
273
|
+
action: `URL: ${mcpConfig.url}`,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
return {
|
|
278
|
+
issueId: 'server-url-missing-sse-path',
|
|
279
|
+
success: false,
|
|
280
|
+
message: `Falha ao corrigir path: ${error instanceof Error ? error.message : String(error)}`,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Remove duplicate Catalyst/Ana servers, keeping only tostudy
|
|
286
|
+
*/
|
|
287
|
+
function repairDuplicateServers() {
|
|
288
|
+
const config = readClaudeConfig();
|
|
289
|
+
if (!config.mcpServers) {
|
|
290
|
+
return {
|
|
291
|
+
issueId: 'duplicate-servers',
|
|
292
|
+
success: false,
|
|
293
|
+
message: 'Nenhum servidor MCP configurado.',
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
try {
|
|
297
|
+
const servers = Object.entries(config.mcpServers);
|
|
298
|
+
const anaServers = servers.filter(([key, server]) => key.toLowerCase().includes('ana') ||
|
|
299
|
+
key.toLowerCase().includes('catalyst') ||
|
|
300
|
+
(server.url && server.url.includes('tostudy.com')));
|
|
301
|
+
if (anaServers.length <= 1) {
|
|
302
|
+
return {
|
|
303
|
+
issueId: 'duplicate-servers',
|
|
304
|
+
success: true,
|
|
305
|
+
message: 'Nenhuma duplicata encontrada.',
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
// Keep the tostudy entry if it exists, otherwise keep the first one
|
|
309
|
+
const primaryKey = anaServers.find(([key]) => key === 'tostudy')?.[0] || anaServers[0][0];
|
|
310
|
+
const removedKeys = [];
|
|
311
|
+
for (const [key] of anaServers) {
|
|
312
|
+
if (key !== primaryKey) {
|
|
313
|
+
delete config.mcpServers[key];
|
|
314
|
+
removedKeys.push(key);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
writeClaudeConfig(config);
|
|
318
|
+
return {
|
|
319
|
+
issueId: 'duplicate-servers',
|
|
320
|
+
success: true,
|
|
321
|
+
message: `${removedKeys.length} servidor(es) duplicado(s) removido(s).`,
|
|
322
|
+
action: `Removidos: ${removedKeys.join(', ')}`,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
return {
|
|
327
|
+
issueId: 'duplicate-servers',
|
|
328
|
+
success: false,
|
|
329
|
+
message: `Falha ao remover duplicatas: ${error instanceof Error ? error.message : String(error)}`,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
const REPAIR_FUNCTIONS = {
|
|
334
|
+
'config-missing': () => repairMissingConfig(),
|
|
335
|
+
'config-invalid-json': () => repairInvalidJson(),
|
|
336
|
+
'mcp-not-configured': (apiKey, platformUrl) => {
|
|
337
|
+
if (!apiKey) {
|
|
338
|
+
return {
|
|
339
|
+
issueId: 'mcp-not-configured',
|
|
340
|
+
success: false,
|
|
341
|
+
message: 'API key necessaria para configurar o MCP.',
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
return repairMcpNotConfigured(apiKey, platformUrl);
|
|
345
|
+
},
|
|
346
|
+
'api-key-missing': (apiKey, platformUrl) => {
|
|
347
|
+
if (!apiKey) {
|
|
348
|
+
return {
|
|
349
|
+
issueId: 'api-key-missing',
|
|
350
|
+
success: false,
|
|
351
|
+
message: 'Nova API key necessaria.',
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
return repairApiKeyMissing(apiKey, platformUrl);
|
|
355
|
+
},
|
|
356
|
+
'api-key-invalid-format': () => repairApiKeyFormat(),
|
|
357
|
+
'api-key-too-short': (apiKey, platformUrl) => {
|
|
358
|
+
if (!apiKey) {
|
|
359
|
+
return {
|
|
360
|
+
issueId: 'api-key-too-short',
|
|
361
|
+
success: false,
|
|
362
|
+
message: 'Nova API key necessaria.',
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
return repairApiKeyMissing(apiKey, platformUrl);
|
|
366
|
+
},
|
|
367
|
+
'server-url-missing': (_, platformUrl) => repairServerUrl(platformUrl),
|
|
368
|
+
'server-url-invalid': (_, platformUrl) => repairServerUrl(platformUrl),
|
|
369
|
+
'server-url-invalid-protocol': () => repairServerUrlProtocol(),
|
|
370
|
+
'server-url-missing-sse-path': () => repairServerUrlPath(),
|
|
371
|
+
'auth-failed': (apiKey, platformUrl) => {
|
|
372
|
+
if (!apiKey) {
|
|
373
|
+
return {
|
|
374
|
+
issueId: 'auth-failed',
|
|
375
|
+
success: false,
|
|
376
|
+
message: 'Nova API key necessaria. Gere em /student/settings/mcp.',
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
return repairMcpNotConfigured(apiKey, platformUrl);
|
|
380
|
+
},
|
|
381
|
+
'duplicate-servers': () => repairDuplicateServers(),
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Issues that require user input (API key)
|
|
385
|
+
*/
|
|
386
|
+
const ISSUES_REQUIRING_API_KEY = [
|
|
387
|
+
'mcp-not-configured',
|
|
388
|
+
'api-key-missing',
|
|
389
|
+
'api-key-too-short',
|
|
390
|
+
'auth-failed',
|
|
391
|
+
];
|
|
392
|
+
/**
|
|
393
|
+
* Check if an issue requires user input to repair
|
|
394
|
+
*/
|
|
395
|
+
export function issueRequiresUserInput(issueId) {
|
|
396
|
+
return ISSUES_REQUIRING_API_KEY.includes(issueId);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Repair a single issue
|
|
400
|
+
*/
|
|
401
|
+
export function repairIssue(issue, apiKey, platformUrl) {
|
|
402
|
+
const repairFn = REPAIR_FUNCTIONS[issue.id];
|
|
403
|
+
if (!repairFn) {
|
|
404
|
+
return {
|
|
405
|
+
issueId: issue.id,
|
|
406
|
+
success: false,
|
|
407
|
+
message: `Sem funcao de reparo disponivel para: ${issue.id}`,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
return repairFn(apiKey, platformUrl);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Repair all auto-fixable issues from a diagnostic report
|
|
414
|
+
*/
|
|
415
|
+
export function repairAllIssues(report, apiKey, platformUrl = DEFAULT_PLATFORM_URL) {
|
|
416
|
+
const results = [];
|
|
417
|
+
const requiresUserInput = [];
|
|
418
|
+
let succeeded = 0;
|
|
419
|
+
let failed = 0;
|
|
420
|
+
// Filter to auto-fixable issues only
|
|
421
|
+
const fixableIssues = report.issues.filter((issue) => issue.autoFixable);
|
|
422
|
+
for (const issue of fixableIssues) {
|
|
423
|
+
// Check if this issue needs user input
|
|
424
|
+
if (issueRequiresUserInput(issue.id) && !apiKey) {
|
|
425
|
+
requiresUserInput.push(issue.id);
|
|
426
|
+
results.push({
|
|
427
|
+
issueId: issue.id,
|
|
428
|
+
success: false,
|
|
429
|
+
message: 'Requer API key para reparar.',
|
|
430
|
+
});
|
|
431
|
+
failed++;
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
434
|
+
const result = repairIssue(issue, apiKey, platformUrl);
|
|
435
|
+
results.push(result);
|
|
436
|
+
if (result.success) {
|
|
437
|
+
succeeded++;
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
failed++;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return {
|
|
444
|
+
timestamp: new Date().toISOString(),
|
|
445
|
+
repairsAttempted: fixableIssues.length,
|
|
446
|
+
repairsSucceeded: succeeded,
|
|
447
|
+
repairsFailed: failed,
|
|
448
|
+
results,
|
|
449
|
+
requiresUserInput,
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Run diagnostics and repair all issues automatically
|
|
454
|
+
*/
|
|
455
|
+
export async function diagnoseAndRepair(apiKey, platformUrl = DEFAULT_PLATFORM_URL) {
|
|
456
|
+
const diagnostic = await runDiagnostics();
|
|
457
|
+
const repair = repairAllIssues(diagnostic, apiKey, platformUrl);
|
|
458
|
+
return { diagnostic, repair };
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Print repair report to console
|
|
462
|
+
*/
|
|
463
|
+
export function printRepairReport(report) {
|
|
464
|
+
println();
|
|
465
|
+
println(chalk.cyan(' ╔═══════════════════════════════════════╗'));
|
|
466
|
+
println(chalk.cyan(' ║') + chalk.white.bold(' Catalyst MCP Auto-Repair ') + chalk.cyan('║'));
|
|
467
|
+
println(chalk.cyan(' ╚═══════════════════════════════════════╝'));
|
|
468
|
+
println();
|
|
469
|
+
if (report.repairsAttempted === 0) {
|
|
470
|
+
println(chalk.green.bold('✓ Nenhum reparo necessario!'));
|
|
471
|
+
println();
|
|
472
|
+
println(chalk.gray('Nenhum problema corrigivel automaticamente foi encontrado.'));
|
|
473
|
+
println();
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
// Summary
|
|
477
|
+
println(chalk.white.bold('Resumo:'));
|
|
478
|
+
println(` Reparos tentados: ${report.repairsAttempted}`);
|
|
479
|
+
println(` ${chalk.green('✓ Sucesso:')} ${report.repairsSucceeded}`);
|
|
480
|
+
if (report.repairsFailed > 0) {
|
|
481
|
+
println(` ${chalk.red('✗ Falha:')} ${report.repairsFailed}`);
|
|
482
|
+
}
|
|
483
|
+
println();
|
|
484
|
+
// Results
|
|
485
|
+
println(chalk.white.bold('Detalhes:'));
|
|
486
|
+
println();
|
|
487
|
+
for (const result of report.results) {
|
|
488
|
+
if (result.success) {
|
|
489
|
+
println(` ${chalk.green('✓')} ${result.message}`);
|
|
490
|
+
if (result.action) {
|
|
491
|
+
println(chalk.gray(` ${result.action}`));
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
println(` ${chalk.red('✗')} ${result.message}`);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
println();
|
|
499
|
+
// User input required
|
|
500
|
+
if (report.requiresUserInput.length > 0) {
|
|
501
|
+
println(chalk.yellow('⚠ Alguns reparos requerem interacao:'));
|
|
502
|
+
println();
|
|
503
|
+
println(' Para reparar problemas de API key, execute:');
|
|
504
|
+
println(chalk.cyan(' npx @tostudy-ai/mcp-setup repair --api-key <sua-api-key>'));
|
|
505
|
+
println();
|
|
506
|
+
println(' Para gerar uma nova API key:');
|
|
507
|
+
println(chalk.cyan(' https://tostudy.com/student/settings/mcp'));
|
|
508
|
+
println();
|
|
509
|
+
}
|
|
510
|
+
// Final status
|
|
511
|
+
if (report.repairsFailed === 0 && report.requiresUserInput.length === 0) {
|
|
512
|
+
println(chalk.green.bold('✓ Todos os reparos concluidos com sucesso!'));
|
|
513
|
+
println(chalk.gray(' Reinicie o Claude Code para aplicar as mudancas.'));
|
|
514
|
+
}
|
|
515
|
+
else if (report.repairsSucceeded > 0) {
|
|
516
|
+
println(chalk.yellow('⚠ Alguns reparos foram concluidos, mas outros falharam.'));
|
|
517
|
+
println(chalk.gray(' Execute o diagnostico novamente para verificar o status.'));
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
println(chalk.red('✗ Nenhum reparo foi concluido com sucesso.'));
|
|
521
|
+
println(chalk.gray(' Verifique os erros acima e tente novamente.'));
|
|
522
|
+
}
|
|
523
|
+
println();
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Export repair report as JSON
|
|
527
|
+
*/
|
|
528
|
+
export function exportRepairReportJson(report) {
|
|
529
|
+
return JSON.stringify(report, null, 2);
|
|
530
|
+
}
|
|
531
|
+
// CLI entry point
|
|
532
|
+
if (process.argv[1]?.endsWith('repair.js')) {
|
|
533
|
+
(async () => {
|
|
534
|
+
try {
|
|
535
|
+
// Parse command line arguments
|
|
536
|
+
let apiKey;
|
|
537
|
+
let platformUrl = DEFAULT_PLATFORM_URL;
|
|
538
|
+
let jsonOutput = false;
|
|
539
|
+
for (let i = 2; i < process.argv.length; i++) {
|
|
540
|
+
const arg = process.argv[i];
|
|
541
|
+
if (arg === '--api-key' && process.argv[i + 1]) {
|
|
542
|
+
apiKey = process.argv[++i];
|
|
543
|
+
}
|
|
544
|
+
else if (arg === '--url' && process.argv[i + 1]) {
|
|
545
|
+
platformUrl = process.argv[++i];
|
|
546
|
+
}
|
|
547
|
+
else if (arg === '--json') {
|
|
548
|
+
jsonOutput = true;
|
|
549
|
+
}
|
|
550
|
+
else if (arg === '--help' || arg === '-h') {
|
|
551
|
+
println('Catalyst MCP Auto-Repair');
|
|
552
|
+
println();
|
|
553
|
+
println('Usage: node repair.js [options]');
|
|
554
|
+
println();
|
|
555
|
+
println('Options:');
|
|
556
|
+
println(' --api-key <key> API key para reparos que necessitam autenticacao');
|
|
557
|
+
println(' --url <url> URL da plataforma (default: https://tostudy.com)');
|
|
558
|
+
println(' --json Saida em formato JSON');
|
|
559
|
+
println(' --help, -h Mostra esta ajuda');
|
|
560
|
+
println();
|
|
561
|
+
process.exit(0);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
// Check for API key in environment
|
|
565
|
+
if (!apiKey) {
|
|
566
|
+
apiKey = process.env.TOSTUDY_API_KEY;
|
|
567
|
+
}
|
|
568
|
+
// Run diagnostics and repair
|
|
569
|
+
const { diagnostic, repair } = await diagnoseAndRepair(apiKey, platformUrl);
|
|
570
|
+
// Output results
|
|
571
|
+
if (jsonOutput) {
|
|
572
|
+
println(JSON.stringify({ diagnostic, repair }, null, 2));
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
printRepairReport(repair);
|
|
576
|
+
}
|
|
577
|
+
// Exit code based on repair results
|
|
578
|
+
const hasUnfixedCritical = diagnostic.issues.some((issue) => issue.severity === 'critical' && !repair.results.find((r) => r.issueId === issue.id && r.success));
|
|
579
|
+
process.exit(hasUnfixedCritical ? 1 : 0);
|
|
580
|
+
}
|
|
581
|
+
catch (error) {
|
|
582
|
+
process.stderr.write(chalk.red('Erro ao executar reparo:\n'));
|
|
583
|
+
process.stderr.write((error instanceof Error ? error.message : String(error)) + '\n');
|
|
584
|
+
process.exit(1);
|
|
585
|
+
}
|
|
586
|
+
})();
|
|
587
|
+
}
|
|
588
|
+
//# sourceMappingURL=repair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../src/repair.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAc,YAAY,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACp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