@tostudy-ai/mcp-setup 1.2.2 → 1.4.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 +26 -25
- package/dist/index.d.ts +2 -14
- package/dist/index.js +2989 -562
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.d.ts +0 -52
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.d.ts.map +0 -1
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.js +0 -720
- package/dist/__tests__/e2e-diagnostic-repair-flow.test.js.map +0 -1
- package/dist/__tests__/e2e-wizard-flow.test.d.ts +0 -43
- package/dist/__tests__/e2e-wizard-flow.test.d.ts.map +0 -1
- package/dist/__tests__/e2e-wizard-flow.test.js +0 -418
- package/dist/__tests__/e2e-wizard-flow.test.js.map +0 -1
- package/dist/__tests__/ide-handlers.test.d.ts +0 -10
- package/dist/__tests__/ide-handlers.test.d.ts.map +0 -1
- package/dist/__tests__/ide-handlers.test.js +0 -358
- package/dist/__tests__/ide-handlers.test.js.map +0 -1
- package/dist/__tests__/install-command.test.d.ts +0 -10
- package/dist/__tests__/install-command.test.d.ts.map +0 -1
- package/dist/__tests__/install-command.test.js +0 -248
- package/dist/__tests__/install-command.test.js.map +0 -1
- package/dist/callback-page.d.ts +0 -6
- package/dist/callback-page.d.ts.map +0 -1
- package/dist/callback-page.js +0 -96
- package/dist/callback-page.js.map +0 -1
- package/dist/config.d.ts +0 -62
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -167
- package/dist/config.js.map +0 -1
- package/dist/detect.d.ts +0 -42
- package/dist/detect.d.ts.map +0 -1
- package/dist/detect.js +0 -277
- package/dist/detect.js.map +0 -1
- package/dist/diagnose.d.ts +0 -36
- package/dist/diagnose.d.ts.map +0 -1
- package/dist/diagnose.js +0 -502
- package/dist/diagnose.js.map +0 -1
- package/dist/ide-handlers/antigravity.d.ts +0 -16
- package/dist/ide-handlers/antigravity.d.ts.map +0 -1
- package/dist/ide-handlers/antigravity.js +0 -46
- package/dist/ide-handlers/antigravity.js.map +0 -1
- package/dist/ide-handlers/base.d.ts +0 -36
- package/dist/ide-handlers/base.d.ts.map +0 -1
- package/dist/ide-handlers/base.js +0 -66
- package/dist/ide-handlers/base.js.map +0 -1
- package/dist/ide-handlers/claude-code.d.ts +0 -15
- package/dist/ide-handlers/claude-code.d.ts.map +0 -1
- package/dist/ide-handlers/claude-code.js +0 -50
- package/dist/ide-handlers/claude-code.js.map +0 -1
- package/dist/ide-handlers/codex.d.ts +0 -15
- package/dist/ide-handlers/codex.d.ts.map +0 -1
- package/dist/ide-handlers/codex.js +0 -53
- package/dist/ide-handlers/codex.js.map +0 -1
- package/dist/ide-handlers/cursor.d.ts +0 -15
- package/dist/ide-handlers/cursor.d.ts.map +0 -1
- package/dist/ide-handlers/cursor.js +0 -61
- package/dist/ide-handlers/cursor.js.map +0 -1
- package/dist/ide-handlers/desktop.d.ts +0 -16
- package/dist/ide-handlers/desktop.d.ts.map +0 -1
- package/dist/ide-handlers/desktop.js +0 -50
- package/dist/ide-handlers/desktop.js.map +0 -1
- package/dist/ide-handlers/index.d.ts +0 -21
- package/dist/ide-handlers/index.d.ts.map +0 -1
- package/dist/ide-handlers/index.js +0 -55
- package/dist/ide-handlers/index.js.map +0 -1
- package/dist/ide-handlers/manual.d.ts +0 -16
- package/dist/ide-handlers/manual.d.ts.map +0 -1
- package/dist/ide-handlers/manual.js +0 -34
- package/dist/ide-handlers/manual.js.map +0 -1
- package/dist/ide-handlers/opencode.d.ts +0 -15
- package/dist/ide-handlers/opencode.d.ts.map +0 -1
- package/dist/ide-handlers/opencode.js +0 -57
- package/dist/ide-handlers/opencode.js.map +0 -1
- package/dist/ide-handlers/vscode.d.ts +0 -16
- package/dist/ide-handlers/vscode.d.ts.map +0 -1
- package/dist/ide-handlers/vscode.js +0 -62
- package/dist/ide-handlers/vscode.js.map +0 -1
- package/dist/ide-handlers/windsurf.d.ts +0 -16
- package/dist/ide-handlers/windsurf.d.ts.map +0 -1
- package/dist/ide-handlers/windsurf.js +0 -46
- package/dist/ide-handlers/windsurf.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/oauth-server.d.ts +0 -4
- package/dist/oauth-server.d.ts.map +0 -1
- package/dist/oauth-server.js +0 -49
- package/dist/oauth-server.js.map +0 -1
- package/dist/prompts.d.ts +0 -23
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js +0 -68
- package/dist/prompts.js.map +0 -1
- package/dist/repair.d.ts +0 -50
- package/dist/repair.d.ts.map +0 -1
- package/dist/repair.js +0 -633
- package/dist/repair.js.map +0 -1
package/dist/repair.js
DELETED
|
@@ -1,633 +0,0 @@
|
|
|
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, extractApiKey, extractMcpUrl, } from "./config.js";
|
|
12
|
-
import { runDiagnostics } from "./diagnose.js";
|
|
13
|
-
const DEFAULT_PLATFORM_URL = "https://tostudy.ai";
|
|
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 ToStudy 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 (supports both SSE and stdio formats)
|
|
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
|
-
// SSE format: fix headers
|
|
142
|
-
if (mcpConfig.headers) {
|
|
143
|
-
const authHeader = mcpConfig.headers["Authorization"] || "";
|
|
144
|
-
if (authHeader && !authHeader.startsWith("Bearer ")) {
|
|
145
|
-
mcpConfig.headers["Authorization"] = `Bearer ${authHeader}`;
|
|
146
|
-
writeClaudeConfig(config);
|
|
147
|
-
return {
|
|
148
|
-
issueId: "api-key-invalid-format",
|
|
149
|
-
success: true,
|
|
150
|
-
message: "Formato de API key corrigido.",
|
|
151
|
-
action: 'Prefixo "Bearer " adicionado',
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// Stdio format: fix args
|
|
156
|
-
if (mcpConfig.args) {
|
|
157
|
-
for (let i = 0; i < mcpConfig.args.length; i++) {
|
|
158
|
-
if (mcpConfig.args[i] === "--header" &&
|
|
159
|
-
mcpConfig.args[i + 1]?.startsWith("Authorization:")) {
|
|
160
|
-
const value = mcpConfig.args[i + 1].replace("Authorization:", "");
|
|
161
|
-
if (value && !value.startsWith("Bearer ")) {
|
|
162
|
-
mcpConfig.args[i + 1] = `Authorization:Bearer ${value}`;
|
|
163
|
-
writeClaudeConfig(config);
|
|
164
|
-
return {
|
|
165
|
-
issueId: "api-key-invalid-format",
|
|
166
|
-
success: true,
|
|
167
|
-
message: "Formato de API key corrigido.",
|
|
168
|
-
action: 'Prefixo "Bearer " adicionado',
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return {
|
|
175
|
-
issueId: "api-key-invalid-format",
|
|
176
|
-
success: false,
|
|
177
|
-
message: "API key nao encontrada para corrigir.",
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
catch (error) {
|
|
181
|
-
return {
|
|
182
|
-
issueId: "api-key-invalid-format",
|
|
183
|
-
success: false,
|
|
184
|
-
message: `Falha ao corrigir formato: ${error instanceof Error ? error.message : String(error)}`,
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Fix missing or invalid server URL by re-adding with correct config
|
|
190
|
-
*/
|
|
191
|
-
function repairServerUrl(platformUrl = DEFAULT_PLATFORM_URL) {
|
|
192
|
-
const config = readClaudeConfig();
|
|
193
|
-
const mcpConfig = config.mcpServers?.["tostudy"];
|
|
194
|
-
if (!mcpConfig) {
|
|
195
|
-
return {
|
|
196
|
-
issueId: "server-url-missing",
|
|
197
|
-
success: false,
|
|
198
|
-
message: "Servidor MCP nao esta configurado.",
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
try {
|
|
202
|
-
// Extract existing API key to preserve it
|
|
203
|
-
const apiKey = extractApiKey(mcpConfig);
|
|
204
|
-
if (!apiKey) {
|
|
205
|
-
return {
|
|
206
|
-
issueId: "server-url-missing",
|
|
207
|
-
success: false,
|
|
208
|
-
message: "API key nao encontrada para reconstruir configuracao.",
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
// Re-add with correct URL using stdio format
|
|
212
|
-
addTostudyMcpServer(apiKey, platformUrl);
|
|
213
|
-
return {
|
|
214
|
-
issueId: "server-url-missing",
|
|
215
|
-
success: true,
|
|
216
|
-
message: "URL do servidor configurada.",
|
|
217
|
-
action: `URL: ${platformUrl}/mcp`,
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
catch (error) {
|
|
221
|
-
return {
|
|
222
|
-
issueId: "server-url-missing",
|
|
223
|
-
success: false,
|
|
224
|
-
message: `Falha ao configurar URL: ${error instanceof Error ? error.message : String(error)}`,
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Fix URL with wrong protocol
|
|
230
|
-
*/
|
|
231
|
-
function repairServerUrlProtocol(platformUrl = DEFAULT_PLATFORM_URL) {
|
|
232
|
-
const config = readClaudeConfig();
|
|
233
|
-
const mcpConfig = config.mcpServers?.["tostudy"];
|
|
234
|
-
if (!mcpConfig) {
|
|
235
|
-
return {
|
|
236
|
-
issueId: "server-url-invalid-protocol",
|
|
237
|
-
success: false,
|
|
238
|
-
message: "Servidor MCP nao esta configurado.",
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
const url = extractMcpUrl(mcpConfig);
|
|
242
|
-
if (!url) {
|
|
243
|
-
return {
|
|
244
|
-
issueId: "server-url-invalid-protocol",
|
|
245
|
-
success: false,
|
|
246
|
-
message: "URL do servidor nao configurada.",
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
try {
|
|
250
|
-
// Fix the protocol to https and re-add
|
|
251
|
-
const fixedUrl = url.replace(/^[a-z]+:/, "https:");
|
|
252
|
-
// Extract base platform URL from the fixed URL
|
|
253
|
-
const basePlatformUrl = fixedUrl.replace(/\/mcp(\/sse)?$/, "");
|
|
254
|
-
const apiKey = extractApiKey(mcpConfig);
|
|
255
|
-
if (!apiKey) {
|
|
256
|
-
return {
|
|
257
|
-
issueId: "server-url-invalid-protocol",
|
|
258
|
-
success: false,
|
|
259
|
-
message: "API key nao encontrada para reconstruir configuracao.",
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
addTostudyMcpServer(apiKey, basePlatformUrl);
|
|
263
|
-
return {
|
|
264
|
-
issueId: "server-url-invalid-protocol",
|
|
265
|
-
success: true,
|
|
266
|
-
message: "Protocolo da URL corrigido para HTTPS.",
|
|
267
|
-
action: `URL: ${basePlatformUrl}/mcp`,
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
catch (error) {
|
|
271
|
-
return {
|
|
272
|
-
issueId: "server-url-invalid-protocol",
|
|
273
|
-
success: false,
|
|
274
|
-
message: `Falha ao corrigir protocolo: ${error instanceof Error ? error.message : String(error)}`,
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Fix URL missing /mcp path
|
|
280
|
-
*/
|
|
281
|
-
function repairServerUrlPath() {
|
|
282
|
-
const config = readClaudeConfig();
|
|
283
|
-
const mcpConfig = config.mcpServers?.["tostudy"];
|
|
284
|
-
if (!mcpConfig) {
|
|
285
|
-
return {
|
|
286
|
-
issueId: "server-url-missing-sse-path",
|
|
287
|
-
success: false,
|
|
288
|
-
message: "Servidor MCP nao esta configurado.",
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
const url = extractMcpUrl(mcpConfig);
|
|
292
|
-
if (!url) {
|
|
293
|
-
return {
|
|
294
|
-
issueId: "server-url-missing-sse-path",
|
|
295
|
-
success: false,
|
|
296
|
-
message: "URL do servidor nao configurada.",
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
try {
|
|
300
|
-
const parsedUrl = new URL(url);
|
|
301
|
-
// Extract base URL (strip /mcp or /mcp/sse if present, then re-add /mcp)
|
|
302
|
-
parsedUrl.pathname = parsedUrl.pathname.replace(/\/(mcp(\/sse)?)?$/, "");
|
|
303
|
-
const basePlatformUrl = parsedUrl.toString().replace(/\/$/, "");
|
|
304
|
-
const apiKey = extractApiKey(mcpConfig);
|
|
305
|
-
if (!apiKey) {
|
|
306
|
-
return {
|
|
307
|
-
issueId: "server-url-missing-sse-path",
|
|
308
|
-
success: false,
|
|
309
|
-
message: "API key nao encontrada para reconstruir configuracao.",
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
addTostudyMcpServer(apiKey, basePlatformUrl);
|
|
313
|
-
return {
|
|
314
|
-
issueId: "server-url-missing-sse-path",
|
|
315
|
-
success: true,
|
|
316
|
-
message: "Path /mcp corrigido na URL.",
|
|
317
|
-
action: `URL: ${basePlatformUrl}/mcp`,
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
catch (error) {
|
|
321
|
-
return {
|
|
322
|
-
issueId: "server-url-missing-sse-path",
|
|
323
|
-
success: false,
|
|
324
|
-
message: `Falha ao corrigir path: ${error instanceof Error ? error.message : String(error)}`,
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Remove duplicate ToStudy/Ana servers, keeping only tostudy
|
|
330
|
-
*/
|
|
331
|
-
function repairDuplicateServers() {
|
|
332
|
-
const config = readClaudeConfig();
|
|
333
|
-
if (!config.mcpServers) {
|
|
334
|
-
return {
|
|
335
|
-
issueId: "duplicate-servers",
|
|
336
|
-
success: false,
|
|
337
|
-
message: "Nenhum servidor MCP configurado.",
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
try {
|
|
341
|
-
const servers = Object.entries(config.mcpServers);
|
|
342
|
-
const anaServers = servers.filter(([key, server]) => key.toLowerCase().includes("ana") ||
|
|
343
|
-
key.toLowerCase().includes("catalyst") ||
|
|
344
|
-
(server.url && server.url.includes("tostudy.com")));
|
|
345
|
-
if (anaServers.length <= 1) {
|
|
346
|
-
return {
|
|
347
|
-
issueId: "duplicate-servers",
|
|
348
|
-
success: true,
|
|
349
|
-
message: "Nenhuma duplicata encontrada.",
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
// Keep the tostudy entry if it exists, otherwise keep the first one
|
|
353
|
-
const primaryKey = anaServers.find(([key]) => key === "tostudy")?.[0] || anaServers[0][0];
|
|
354
|
-
const removedKeys = [];
|
|
355
|
-
for (const [key] of anaServers) {
|
|
356
|
-
if (key !== primaryKey) {
|
|
357
|
-
delete config.mcpServers[key];
|
|
358
|
-
removedKeys.push(key);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
writeClaudeConfig(config);
|
|
362
|
-
return {
|
|
363
|
-
issueId: "duplicate-servers",
|
|
364
|
-
success: true,
|
|
365
|
-
message: `${removedKeys.length} servidor(es) duplicado(s) removido(s).`,
|
|
366
|
-
action: `Removidos: ${removedKeys.join(", ")}`,
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
catch (error) {
|
|
370
|
-
return {
|
|
371
|
-
issueId: "duplicate-servers",
|
|
372
|
-
success: false,
|
|
373
|
-
message: `Falha ao remover duplicatas: ${error instanceof Error ? error.message : String(error)}`,
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
const REPAIR_FUNCTIONS = {
|
|
378
|
-
"config-missing": () => repairMissingConfig(),
|
|
379
|
-
"config-invalid-json": () => repairInvalidJson(),
|
|
380
|
-
"mcp-not-configured": (apiKey, platformUrl) => {
|
|
381
|
-
if (!apiKey) {
|
|
382
|
-
return {
|
|
383
|
-
issueId: "mcp-not-configured",
|
|
384
|
-
success: false,
|
|
385
|
-
message: "API key necessaria para configurar o MCP.",
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
return repairMcpNotConfigured(apiKey, platformUrl);
|
|
389
|
-
},
|
|
390
|
-
"api-key-missing": (apiKey, platformUrl) => {
|
|
391
|
-
if (!apiKey) {
|
|
392
|
-
return {
|
|
393
|
-
issueId: "api-key-missing",
|
|
394
|
-
success: false,
|
|
395
|
-
message: "Nova API key necessaria.",
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
return repairApiKeyMissing(apiKey, platformUrl);
|
|
399
|
-
},
|
|
400
|
-
"api-key-invalid-format": () => repairApiKeyFormat(),
|
|
401
|
-
"api-key-too-short": (apiKey, platformUrl) => {
|
|
402
|
-
if (!apiKey) {
|
|
403
|
-
return {
|
|
404
|
-
issueId: "api-key-too-short",
|
|
405
|
-
success: false,
|
|
406
|
-
message: "Nova API key necessaria.",
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
return repairApiKeyMissing(apiKey, platformUrl);
|
|
410
|
-
},
|
|
411
|
-
"server-url-missing": (_, platformUrl) => repairServerUrl(platformUrl),
|
|
412
|
-
"server-url-invalid": (_, platformUrl) => repairServerUrl(platformUrl),
|
|
413
|
-
"server-url-invalid-protocol": () => repairServerUrlProtocol(),
|
|
414
|
-
"server-url-missing-sse-path": () => repairServerUrlPath(),
|
|
415
|
-
"auth-failed": (apiKey, platformUrl) => {
|
|
416
|
-
if (!apiKey) {
|
|
417
|
-
return {
|
|
418
|
-
issueId: "auth-failed",
|
|
419
|
-
success: false,
|
|
420
|
-
message: "Nova API key necessaria. Gere em /student/settings/mcp.",
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
return repairMcpNotConfigured(apiKey, platformUrl);
|
|
424
|
-
},
|
|
425
|
-
"duplicate-servers": () => repairDuplicateServers(),
|
|
426
|
-
};
|
|
427
|
-
/**
|
|
428
|
-
* Issues that require user input (API key)
|
|
429
|
-
*/
|
|
430
|
-
const ISSUES_REQUIRING_API_KEY = [
|
|
431
|
-
"mcp-not-configured",
|
|
432
|
-
"api-key-missing",
|
|
433
|
-
"api-key-too-short",
|
|
434
|
-
"auth-failed",
|
|
435
|
-
];
|
|
436
|
-
/**
|
|
437
|
-
* Check if an issue requires user input to repair
|
|
438
|
-
*/
|
|
439
|
-
export function issueRequiresUserInput(issueId) {
|
|
440
|
-
return ISSUES_REQUIRING_API_KEY.includes(issueId);
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* Repair a single issue
|
|
444
|
-
*/
|
|
445
|
-
export function repairIssue(issue, apiKey, platformUrl) {
|
|
446
|
-
const repairFn = REPAIR_FUNCTIONS[issue.id];
|
|
447
|
-
if (!repairFn) {
|
|
448
|
-
return {
|
|
449
|
-
issueId: issue.id,
|
|
450
|
-
success: false,
|
|
451
|
-
message: `Sem funcao de reparo disponivel para: ${issue.id}`,
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
return repairFn(apiKey, platformUrl);
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Repair all auto-fixable issues from a diagnostic report
|
|
458
|
-
*/
|
|
459
|
-
export function repairAllIssues(report, apiKey, platformUrl = DEFAULT_PLATFORM_URL) {
|
|
460
|
-
const results = [];
|
|
461
|
-
const requiresUserInput = [];
|
|
462
|
-
let succeeded = 0;
|
|
463
|
-
let failed = 0;
|
|
464
|
-
// Filter to auto-fixable issues only
|
|
465
|
-
const fixableIssues = report.issues.filter((issue) => issue.autoFixable);
|
|
466
|
-
for (const issue of fixableIssues) {
|
|
467
|
-
// Check if this issue needs user input
|
|
468
|
-
if (issueRequiresUserInput(issue.id) && !apiKey) {
|
|
469
|
-
requiresUserInput.push(issue.id);
|
|
470
|
-
results.push({
|
|
471
|
-
issueId: issue.id,
|
|
472
|
-
success: false,
|
|
473
|
-
message: "Requer API key para reparar.",
|
|
474
|
-
});
|
|
475
|
-
failed++;
|
|
476
|
-
continue;
|
|
477
|
-
}
|
|
478
|
-
const result = repairIssue(issue, apiKey, platformUrl);
|
|
479
|
-
results.push(result);
|
|
480
|
-
if (result.success) {
|
|
481
|
-
succeeded++;
|
|
482
|
-
}
|
|
483
|
-
else {
|
|
484
|
-
failed++;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
return {
|
|
488
|
-
timestamp: new Date().toISOString(),
|
|
489
|
-
repairsAttempted: fixableIssues.length,
|
|
490
|
-
repairsSucceeded: succeeded,
|
|
491
|
-
repairsFailed: failed,
|
|
492
|
-
results,
|
|
493
|
-
requiresUserInput,
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Run diagnostics and repair all issues automatically
|
|
498
|
-
*/
|
|
499
|
-
export async function diagnoseAndRepair(apiKey, platformUrl = DEFAULT_PLATFORM_URL) {
|
|
500
|
-
const diagnostic = await runDiagnostics();
|
|
501
|
-
const repair = repairAllIssues(diagnostic, apiKey, platformUrl);
|
|
502
|
-
return { diagnostic, repair };
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Print repair report to console
|
|
506
|
-
*/
|
|
507
|
-
export function printRepairReport(report) {
|
|
508
|
-
println();
|
|
509
|
-
println(chalk.cyan(" ╔═══════════════════════════════════════╗"));
|
|
510
|
-
println(chalk.cyan(" ║") + chalk.white.bold(" ToStudy MCP Auto-Repair ") + chalk.cyan("║"));
|
|
511
|
-
println(chalk.cyan(" ╚═══════════════════════════════════════╝"));
|
|
512
|
-
println();
|
|
513
|
-
if (report.repairsAttempted === 0) {
|
|
514
|
-
println(chalk.green.bold("✓ Nenhum reparo necessario!"));
|
|
515
|
-
println();
|
|
516
|
-
println(chalk.gray("Nenhum problema corrigivel automaticamente foi encontrado."));
|
|
517
|
-
println();
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
// Summary
|
|
521
|
-
println(chalk.white.bold("Resumo:"));
|
|
522
|
-
println(` Reparos tentados: ${report.repairsAttempted}`);
|
|
523
|
-
println(` ${chalk.green("✓ Sucesso:")} ${report.repairsSucceeded}`);
|
|
524
|
-
if (report.repairsFailed > 0) {
|
|
525
|
-
println(` ${chalk.red("✗ Falha:")} ${report.repairsFailed}`);
|
|
526
|
-
}
|
|
527
|
-
println();
|
|
528
|
-
// Results
|
|
529
|
-
println(chalk.white.bold("Detalhes:"));
|
|
530
|
-
println();
|
|
531
|
-
for (const result of report.results) {
|
|
532
|
-
if (result.success) {
|
|
533
|
-
println(` ${chalk.green("✓")} ${result.message}`);
|
|
534
|
-
if (result.action) {
|
|
535
|
-
println(chalk.gray(` ${result.action}`));
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
else {
|
|
539
|
-
println(` ${chalk.red("✗")} ${result.message}`);
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
println();
|
|
543
|
-
// User input required
|
|
544
|
-
if (report.requiresUserInput.length > 0) {
|
|
545
|
-
println(chalk.yellow("⚠ Alguns reparos requerem interacao:"));
|
|
546
|
-
println();
|
|
547
|
-
println(" Para reparar problemas de API key, execute:");
|
|
548
|
-
println(chalk.cyan(" npx @tostudy-ai/mcp-setup repair --api-key <sua-api-key>"));
|
|
549
|
-
println();
|
|
550
|
-
println(" Para gerar uma nova API key:");
|
|
551
|
-
println(chalk.cyan(" https://tostudy.ai/student/settings/mcp"));
|
|
552
|
-
println();
|
|
553
|
-
}
|
|
554
|
-
// Final status
|
|
555
|
-
if (report.repairsFailed === 0 && report.requiresUserInput.length === 0) {
|
|
556
|
-
println(chalk.green.bold("✓ Todos os reparos concluidos com sucesso!"));
|
|
557
|
-
println(chalk.gray(" Reinicie o Claude Code para aplicar as mudancas."));
|
|
558
|
-
}
|
|
559
|
-
else if (report.repairsSucceeded > 0) {
|
|
560
|
-
println(chalk.yellow("⚠ Alguns reparos foram concluidos, mas outros falharam."));
|
|
561
|
-
println(chalk.gray(" Execute o diagnostico novamente para verificar o status."));
|
|
562
|
-
}
|
|
563
|
-
else {
|
|
564
|
-
println(chalk.red("✗ Nenhum reparo foi concluido com sucesso."));
|
|
565
|
-
println(chalk.gray(" Verifique os erros acima e tente novamente."));
|
|
566
|
-
}
|
|
567
|
-
println();
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Export repair report as JSON
|
|
571
|
-
*/
|
|
572
|
-
export function exportRepairReportJson(report) {
|
|
573
|
-
return JSON.stringify(report, null, 2);
|
|
574
|
-
}
|
|
575
|
-
// CLI entry point
|
|
576
|
-
if (process.argv[1]?.endsWith("repair.js")) {
|
|
577
|
-
(async () => {
|
|
578
|
-
try {
|
|
579
|
-
// Parse command line arguments
|
|
580
|
-
let apiKey;
|
|
581
|
-
let platformUrl = DEFAULT_PLATFORM_URL;
|
|
582
|
-
let jsonOutput = false;
|
|
583
|
-
for (let i = 2; i < process.argv.length; i++) {
|
|
584
|
-
const arg = process.argv[i];
|
|
585
|
-
if (arg === "--api-key" && process.argv[i + 1]) {
|
|
586
|
-
apiKey = process.argv[++i];
|
|
587
|
-
}
|
|
588
|
-
else if (arg === "--url" && process.argv[i + 1]) {
|
|
589
|
-
platformUrl = process.argv[++i];
|
|
590
|
-
}
|
|
591
|
-
else if (arg === "--json") {
|
|
592
|
-
jsonOutput = true;
|
|
593
|
-
}
|
|
594
|
-
else if (arg === "--help" || arg === "-h") {
|
|
595
|
-
println("ToStudy MCP Auto-Repair");
|
|
596
|
-
println();
|
|
597
|
-
println("Usage: node repair.js [options]");
|
|
598
|
-
println();
|
|
599
|
-
println("Options:");
|
|
600
|
-
println(" --api-key <key> API key para reparos que necessitam autenticacao");
|
|
601
|
-
println(" --url <url> URL da plataforma (default: https://tostudy.ai)");
|
|
602
|
-
println(" --json Saida em formato JSON");
|
|
603
|
-
println(" --help, -h Mostra esta ajuda");
|
|
604
|
-
println();
|
|
605
|
-
process.exit(0);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
// Check for API key in environment
|
|
609
|
-
if (!apiKey) {
|
|
610
|
-
apiKey = process.env.TOSTUDY_API_KEY;
|
|
611
|
-
}
|
|
612
|
-
// Run diagnostics and repair
|
|
613
|
-
const { diagnostic, repair } = await diagnoseAndRepair(apiKey, platformUrl);
|
|
614
|
-
// Output results
|
|
615
|
-
if (jsonOutput) {
|
|
616
|
-
println(JSON.stringify({ diagnostic, repair }, null, 2));
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
printRepairReport(repair);
|
|
620
|
-
}
|
|
621
|
-
// Exit code based on repair results
|
|
622
|
-
const hasUnfixedCritical = diagnostic.issues.some((issue) => issue.severity === "critical" &&
|
|
623
|
-
!repair.results.find((r) => r.issueId === issue.id && r.success));
|
|
624
|
-
process.exit(hasUnfixedCritical ? 1 : 0);
|
|
625
|
-
}
|
|
626
|
-
catch (error) {
|
|
627
|
-
process.stderr.write(chalk.red("Erro ao executar reparo:\n"));
|
|
628
|
-
process.stderr.write((error instanceof Error ? error.message : String(error)) + "\n");
|
|
629
|
-
process.exit(1);
|
|
630
|
-
}
|
|
631
|
-
})();
|
|
632
|
-
}
|
|
633
|
-
//# sourceMappingURL=repair.js.map
|
package/dist/repair.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GAEd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAqC,MAAM,eAAe,CAAC;AAkBlF,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAElD,SAAS,OAAO,CAAC,OAAO,GAAG,EAAE;IAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB;IAC1B,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,sCAAsC;QACtC,MAAM,aAAa,GAAiB;YAClC,UAAU,EAAE,EAAE;SACf,CAAC;QAEF,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAE3E,OAAO;YACL,OAAO,EAAE,gBAAg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