@andrebuzeli/git-mcp 5.0.5 → 5.0.6
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/LICENSE +21 -0
- package/README.md +143 -89
- package/dist/config.d.ts +72 -71
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +226 -139
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +15 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -128
- package/dist/index.js.map +1 -1
- package/dist/providers/base-provider.d.ts +42 -153
- package/dist/providers/base-provider.d.ts.map +1 -1
- package/dist/providers/base-provider.js +42 -302
- package/dist/providers/base-provider.js.map +1 -1
- package/dist/providers/gitea-provider.d.ts +67 -118
- package/dist/providers/gitea-provider.d.ts.map +1 -1
- package/dist/providers/gitea-provider.js +487 -1161
- package/dist/providers/gitea-provider.js.map +1 -1
- package/dist/providers/github-provider.d.ts +70 -81
- package/dist/providers/github-provider.d.ts.map +1 -1
- package/dist/providers/github-provider.js +641 -278
- package/dist/providers/github-provider.js.map +1 -1
- package/dist/providers/index.d.ts +9 -9
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +13 -19
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/provider-factory.d.ts +29 -59
- package/dist/providers/provider-factory.d.ts.map +1 -1
- package/dist/providers/provider-factory.js +134 -265
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/providers/provider-operation-handler.d.ts +93 -0
- package/dist/providers/provider-operation-handler.d.ts.map +1 -0
- package/dist/providers/provider-operation-handler.js +280 -0
- package/dist/providers/provider-operation-handler.js.map +1 -0
- package/dist/providers/types.d.ts +201 -355
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js +3 -2
- package/dist/providers/types.js.map +1 -1
- package/dist/server.d.ts +34 -8
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +436 -494
- package/dist/server.js.map +1 -1
- package/dist/tools/git-analytics.d.ts +239 -16
- package/dist/tools/git-analytics.d.ts.map +1 -1
- package/dist/tools/git-analytics.js +737 -25
- package/dist/tools/git-analytics.js.map +1 -1
- package/dist/tools/git-archive.d.ts +109 -15
- package/dist/tools/git-archive.d.ts.map +1 -1
- package/dist/tools/git-archive.js +462 -10
- package/dist/tools/git-archive.js.map +1 -1
- package/dist/tools/git-backup.d.ts +101 -15
- package/dist/tools/git-backup.d.ts.map +1 -1
- package/dist/tools/git-backup.js +410 -10
- package/dist/tools/git-backup.js.map +1 -1
- package/dist/tools/git-branches.d.ts +141 -15
- package/dist/tools/git-branches.d.ts.map +1 -1
- package/dist/tools/git-branches.js +466 -11
- package/dist/tools/git-branches.js.map +1 -1
- package/dist/tools/git-config.d.ts +115 -15
- package/dist/tools/git-config.d.ts.map +1 -1
- package/dist/tools/git-config.js +446 -11
- package/dist/tools/git-config.js.map +1 -1
- package/dist/tools/git-files.d.ts +179 -59
- package/dist/tools/git-files.d.ts.map +1 -1
- package/dist/tools/git-files.js +682 -222
- package/dist/tools/git-files.js.map +1 -1
- package/dist/tools/git-issues.d.ts +158 -15
- package/dist/tools/git-issues.d.ts.map +1 -1
- package/dist/tools/git-issues.js +323 -11
- package/dist/tools/git-issues.js.map +1 -1
- package/dist/tools/git-monitor.d.ts +149 -14
- package/dist/tools/git-monitor.d.ts.map +1 -1
- package/dist/tools/git-monitor.js +528 -11
- package/dist/tools/git-monitor.js.map +1 -1
- package/dist/tools/git-packages.d.ts +163 -15
- package/dist/tools/git-packages.d.ts.map +1 -1
- package/dist/tools/git-packages.js +526 -11
- package/dist/tools/git-packages.js.map +1 -1
- package/dist/tools/git-pulls.d.ts +174 -15
- package/dist/tools/git-pulls.d.ts.map +1 -1
- package/dist/tools/git-pulls.js +352 -11
- package/dist/tools/git-pulls.js.map +1 -1
- package/dist/tools/git-release.d.ts +167 -15
- package/dist/tools/git-release.d.ts.map +1 -1
- package/dist/tools/git-release.js +465 -11
- package/dist/tools/git-release.js.map +1 -1
- package/dist/tools/git-remote.d.ts +124 -15
- package/dist/tools/git-remote.d.ts.map +1 -1
- package/dist/tools/git-remote.js +539 -11
- package/dist/tools/git-remote.js.map +1 -1
- package/dist/tools/git-reset.d.ts +100 -15
- package/dist/tools/git-reset.d.ts.map +1 -1
- package/dist/tools/git-reset.js +409 -11
- package/dist/tools/git-reset.js.map +1 -1
- package/dist/tools/git-stash.d.ts +120 -15
- package/dist/tools/git-stash.d.ts.map +1 -1
- package/dist/tools/git-stash.js +503 -11
- package/dist/tools/git-stash.js.map +1 -1
- package/dist/tools/git-sync.d.ts +160 -16
- package/dist/tools/git-sync.d.ts.map +1 -1
- package/dist/tools/git-sync.js +462 -113
- package/dist/tools/git-sync.js.map +1 -1
- package/dist/tools/git-tags.d.ts +142 -15
- package/dist/tools/git-tags.d.ts.map +1 -1
- package/dist/tools/git-tags.js +471 -11
- package/dist/tools/git-tags.js.map +1 -1
- package/dist/tools/git-workflow.d.ts +151 -80
- package/dist/tools/git-workflow.d.ts.map +1 -1
- package/dist/tools/git-workflow.js +407 -912
- package/dist/tools/git-workflow.js.map +1 -1
- package/dist/utils/credential-manager.d.ts +119 -0
- package/dist/utils/credential-manager.d.ts.map +1 -0
- package/dist/utils/credential-manager.js +450 -0
- package/dist/utils/credential-manager.js.map +1 -0
- package/dist/utils/git-command-executor.d.ts +326 -0
- package/dist/utils/git-command-executor.d.ts.map +1 -0
- package/dist/utils/git-command-executor.js +877 -0
- package/dist/utils/git-command-executor.js.map +1 -0
- package/dist/utils/logger.d.ts +143 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +473 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/operation-error-handler.d.ts +54 -41
- package/dist/utils/operation-error-handler.d.ts.map +1 -1
- package/dist/utils/operation-error-handler.js +211 -227
- package/dist/utils/operation-error-handler.js.map +1 -1
- package/dist/utils/parameter-validator.d.ts +41 -0
- package/dist/utils/parameter-validator.d.ts.map +1 -0
- package/dist/utils/parameter-validator.js +464 -0
- package/dist/utils/parameter-validator.js.map +1 -0
- package/dist/utils/repository-detector.d.ts +128 -0
- package/dist/utils/repository-detector.d.ts.map +1 -0
- package/dist/utils/repository-detector.js +422 -0
- package/dist/utils/repository-detector.js.map +1 -0
- package/dist/utils/response-formatter.d.ts +146 -0
- package/dist/utils/response-formatter.d.ts.map +1 -0
- package/dist/utils/response-formatter.js +378 -0
- package/dist/utils/response-formatter.js.map +1 -0
- package/dist/utils/retry.d.ts +12 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +28 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/terminal-controller.d.ts +73 -139
- package/dist/utils/terminal-controller.d.ts.map +1 -1
- package/dist/utils/terminal-controller.js +234 -459
- package/dist/utils/terminal-controller.js.map +1 -1
- package/package.json +79 -60
- package/dist/providers/error-handler.d.ts +0 -51
- package/dist/providers/error-handler.d.ts.map +0 -1
- package/dist/providers/error-handler.js +0 -176
- package/dist/providers/error-handler.js.map +0 -1
- package/dist/providers/github-provider-backup.d.ts +0 -81
- package/dist/providers/github-provider-backup.d.ts.map +0 -1
- package/dist/providers/github-provider-backup.js +0 -1179
- package/dist/providers/github-provider-backup.js.map +0 -1
- package/dist/providers/github-provider-complete.d.ts +0 -1
- package/dist/providers/github-provider-complete.d.ts.map +0 -1
- package/dist/providers/github-provider-complete.js +0 -2
- package/dist/providers/github-provider-complete.js.map +0 -1
- package/dist/tools/git-init.d.ts +0 -50
- package/dist/tools/git-init.d.ts.map +0 -1
- package/dist/tools/git-init.js +0 -258
- package/dist/tools/git-init.js.map +0 -1
- package/dist/tools/git-log.d.ts +0 -67
- package/dist/tools/git-log.d.ts.map +0 -1
- package/dist/tools/git-log.js +0 -320
- package/dist/tools/git-log.js.map +0 -1
- package/dist/tools/git-status.d.ts +0 -29
- package/dist/tools/git-status.d.ts.map +0 -1
- package/dist/tools/git-status.js +0 -182
- package/dist/tools/git-status.js.map +0 -1
- package/dist/tools/git-update.d.ts +0 -34
- package/dist/tools/git-update.d.ts.map +0 -1
- package/dist/tools/git-update.js +0 -191
- package/dist/tools/git-update.js.map +0 -1
- package/dist/utils/auto-detection.d.ts +0 -120
- package/dist/utils/auto-detection.d.ts.map +0 -1
- package/dist/utils/auto-detection.js +0 -259
- package/dist/utils/auto-detection.js.map +0 -1
- package/dist/utils/configuration-error-generator.d.ts +0 -41
- package/dist/utils/configuration-error-generator.d.ts.map +0 -1
- package/dist/utils/configuration-error-generator.js +0 -168
- package/dist/utils/configuration-error-generator.js.map +0 -1
- package/dist/utils/configuration-validator.d.ts +0 -67
- package/dist/utils/configuration-validator.d.ts.map +0 -1
- package/dist/utils/configuration-validator.js +0 -257
- package/dist/utils/configuration-validator.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -107
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -331
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/git-operations.d.ts +0 -200
- package/dist/utils/git-operations.d.ts.map +0 -1
- package/dist/utils/git-operations.js +0 -836
- package/dist/utils/git-operations.js.map +0 -1
- package/dist/utils/multi-provider-error-handler.d.ts +0 -75
- package/dist/utils/multi-provider-error-handler.d.ts.map +0 -1
- package/dist/utils/multi-provider-error-handler.js +0 -276
- package/dist/utils/multi-provider-error-handler.js.map +0 -1
- package/dist/utils/multi-provider-operation-handler.d.ts +0 -113
- package/dist/utils/multi-provider-operation-handler.d.ts.map +0 -1
- package/dist/utils/multi-provider-operation-handler.js +0 -303
- package/dist/utils/multi-provider-operation-handler.js.map +0 -1
- package/dist/utils/provider-operation-handler.d.ts +0 -80
- package/dist/utils/provider-operation-handler.d.ts.map +0 -1
- package/dist/utils/provider-operation-handler.js +0 -201
- package/dist/utils/provider-operation-handler.js.map +0 -1
- package/dist/utils/response-helper.d.ts +0 -57
- package/dist/utils/response-helper.d.ts.map +0 -1
- package/dist/utils/response-helper.js +0 -54
- package/dist/utils/response-helper.js.map +0 -1
- package/dist/utils/user-detection.d.ts +0 -25
- package/dist/utils/user-detection.d.ts.map +0 -1
- package/dist/utils/user-detection.js +0 -54
- package/dist/utils/user-detection.js.map +0 -1
package/dist/tools/git-update.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gitUpdateTool = void 0;
|
|
4
|
-
const auto_detection_js_1 = require("../utils/auto-detection.js");
|
|
5
|
-
const configuration_validator_js_1 = require("../utils/configuration-validator.js");
|
|
6
|
-
const index_js_1 = require("../providers/index.js");
|
|
7
|
-
const terminal_controller_js_1 = require("../utils/terminal-controller.js");
|
|
8
|
-
/**
|
|
9
|
-
* Git Update Tool - Atualização Completa do Projeto
|
|
10
|
-
*
|
|
11
|
-
* Atualiza o projeto atual em ambos os providers (GitHub e Gitea):
|
|
12
|
-
* - Faz pull das mudanças remotas
|
|
13
|
-
* - Adiciona todas as mudanças locais
|
|
14
|
-
* - Faz commit com mensagem
|
|
15
|
-
* - Faz push para ambos os providers
|
|
16
|
-
*/
|
|
17
|
-
const inputSchema = {
|
|
18
|
-
type: 'object',
|
|
19
|
-
properties: {
|
|
20
|
-
projectPath: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'Caminho do projeto (obrigatório)'
|
|
23
|
-
},
|
|
24
|
-
message: {
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Mensagem de commit (obrigatório)'
|
|
27
|
-
},
|
|
28
|
-
provider: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
enum: ['github', 'gitea', 'both'],
|
|
31
|
-
description: 'Provider para push (obrigatório)'
|
|
32
|
-
},
|
|
33
|
-
branch: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
description: 'Branch para operação (padrão: main)'
|
|
36
|
-
},
|
|
37
|
-
pullFirst: {
|
|
38
|
-
type: 'boolean',
|
|
39
|
-
description: 'Fazer pull antes do push (padrão: true)'
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
required: ['projectPath', 'message', 'provider']
|
|
43
|
-
};
|
|
44
|
-
exports.gitUpdateTool = {
|
|
45
|
-
name: 'git-update',
|
|
46
|
-
description: '🔄 ATUALIZAÇÃO COMPLETA - Atualiza o projeto atual em ambos providers (pull + commit + push)',
|
|
47
|
-
inputSchema,
|
|
48
|
-
async handler(input) {
|
|
49
|
-
try {
|
|
50
|
-
const { projectPath, message, provider, branch = 'main', pullFirst = true } = input;
|
|
51
|
-
const detection = (0, auto_detection_js_1.autoDetect)(projectPath);
|
|
52
|
-
// Validar provider obrigatório
|
|
53
|
-
if (!provider) {
|
|
54
|
-
throw new Error('Provider é obrigatório. Use: github, gitea, ou both');
|
|
55
|
-
}
|
|
56
|
-
// Validar provider
|
|
57
|
-
const providerValidation = configuration_validator_js_1.ConfigurationValidator.validateProvider(provider);
|
|
58
|
-
if (!providerValidation.valid) {
|
|
59
|
-
return (0, auto_detection_js_1.createUniversalResponse)(false, 'update', providerValidation.error.message, detection, 'git-update', undefined, {
|
|
60
|
-
code: providerValidation.error.code,
|
|
61
|
-
message: providerValidation.error.message,
|
|
62
|
-
cause: 'Invalid provider parameter',
|
|
63
|
-
suggestion: providerValidation.error.suggestion
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
// Verificar se é um repositório Git
|
|
67
|
-
if (!(0, terminal_controller_js_1.isGitRepository)(projectPath)) {
|
|
68
|
-
throw new Error('Diretório não é um repositório Git válido');
|
|
69
|
-
}
|
|
70
|
-
const steps = [];
|
|
71
|
-
const results = {};
|
|
72
|
-
// 1. Pull primeiro (se solicitado)
|
|
73
|
-
if (pullFirst) {
|
|
74
|
-
try {
|
|
75
|
-
const pullResult = await (0, terminal_controller_js_1.gitPull)(projectPath, branch);
|
|
76
|
-
steps.push('✅ Pull realizado com sucesso');
|
|
77
|
-
results.pull = { success: true, output: pullResult };
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
steps.push('⚠️ Pull falhou (continuando)');
|
|
81
|
-
results.pull = { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
// 2. Verificar status
|
|
85
|
-
const statusResult = await (0, terminal_controller_js_1.getGitStatus)(projectPath);
|
|
86
|
-
const status = statusResult.output;
|
|
87
|
-
if (status.includes('nothing to commit')) {
|
|
88
|
-
return (0, auto_detection_js_1.createUniversalResponse)(true, 'update', 'Nenhuma mudança para commit', detection, 'git-update', {
|
|
89
|
-
status: 'clean',
|
|
90
|
-
message: 'Repositório está limpo, nada para atualizar',
|
|
91
|
-
steps,
|
|
92
|
-
provider
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
// 3. Add todas as mudanças
|
|
96
|
-
try {
|
|
97
|
-
await (0, terminal_controller_js_1.gitAdd)(projectPath, '.');
|
|
98
|
-
steps.push('✅ Arquivos adicionados ao stage');
|
|
99
|
-
results.add = { success: true };
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
throw new Error(`Falha ao adicionar arquivos: ${error instanceof Error ? error.message : String(error)}`);
|
|
103
|
-
}
|
|
104
|
-
// 4. Commit
|
|
105
|
-
try {
|
|
106
|
-
const commitResult = await (0, terminal_controller_js_1.gitCommit)(projectPath, message);
|
|
107
|
-
steps.push('✅ Commit realizado com sucesso');
|
|
108
|
-
results.commit = { success: true, output: commitResult };
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
throw new Error(`Falha no commit: ${error instanceof Error ? error.message : String(error)}`);
|
|
112
|
-
}
|
|
113
|
-
// 5. Push para provider(s)
|
|
114
|
-
const pushResults = {};
|
|
115
|
-
if (provider === 'both') {
|
|
116
|
-
// Push para ambos os providers
|
|
117
|
-
const providers = ['github', 'gitea'];
|
|
118
|
-
for (const providerName of providers) {
|
|
119
|
-
try {
|
|
120
|
-
const providerInstance = index_js_1.globalProviderFactory.getProvider(providerName);
|
|
121
|
-
if (providerInstance) {
|
|
122
|
-
const pushResult = await (0, terminal_controller_js_1.gitPush)(projectPath, branch, providerName);
|
|
123
|
-
steps.push(`✅ Push para ${providerName} realizado com sucesso`);
|
|
124
|
-
pushResults[providerName] = { success: true, output: pushResult };
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
steps.push(`⚠️ Provider ${providerName} não configurado`);
|
|
128
|
-
pushResults[providerName] = { success: false, error: 'Provider não configurado' };
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
steps.push(`❌ Push para ${providerName} falhou`);
|
|
133
|
-
pushResults[providerName] = {
|
|
134
|
-
success: false,
|
|
135
|
-
error: error instanceof Error ? error.message : String(error)
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return (0, auto_detection_js_1.createUniversalResponse)(true, 'update', 'Atualização completa finalizada', detection, 'git-update', {
|
|
140
|
-
message,
|
|
141
|
-
branch,
|
|
142
|
-
provider: 'both',
|
|
143
|
-
steps,
|
|
144
|
-
results: {
|
|
145
|
-
...results,
|
|
146
|
-
push: pushResults
|
|
147
|
-
},
|
|
148
|
-
summary: {
|
|
149
|
-
totalProviders: 2,
|
|
150
|
-
successfulPushes: Object.values(pushResults).filter((r) => r.success).length,
|
|
151
|
-
failedPushes: Object.values(pushResults).filter((r) => !r.success).length
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
// Push para provider único
|
|
157
|
-
try {
|
|
158
|
-
const providerInstance = index_js_1.globalProviderFactory.getProvider(provider);
|
|
159
|
-
if (!providerInstance) {
|
|
160
|
-
throw new Error(`Provider ${provider} não configurado`);
|
|
161
|
-
}
|
|
162
|
-
const pushResult = await (0, terminal_controller_js_1.gitPush)(projectPath, branch, provider);
|
|
163
|
-
steps.push(`✅ Push para ${provider} realizado com sucesso`);
|
|
164
|
-
return (0, auto_detection_js_1.createUniversalResponse)(true, 'update', `Atualização completa para ${provider} finalizada`, detection, 'git-update', {
|
|
165
|
-
message,
|
|
166
|
-
branch,
|
|
167
|
-
provider,
|
|
168
|
-
steps,
|
|
169
|
-
results: {
|
|
170
|
-
...results,
|
|
171
|
-
push: { success: true, output: pushResult }
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
throw new Error(`Push para ${provider} falhou: ${error instanceof Error ? error.message : String(error)}`);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
catch (error) {
|
|
181
|
-
const detection = (0, auto_detection_js_1.autoDetect)(input.projectPath || '');
|
|
182
|
-
const errorInstance = error instanceof Error ? error : new Error(String(error));
|
|
183
|
-
return (0, auto_detection_js_1.createUniversalResponse)(false, 'update', `Erro na atualização: ${errorInstance.message}`, detection, 'git-update', undefined, {
|
|
184
|
-
code: 'UPDATE_ERROR',
|
|
185
|
-
message: errorInstance.message,
|
|
186
|
-
cause: 'Update operation failed'
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
//# sourceMappingURL=git-update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-update.js","sourceRoot":"","sources":["../../src/tools/git-update.ts"],"names":[],"mappings":";;;AAAA,kEAAoG;AACpG,oFAA6E;AAC7E,oDAA8D;AAC9D,4EAOyC;AAEzC;;;;;;;;GAQG;AAEH,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kCAAkC;SAChD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kCAAkC;SAChD;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;YACjC,WAAW,EAAE,kCAAkC;SAChD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;Y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aAAa,CAAC,OAAO,EAAE,EAC/C,SAAS,EACT,YAAY,EACZ,SAAS,EACT;gBACE,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,aAAa,CAAC,OAAO;gBAC9B,KAAK,EAAE,yBAAyB;aACjC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sistema de Auto-detecção Universal para MCP Git
|
|
3
|
-
*
|
|
4
|
-
* Conforme especificado no design.md, este módulo:
|
|
5
|
-
* - Extrai repo name automaticamente do projectPath
|
|
6
|
-
* - Detecta owner/username das variáveis de ambiente
|
|
7
|
-
* - Identifica providers disponíveis baseados nos tokens ENV
|
|
8
|
-
* - Fornece interface universal para todas as tools
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Interface para informações auto-detectadas
|
|
12
|
-
*/
|
|
13
|
-
export interface AutoDetection {
|
|
14
|
-
/** Caminho absoluto do projeto */
|
|
15
|
-
projectPath: string;
|
|
16
|
-
/** Nome do repositório extraído automaticamente */
|
|
17
|
-
repoName: string;
|
|
18
|
-
/** Owner/username detectado das ENV vars */
|
|
19
|
-
owner: string;
|
|
20
|
-
/** Lista de providers disponíveis */
|
|
21
|
-
providers: ('gitea' | 'github')[];
|
|
22
|
-
/** Se é um repositório Git válido */
|
|
23
|
-
isValidRepo: boolean;
|
|
24
|
-
/** Caminho do .git */
|
|
25
|
-
gitPath?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Interface para configuração de providers
|
|
29
|
-
*/
|
|
30
|
-
export interface ProviderConfig {
|
|
31
|
-
gitea?: {
|
|
32
|
-
username: string;
|
|
33
|
-
token: string;
|
|
34
|
-
url: string;
|
|
35
|
-
};
|
|
36
|
-
github?: {
|
|
37
|
-
username: string;
|
|
38
|
-
token: string;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Extrai o nome do repositório do projectPath
|
|
43
|
-
*
|
|
44
|
-
* Exemplos:
|
|
45
|
-
* - "C:/Users/Dev/MeuProjeto" → "MeuProjeto"
|
|
46
|
-
* - "/home/user/projects/web-app" → "web-app"
|
|
47
|
-
* - "Z:\MCP\GIT MCP" → "GIT MCP"
|
|
48
|
-
*/
|
|
49
|
-
export declare function extractRepoName(projectPath: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Detecta configuração de providers das variáveis de ambiente
|
|
52
|
-
*/
|
|
53
|
-
export declare function detectProviderConfig(): ProviderConfig;
|
|
54
|
-
/**
|
|
55
|
-
* Detecta providers disponíveis baseados na configuração
|
|
56
|
-
*/
|
|
57
|
-
export declare function detectAvailableProviders(): ('gitea' | 'github')[];
|
|
58
|
-
/**
|
|
59
|
-
* Detecta o owner/username principal (prioriza Gitea, depois GitHub)
|
|
60
|
-
*/
|
|
61
|
-
export declare function detectOwner(): string;
|
|
62
|
-
/**
|
|
63
|
-
* Verifica se o diretório é um repositório Git válido
|
|
64
|
-
*/
|
|
65
|
-
export declare function isValidGitRepository(projectPath: string): {
|
|
66
|
-
isValid: boolean;
|
|
67
|
-
gitPath?: string;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Função principal de auto-detecção universal
|
|
71
|
-
*
|
|
72
|
-
* Esta função é chamada por TODAS as tools Git para obter contexto automático
|
|
73
|
-
*/
|
|
74
|
-
export declare function autoDetect(projectPath: string): AutoDetection;
|
|
75
|
-
/**
|
|
76
|
-
* Valida se o contexto auto-detectado é suficiente para operações
|
|
77
|
-
*/
|
|
78
|
-
export declare function validateAutoDetection(detection: AutoDetection): {
|
|
79
|
-
isValid: boolean;
|
|
80
|
-
errors: string[];
|
|
81
|
-
warnings: string[];
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Interface de resposta universal para todas as tools
|
|
85
|
-
*/
|
|
86
|
-
export interface UniversalResponse {
|
|
87
|
-
success: boolean;
|
|
88
|
-
action: string;
|
|
89
|
-
message: string;
|
|
90
|
-
data?: any;
|
|
91
|
-
error?: {
|
|
92
|
-
code: string;
|
|
93
|
-
message: string;
|
|
94
|
-
cause: string;
|
|
95
|
-
suggestion?: string;
|
|
96
|
-
};
|
|
97
|
-
autoDetected: {
|
|
98
|
-
repo: string;
|
|
99
|
-
owner: string;
|
|
100
|
-
providers: string[];
|
|
101
|
-
};
|
|
102
|
-
metadata: {
|
|
103
|
-
projectPath: string;
|
|
104
|
-
timestamp: string;
|
|
105
|
-
operation: string;
|
|
106
|
-
toolName?: string;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Cria resposta universal padronizada
|
|
111
|
-
*/
|
|
112
|
-
export declare function createUniversalResponse(success: boolean, action: string, message: string, detection: AutoDetection, toolName: string, data?: any, error?: UniversalResponse['error']): UniversalResponse;
|
|
113
|
-
export declare function createUniversalResponse(params: {
|
|
114
|
-
success: boolean;
|
|
115
|
-
action: string;
|
|
116
|
-
message: string;
|
|
117
|
-
data?: any;
|
|
118
|
-
error?: UniversalResponse['error'];
|
|
119
|
-
}): UniversalResponse;
|
|
120
|
-
//# sourceMappingURL=auto-detection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-detection.d.ts","sourceRoot":"","sources":["../../src/utils/auto-detection.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,SAAS,EAAE,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC;IAClC,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAA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E;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,GAAG,EACV,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,GACjC,iBAAiB,CAAC;AAErB,wBAAgB,uBAAuB,CACrC,MAAM,EAAE;IACN,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACpC,GACA,iBAAiB,CAAC"}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.extractRepoName = extractRepoName;
|
|
37
|
-
exports.detectProviderConfig = detectProviderConfig;
|
|
38
|
-
exports.detectAvailableProviders = detectAvailableProviders;
|
|
39
|
-
exports.detectOwner = detectOwner;
|
|
40
|
-
exports.isValidGitRepository = isValidGitRepository;
|
|
41
|
-
exports.autoDetect = autoDetect;
|
|
42
|
-
exports.validateAutoDetection = validateAutoDetection;
|
|
43
|
-
exports.createUniversalResponse = createUniversalResponse;
|
|
44
|
-
const fs = __importStar(require("fs"));
|
|
45
|
-
const path = __importStar(require("path"));
|
|
46
|
-
/**
|
|
47
|
-
* Extrai o nome do repositório do projectPath
|
|
48
|
-
*
|
|
49
|
-
* Exemplos:
|
|
50
|
-
* - "C:/Users/Dev/MeuProjeto" → "MeuProjeto"
|
|
51
|
-
* - "/home/user/projects/web-app" → "web-app"
|
|
52
|
-
* - "Z:\MCP\GIT MCP" → "GIT MCP"
|
|
53
|
-
*/
|
|
54
|
-
function extractRepoName(projectPath) {
|
|
55
|
-
if (!projectPath || typeof projectPath !== 'string') {
|
|
56
|
-
throw new Error('projectPath deve ser uma string válida');
|
|
57
|
-
}
|
|
58
|
-
// Remove barras finais e divide por separadores
|
|
59
|
-
const normalizedPath = projectPath.replace(/[\\\/]+$/, '');
|
|
60
|
-
const pathParts = normalizedPath.split(/[\\\/]/);
|
|
61
|
-
// Retorna a última parte não vazia
|
|
62
|
-
const repoName = pathParts[pathParts.length - 1];
|
|
63
|
-
if (!repoName || repoName.trim() === '') {
|
|
64
|
-
throw new Error(`Não foi possível extrair nome do repositório de: ${projectPath}`);
|
|
65
|
-
}
|
|
66
|
-
return repoName.trim();
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Detecta configuração de providers das variáveis de ambiente
|
|
70
|
-
*/
|
|
71
|
-
function detectProviderConfig() {
|
|
72
|
-
const config = {};
|
|
73
|
-
// Detecta Gitea
|
|
74
|
-
const giteaUsername = process.env.GITEA_USERNAME;
|
|
75
|
-
const giteaToken = process.env.GITEA_TOKEN;
|
|
76
|
-
const giteaUrl = process.env.GITEA_URL;
|
|
77
|
-
if (giteaUsername && giteaToken && giteaUrl) {
|
|
78
|
-
config.gitea = {
|
|
79
|
-
username: giteaUsername,
|
|
80
|
-
token: giteaToken,
|
|
81
|
-
url: giteaUrl
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
// Detecta GitHub
|
|
85
|
-
const githubUsername = process.env.GITHUB_USERNAME;
|
|
86
|
-
const githubToken = process.env.GITHUB_TOKEN;
|
|
87
|
-
if (githubUsername && githubToken) {
|
|
88
|
-
config.github = {
|
|
89
|
-
username: githubUsername,
|
|
90
|
-
token: githubToken
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
return config;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Detecta providers disponíveis baseados na configuração
|
|
97
|
-
*/
|
|
98
|
-
function detectAvailableProviders() {
|
|
99
|
-
const config = detectProviderConfig();
|
|
100
|
-
const providers = [];
|
|
101
|
-
if (config.gitea) {
|
|
102
|
-
providers.push('gitea');
|
|
103
|
-
}
|
|
104
|
-
if (config.github) {
|
|
105
|
-
providers.push('github');
|
|
106
|
-
}
|
|
107
|
-
return providers;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Detecta o owner/username principal (prioriza Gitea, depois GitHub)
|
|
111
|
-
*/
|
|
112
|
-
function detectOwner() {
|
|
113
|
-
const config = detectProviderConfig();
|
|
114
|
-
// Prioriza Gitea como especificado no design
|
|
115
|
-
if (config.gitea?.username) {
|
|
116
|
-
return config.gitea.username;
|
|
117
|
-
}
|
|
118
|
-
if (config.github?.username) {
|
|
119
|
-
return config.github.username;
|
|
120
|
-
}
|
|
121
|
-
throw new Error('Nenhum provider configurado. Configure GITEA_USERNAME/GITEA_TOKEN/GITEA_URL ou GITHUB_USERNAME/GITHUB_TOKEN');
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Verifica se o diretório é um repositório Git válido
|
|
125
|
-
*/
|
|
126
|
-
function isValidGitRepository(projectPath) {
|
|
127
|
-
try {
|
|
128
|
-
const gitPath = path.join(projectPath, '.git');
|
|
129
|
-
// Verifica se .git existe (diretório ou arquivo)
|
|
130
|
-
const gitExists = fs.existsSync(gitPath);
|
|
131
|
-
if (!gitExists) {
|
|
132
|
-
return { isValid: false };
|
|
133
|
-
}
|
|
134
|
-
// Se for um arquivo, pode ser um git worktree
|
|
135
|
-
const gitStat = fs.statSync(gitPath);
|
|
136
|
-
if (gitStat.isFile()) {
|
|
137
|
-
// Verifica se aponta para um .git válido
|
|
138
|
-
try {
|
|
139
|
-
const gitFileContent = fs.readFileSync(gitPath, 'utf8');
|
|
140
|
-
const gitDirMatch = gitFileContent.match(/gitdir: (.+)/);
|
|
141
|
-
if (gitDirMatch) {
|
|
142
|
-
const actualGitPath = path.resolve(projectPath, gitDirMatch[1]);
|
|
143
|
-
return {
|
|
144
|
-
isValid: fs.existsSync(actualGitPath),
|
|
145
|
-
gitPath: actualGitPath
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
return { isValid: false };
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
isValid: true,
|
|
155
|
-
gitPath: gitPath
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
catch (error) {
|
|
159
|
-
return { isValid: false };
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Função principal de auto-detecção universal
|
|
164
|
-
*
|
|
165
|
-
* Esta função é chamada por TODAS as tools Git para obter contexto automático
|
|
166
|
-
*/
|
|
167
|
-
function autoDetect(projectPath) {
|
|
168
|
-
if (!projectPath || typeof projectPath !== 'string') {
|
|
169
|
-
throw new Error('projectPath deve ser uma string válida');
|
|
170
|
-
}
|
|
171
|
-
// Normaliza o caminho
|
|
172
|
-
const normalizedPath = path.resolve(projectPath);
|
|
173
|
-
// Verifica se o diretório existe
|
|
174
|
-
if (!fs.existsSync(normalizedPath)) {
|
|
175
|
-
throw new Error(`Diretório do projeto não existe: ${normalizedPath}`);
|
|
176
|
-
}
|
|
177
|
-
// Extrai informações automaticamente
|
|
178
|
-
const repoName = extractRepoName(normalizedPath);
|
|
179
|
-
const owner = detectOwner();
|
|
180
|
-
const providers = detectAvailableProviders();
|
|
181
|
-
const repoCheck = isValidGitRepository(normalizedPath);
|
|
182
|
-
return {
|
|
183
|
-
projectPath: normalizedPath,
|
|
184
|
-
repoName,
|
|
185
|
-
owner,
|
|
186
|
-
providers,
|
|
187
|
-
isValidRepo: repoCheck.isValid,
|
|
188
|
-
gitPath: repoCheck.gitPath
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Valida se o contexto auto-detectado é suficiente para operações
|
|
193
|
-
*/
|
|
194
|
-
function validateAutoDetection(detection) {
|
|
195
|
-
const errors = [];
|
|
196
|
-
const warnings = [];
|
|
197
|
-
if (!detection.repoName) {
|
|
198
|
-
errors.push('Nome do repositório não pôde ser extraído');
|
|
199
|
-
}
|
|
200
|
-
if (!detection.owner) {
|
|
201
|
-
errors.push('Owner/username não pôde ser detectado das variáveis de ambiente');
|
|
202
|
-
}
|
|
203
|
-
if (detection.providers.length === 0) {
|
|
204
|
-
warnings.push('Nenhum provider configurado - operações locais apenas');
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
isValid: errors.length === 0,
|
|
208
|
-
errors,
|
|
209
|
-
warnings
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function createUniversalResponse(successOrParams, action, message, detection, toolName, data, error) {
|
|
213
|
-
// Handle object parameter style
|
|
214
|
-
if (typeof successOrParams === 'object') {
|
|
215
|
-
const params = successOrParams;
|
|
216
|
-
return {
|
|
217
|
-
success: params.success,
|
|
218
|
-
action: params.action,
|
|
219
|
-
message: params.message,
|
|
220
|
-
data: params.data,
|
|
221
|
-
error: params.error,
|
|
222
|
-
autoDetected: {
|
|
223
|
-
repo: 'auto-detected',
|
|
224
|
-
owner: 'auto-detected',
|
|
225
|
-
providers: []
|
|
226
|
-
},
|
|
227
|
-
metadata: {
|
|
228
|
-
projectPath: 'unknown',
|
|
229
|
-
timestamp: new Date().toISOString(),
|
|
230
|
-
operation: params.action,
|
|
231
|
-
toolName: 'unknown'
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
// Handle individual parameters style
|
|
236
|
-
const success = successOrParams;
|
|
237
|
-
if (!action || !message || !detection) {
|
|
238
|
-
throw new Error('action, message and detection are required');
|
|
239
|
-
}
|
|
240
|
-
return {
|
|
241
|
-
success,
|
|
242
|
-
action,
|
|
243
|
-
message,
|
|
244
|
-
data,
|
|
245
|
-
error,
|
|
246
|
-
autoDetected: {
|
|
247
|
-
repo: detection.repoName,
|
|
248
|
-
owner: detection.owner,
|
|
249
|
-
providers: detection.providers
|
|
250
|
-
},
|
|
251
|
-
metadata: {
|
|
252
|
-
projectPath: detection.projectPath,
|
|
253
|
-
timestamp: new Date().toISOString(),
|
|
254
|
-
operation: action,
|
|
255
|
-
toolName: toolName || 'unknown'
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
//# sourceMappingURL=auto-detection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-detection.js","sourceRoot":"","sources":["../../src/utils/auto-detection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,0CAiBC;AAKD,oDA4BC;AAKD,4DAaC;AAKD,kCAeC;AAKD,oDAqCC;AAOD,gCA2BC;AAKD,sDAyBC;AAoDD,0DA8DC;AA1WD,uCAAyB;AACzB,2CAA6B;AA6C7B;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,WAAmB;IACjD,IAAI,CAAC,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,gDAAgD;IAChD,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEjD,mCAAmC;IACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEjD,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oDAAoD,WAAW,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB;IAClC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ACP,IAAI;QACJ,KAAK;QACL,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS,CAAC,QAAQ;YACxB,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,SAAS,EAAE,SAAS,CAAC,SAAS;SAC/B;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,SAAS,CAAC,WAAW;YAClC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,QAAQ,IAAI,SAAS;SAChC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration error generator for Git MCP providers
|
|
3
|
-
* Provides step-by-step instructions and examples for setting up providers
|
|
4
|
-
*/
|
|
5
|
-
export interface ConfigurationError {
|
|
6
|
-
provider: string;
|
|
7
|
-
missing: string[];
|
|
8
|
-
instructions: string[];
|
|
9
|
-
examples: Record<string, string>;
|
|
10
|
-
}
|
|
11
|
-
export declare class ConfigurationErrorGenerator {
|
|
12
|
-
/**
|
|
13
|
-
* Generate GitHub configuration error with setup instructions
|
|
14
|
-
*/
|
|
15
|
-
static generateGitHubError(): ConfigurationError;
|
|
16
|
-
/**
|
|
17
|
-
* Generate Gitea configuration error with setup instructions
|
|
18
|
-
*/
|
|
19
|
-
static generateGiteaError(): ConfigurationError;
|
|
20
|
-
/**
|
|
21
|
-
* Generate configuration error for both providers
|
|
22
|
-
*/
|
|
23
|
-
static generateBothProvidersError(): ConfigurationError;
|
|
24
|
-
/**
|
|
25
|
-
* Generate error for specific missing environment variables
|
|
26
|
-
*/
|
|
27
|
-
static generateMissingVariablesError(provider: string, missingVars: string[]): ConfigurationError;
|
|
28
|
-
/**
|
|
29
|
-
* Generate error message text from configuration error
|
|
30
|
-
*/
|
|
31
|
-
static formatErrorMessage(configError: ConfigurationError): string;
|
|
32
|
-
/**
|
|
33
|
-
* Generate error for authentication failures
|
|
34
|
-
*/
|
|
35
|
-
static generateAuthenticationError(provider: string): ConfigurationError;
|
|
36
|
-
/**
|
|
37
|
-
* Generate error for network/endpoint issues
|
|
38
|
-
*/
|
|
39
|
-
static generateNetworkError(provider: string, endpoint?: string): ConfigurationError;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=configuration-error-generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configuration-error-generator.d.ts","sourceRoot":"","sources":["../../src/utils/configuration-error-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,qBAAa,2BAA2B;IACtC;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,kBAAkB;IAkBhD;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,kBAAkB;IAmB/C;;OAEG;IACH,MAAM,CAAC,0BAA0B,IAAI,kBAAkB;IAuBvD;;OAEG;IACH,MAAM,CAAC,6BAA6B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAkBjG;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,WAAW,EAAE,kBAAkB,GAAG,MAAM;IAiBlE;;OAEG;IACH,MAAM,CAAC,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB;IAwBxE;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,kBAAkB;CA4BrF"}
|