@andrebuzeli/git-mcp 3.3.0 → 4.0.2

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.
Files changed (139) hide show
  1. package/README.md +63 -283
  2. package/dist/providers/base-provider.d.ts.map +1 -1
  3. package/dist/providers/base-provider.js +3 -26
  4. package/dist/providers/base-provider.js.map +1 -1
  5. package/dist/providers/gitea-provider.d.ts +0 -2
  6. package/dist/providers/gitea-provider.d.ts.map +1 -1
  7. package/dist/providers/gitea-provider.js +0 -62
  8. package/dist/providers/gitea-provider.js.map +1 -1
  9. package/dist/providers/github-provider.d.ts +0 -2
  10. package/dist/providers/github-provider.d.ts.map +1 -1
  11. package/dist/providers/github-provider.js +48 -105
  12. package/dist/providers/github-provider.js.map +1 -1
  13. package/dist/server.d.ts +0 -27
  14. package/dist/server.d.ts.map +1 -1
  15. package/dist/server.js +130 -1215
  16. package/dist/server.js.map +1 -1
  17. package/dist/tools/{git-commits.d.ts → git-analytics.d.ts} +4 -10
  18. package/dist/tools/git-analytics.d.ts.map +1 -0
  19. package/dist/tools/git-analytics.js +18 -0
  20. package/dist/tools/git-analytics.js.map +1 -0
  21. package/dist/tools/git-archive.d.ts +3 -0
  22. package/dist/tools/git-archive.d.ts.map +1 -1
  23. package/dist/tools/git-archive.js +2 -2
  24. package/dist/tools/git-archive.js.map +1 -1
  25. package/dist/tools/git-backup.d.ts +216 -0
  26. package/dist/tools/git-backup.d.ts.map +1 -0
  27. package/dist/tools/git-backup.js +813 -0
  28. package/dist/tools/git-backup.js.map +1 -0
  29. package/dist/tools/git-branches.d.ts +159 -8
  30. package/dist/tools/git-branches.d.ts.map +1 -1
  31. package/dist/tools/git-branches.js +554 -2
  32. package/dist/tools/git-branches.js.map +1 -1
  33. package/dist/tools/git-config.d.ts +3 -0
  34. package/dist/tools/git-config.d.ts.map +1 -1
  35. package/dist/tools/git-config.js +2 -2
  36. package/dist/tools/git-config.js.map +1 -1
  37. package/dist/tools/git-files.d.ts +130 -8
  38. package/dist/tools/git-files.d.ts.map +1 -1
  39. package/dist/tools/git-files.js +426 -2
  40. package/dist/tools/git-files.js.map +1 -1
  41. package/dist/tools/git-issues.d.ts +137 -471
  42. package/dist/tools/git-issues.d.ts.map +1 -1
  43. package/dist/tools/git-issues.js +605 -613
  44. package/dist/tools/git-issues.js.map +1 -1
  45. package/dist/tools/git-monitor.d.ts +161 -0
  46. package/dist/tools/git-monitor.d.ts.map +1 -0
  47. package/dist/tools/git-monitor.js +746 -0
  48. package/dist/tools/git-monitor.js.map +1 -0
  49. package/dist/tools/git-packages.d.ts +5 -2
  50. package/dist/tools/git-packages.d.ts.map +1 -1
  51. package/dist/tools/git-packages.js +3 -3
  52. package/dist/tools/git-packages.js.map +1 -1
  53. package/dist/tools/git-pulls.d.ts +38 -646
  54. package/dist/tools/git-pulls.d.ts.map +1 -1
  55. package/dist/tools/git-pulls.js +64 -716
  56. package/dist/tools/git-pulls.js.map +1 -1
  57. package/dist/tools/git-release.d.ts +187 -0
  58. package/dist/tools/git-release.d.ts.map +1 -0
  59. package/dist/tools/git-release.js +619 -0
  60. package/dist/tools/git-release.js.map +1 -0
  61. package/dist/tools/git-remote.d.ts +112 -77
  62. package/dist/tools/git-remote.d.ts.map +1 -1
  63. package/dist/tools/git-remote.js +481 -183
  64. package/dist/tools/git-remote.js.map +1 -1
  65. package/dist/tools/git-repos.d.ts +19 -0
  66. package/dist/tools/git-repos.d.ts.map +1 -0
  67. package/dist/tools/git-repos.js +18 -0
  68. package/dist/tools/git-repos.js.map +1 -0
  69. package/dist/tools/git-reset.d.ts +121 -74
  70. package/dist/tools/git-reset.d.ts.map +1 -1
  71. package/dist/tools/git-reset.js +540 -159
  72. package/dist/tools/git-reset.js.map +1 -1
  73. package/dist/tools/git-stash.d.ts +119 -78
  74. package/dist/tools/git-stash.d.ts.map +1 -1
  75. package/dist/tools/git-stash.js +560 -209
  76. package/dist/tools/git-stash.js.map +1 -1
  77. package/dist/tools/git-sync.d.ts +3 -163
  78. package/dist/tools/git-sync.d.ts.map +1 -1
  79. package/dist/tools/git-sync.js +9 -326
  80. package/dist/tools/git-sync.js.map +1 -1
  81. package/dist/tools/git-tags.d.ts +105 -331
  82. package/dist/tools/git-tags.d.ts.map +1 -1
  83. package/dist/tools/git-tags.js +545 -416
  84. package/dist/tools/git-tags.js.map +1 -1
  85. package/dist/tools/git-workflow.d.ts +127 -0
  86. package/dist/tools/git-workflow.d.ts.map +1 -0
  87. package/dist/tools/git-workflow.js +359 -0
  88. package/dist/tools/git-workflow.js.map +1 -0
  89. package/dist/utils/auto-detection.d.ts +113 -0
  90. package/dist/utils/auto-detection.d.ts.map +1 -0
  91. package/dist/utils/auto-detection.js +235 -0
  92. package/dist/utils/auto-detection.js.map +1 -0
  93. package/dist/utils/error-handler.d.ts +107 -0
  94. package/dist/utils/error-handler.d.ts.map +1 -0
  95. package/dist/utils/error-handler.js +331 -0
  96. package/dist/utils/error-handler.js.map +1 -0
  97. package/dist/utils/git-operations.d.ts.map +1 -1
  98. package/dist/utils/git-operations.js +6 -51
  99. package/dist/utils/git-operations.js.map +1 -1
  100. package/dist/utils/user-detection.d.ts +1 -13
  101. package/dist/utils/user-detection.d.ts.map +1 -1
  102. package/dist/utils/user-detection.js +1 -26
  103. package/dist/utils/user-detection.js.map +1 -1
  104. package/package.json +60 -60
  105. package/dist/client.d.ts +0 -307
  106. package/dist/client.d.ts.map +0 -1
  107. package/dist/client.js +0 -299
  108. package/dist/client.js.map +0 -1
  109. package/dist/tools/git-branch-protection.d.ts +0 -97
  110. package/dist/tools/git-branch-protection.d.ts.map +0 -1
  111. package/dist/tools/git-branch-protection.js +0 -182
  112. package/dist/tools/git-branch-protection.js.map +0 -1
  113. package/dist/tools/git-commits.d.ts.map +0 -1
  114. package/dist/tools/git-commits.js +0 -5
  115. package/dist/tools/git-commits.js.map +0 -1
  116. package/dist/tools/git-initialize.d.ts +0 -208
  117. package/dist/tools/git-initialize.d.ts.map +0 -1
  118. package/dist/tools/git-initialize.js +0 -470
  119. package/dist/tools/git-initialize.js.map +0 -1
  120. package/dist/tools/git-projects.d.ts +0 -112
  121. package/dist/tools/git-projects.d.ts.map +0 -1
  122. package/dist/tools/git-projects.js +0 -319
  123. package/dist/tools/git-projects.js.map +0 -1
  124. package/dist/tools/git-releases.d.ts +0 -486
  125. package/dist/tools/git-releases.d.ts.map +0 -1
  126. package/dist/tools/git-releases.js +0 -561
  127. package/dist/tools/git-releases.js.map +0 -1
  128. package/dist/tools/git-repositories.d.ts +0 -469
  129. package/dist/tools/git-repositories.d.ts.map +0 -1
  130. package/dist/tools/git-repositories.js +0 -637
  131. package/dist/tools/git-repositories.js.map +0 -1
  132. package/dist/tools/git-revert.d.ts +0 -147
  133. package/dist/tools/git-revert.d.ts.map +0 -1
  134. package/dist/tools/git-revert.js +0 -199
  135. package/dist/tools/git-revert.js.map +0 -1
  136. package/dist/tools/git-update-project.d.ts +0 -309
  137. package/dist/tools/git-update-project.d.ts.map +0 -1
  138. package/dist/tools/git-update-project.js +0 -878
  139. package/dist/tools/git-update-project.js.map +0 -1
package/dist/client.js DELETED
@@ -1,299 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.giteaClient = exports.GiteaClient = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const config_js_1 = require("./config.js");
9
- const index_js_1 = require("./providers/index.js");
10
- /**
11
- * Cliente principal para API Gitea
12
- *
13
- * RESPONSABILIDADES:
14
- * - Configuração do cliente HTTP
15
- * - Gerenciamento de autenticação
16
- * - Implementação de todos os endpoints
17
- * - Tratamento de erros e respostas
18
- *
19
- * ARQUITETURA:
20
- * - Cliente Axios configurado
21
- * - Headers de autenticação automáticos
22
- * - Base URL configurável
23
- * - Timeout configurável
24
- *
25
- * RECOMENDAÇÕES:
26
- * - Use apenas uma instância por aplicação
27
- * - Configure interceptors para logging
28
- * - Trate erros de autenticação adequadamente
29
- * - Monitore uso da API
30
- */
31
- class GiteaClient {
32
- axios;
33
- baseURL;
34
- providerFactory;
35
- constructor() {
36
- // Inicializa o sistema multi-provider
37
- try {
38
- this.providerFactory = (0, index_js_1.initializeFactoryFromEnv)();
39
- // Se multi-provider funcionou, usa o provider padrão
40
- const defaultProvider = this.providerFactory.getDefaultProvider();
41
- this.axios = defaultProvider.client;
42
- this.baseURL = defaultProvider.baseUrl;
43
- }
44
- catch (error) {
45
- // Fallback para configuração legacy
46
- const cfg = config_js_1.config.getConfig();
47
- if (!cfg.giteaUrl || !cfg.giteaToken) {
48
- throw new Error('No valid VCS provider configuration found. Please configure GITEA_URL and GITEA_TOKEN, or use multi-provider configuration.');
49
- }
50
- this.baseURL = `${cfg.giteaUrl}/api/v1`;
51
- // Configuração do cliente Axios com autenticação
52
- this.axios = axios_1.default.create({
53
- baseURL: this.baseURL,
54
- timeout: cfg.timeout,
55
- headers: {
56
- 'Authorization': `token ${cfg.giteaToken}`,
57
- 'Content-Type': 'application/json',
58
- 'Accept': 'application/json',
59
- },
60
- });
61
- }
62
- // Configuração de interceptors para debug e logging
63
- // Apenas ativo quando DEBUG=true
64
- if (config_js_1.config.isDebug()) {
65
- // Interceptor para requisições - log de método e URL
66
- this.axios.interceptors.request.use((config) => {
67
- // Debug: API request
68
- return config;
69
- }, (error) => {
70
- console.error('[Gitea API] Request error:', error);
71
- return Promise.reject(error);
72
- });
73
- // Interceptor para respostas - log de status e URL
74
- this.axios.interceptors.response.use((response) => {
75
- // Debug: API response
76
- return response;
77
- }, (error) => {
78
- console.error('[Gitea API] Response error:', error.response?.status, error.response?.data);
79
- return Promise.reject(error);
80
- });
81
- }
82
- }
83
- /**
84
- * Método helper para chamadas da API
85
- *
86
- * FUNCIONALIDADE:
87
- * - Executa requisições HTTP para API Gitea
88
- * - Trata erros de forma uniforme
89
- * - Formata mensagens de erro
90
- * - Suporta todos os métodos HTTP
91
- *
92
- * PARÂMETROS:
93
- * - method: Método HTTP (GET, POST, PUT, DELETE, PATCH)
94
- * - url: Endpoint da API
95
- * - data: Dados para envio (opcional)
96
- *
97
- * TRATAMENTO DE ERROS:
98
- * - Erros HTTP: formata com status e mensagem
99
- * - Erros de rede: propaga erro original
100
- * - Timeout: captura e formata adequadamente
101
- *
102
- * RECOMENDAÇÕES:
103
- * - Use para todas as chamadas da API
104
- * - Trate erros específicos por status
105
- * - Implemente retry para erros temporários
106
- */
107
- async request(method, url, data) {
108
- try {
109
- const response = await this.axios.request({
110
- method,
111
- url,
112
- data,
113
- });
114
- return response.data;
115
- }
116
- catch (error) {
117
- if (axios_1.default.isAxiosError(error)) {
118
- const message = error.response?.data?.message || error.message;
119
- throw new Error(`Gitea API Error (${error.response?.status}): ${message}`);
120
- }
121
- throw error;
122
- }
123
- }
124
- // Repository methods
125
- async getRepositories(username, page = 1, limit = 30) {
126
- const url = username ? `/users/${username}/repos` : '/user/repos';
127
- return this.request('GET', `${url}?page=${page}&limit=${limit}`);
128
- }
129
- async getRepository(owner, repo) {
130
- return this.request('GET', `/repos/${owner}/${repo}`);
131
- }
132
- async createRepository(data) {
133
- return this.request('POST', '/user/repos', data);
134
- }
135
- async updateRepository(owner, repo, data) {
136
- return this.request('PATCH', `/repos/${owner}/${repo}`, data);
137
- }
138
- async deleteRepository(owner, repo) {
139
- await this.request('DELETE', `/repos/${owner}/${repo}`);
140
- }
141
- async forkRepository(owner, repo, organization) {
142
- const data = organization ? { organization } : {};
143
- return this.request('POST', `/repos/${owner}/${repo}/forks`, data);
144
- }
145
- async searchRepositories(query, page = 1, limit = 30) {
146
- return this.request('GET', `/repos/search?q=${encodeURIComponent(query)}&page=${page}&limit=${limit}`);
147
- }
148
- // Branch methods
149
- async getBranches(owner, repo, page = 1, limit = 30) {
150
- return this.request('GET', `/repos/${owner}/${repo}/branches?page=${page}&limit=${limit}`);
151
- }
152
- async getBranch(owner, repo, branch) {
153
- return this.request('GET', `/repos/${owner}/${repo}/branches/${branch}`);
154
- }
155
- async createBranch(owner, repo, branchName, fromBranch) {
156
- const data = { new_branch_name: branchName, old_branch_name: fromBranch };
157
- return this.request('POST', `/repos/${owner}/${repo}/branches`, data);
158
- }
159
- async deleteBranch(owner, repo, branch) {
160
- await this.request('DELETE', `/repos/${owner}/${repo}/branches/${branch}`);
161
- }
162
- // File methods
163
- async getFile(owner, repo, path, ref) {
164
- const url = `/repos/${owner}/${repo}/contents/${path}${ref ? `?ref=${ref}` : ''}`;
165
- return this.request('GET', url);
166
- }
167
- async getDirectoryContents(owner, repo, path = '', ref) {
168
- const url = `/repos/${owner}/${repo}/contents/${path}${ref ? `?ref=${ref}` : ''}`;
169
- return this.request('GET', url);
170
- }
171
- async createFile(owner, repo, path, data) {
172
- return this.request('POST', `/repos/${owner}/${repo}/contents/${path}`, data);
173
- }
174
- async updateFile(owner, repo, path, data) {
175
- return this.request('PUT', `/repos/${owner}/${repo}/contents/${path}`, data);
176
- }
177
- async deleteFile(owner, repo, path, data) {
178
- return this.request('DELETE', `/repos/${owner}/${repo}/contents/${path}`, data);
179
- }
180
- // Commit methods
181
- async getCommits(owner, repo, page = 1, limit = 30, sha) {
182
- const params = new URLSearchParams({ page: page.toString(), limit: limit.toString() });
183
- if (sha)
184
- params.append('sha', sha);
185
- return this.request('GET', `/repos/${owner}/${repo}/commits?${params}`);
186
- }
187
- async getCommit(owner, repo, sha) {
188
- return this.request('GET', `/repos/${owner}/${repo}/commits/${sha}`);
189
- }
190
- // Issue methods
191
- async getIssues(owner, repo, state = 'open', page = 1, limit = 30) {
192
- return this.request('GET', `/repos/${owner}/${repo}/issues?state=${state}&page=${page}&limit=${limit}`);
193
- }
194
- async getIssue(owner, repo, index) {
195
- return this.request('GET', `/repos/${owner}/${repo}/issues/${index}`);
196
- }
197
- async createIssue(owner, repo, data) {
198
- return this.request('POST', `/repos/${owner}/${repo}/issues`, data);
199
- }
200
- async updateIssue(owner, repo, index, data) {
201
- return this.request('PATCH', `/repos/${owner}/${repo}/issues/${index}`, data);
202
- }
203
- async createIssueComment(owner, repo, index, body) {
204
- return this.request('POST', `/repos/${owner}/${repo}/issues/${index}/comments`, { body });
205
- }
206
- // Pull Request methods
207
- async getPullRequests(owner, repo, state = 'open', page = 1, limit = 30) {
208
- return this.request('GET', `/repos/${owner}/${repo}/pulls?state=${state}&page=${page}&limit=${limit}`);
209
- }
210
- async getPullRequest(owner, repo, index) {
211
- return this.request('GET', `/repos/${owner}/${repo}/pulls/${index}`);
212
- }
213
- async createPullRequest(owner, repo, data) {
214
- return this.request('POST', `/repos/${owner}/${repo}/pulls`, data);
215
- }
216
- async updatePullRequest(owner, repo, index, data) {
217
- return this.request('PATCH', `/repos/${owner}/${repo}/pulls/${index}`, data);
218
- }
219
- async mergePullRequest(owner, repo, index, data) {
220
- return this.request('POST', `/repos/${owner}/${repo}/pulls/${index}/merge`, data);
221
- }
222
- // Release methods
223
- async getReleases(owner, repo, page = 1, limit = 30) {
224
- return this.request('GET', `/repos/${owner}/${repo}/releases?page=${page}&limit=${limit}`);
225
- }
226
- async getRelease(owner, repo, id) {
227
- return this.request('GET', `/repos/${owner}/${repo}/releases/${id}`);
228
- }
229
- async getLatestRelease(owner, repo) {
230
- return this.request('GET', `/repos/${owner}/${repo}/releases/latest`);
231
- }
232
- async createRelease(owner, repo, data) {
233
- return this.request('POST', `/repos/${owner}/${repo}/releases`, data);
234
- }
235
- async updateRelease(owner, repo, id, data) {
236
- return this.request('PATCH', `/repos/${owner}/${repo}/releases/${id}`, data);
237
- }
238
- async deleteRelease(owner, repo, id) {
239
- await this.request('DELETE', `/repos/${owner}/${repo}/releases/${id}`);
240
- }
241
- // Tag methods
242
- async getTags(owner, repo, page = 1, limit = 30) {
243
- return this.request('GET', `/repos/${owner}/${repo}/tags?page=${page}&limit=${limit}`);
244
- }
245
- async createTag(owner, repo, data) {
246
- return this.request('POST', `/repos/${owner}/${repo}/tags`, data);
247
- }
248
- async deleteTag(owner, repo, tag) {
249
- await this.request('DELETE', `/repos/${owner}/${repo}/tags/${tag}`);
250
- }
251
- // User methods
252
- async getCurrentUser() {
253
- return this.request('GET', '/user');
254
- }
255
- async getUser(username) {
256
- return this.request('GET', `/users/${username}`);
257
- }
258
- async searchUsers(query, page = 1, limit = 30) {
259
- return this.request('GET', `/users/search?q=${encodeURIComponent(query)}&page=${page}&limit=${limit}`);
260
- }
261
- async getUserOrganizations(username) {
262
- return this.request('GET', `/users/${username}/orgs`);
263
- }
264
- // Webhook methods
265
- async getWebhooks(owner, repo) {
266
- return this.request('GET', `/repos/${owner}/${repo}/hooks`);
267
- }
268
- async getWebhook(owner, repo, id) {
269
- return this.request('GET', `/repos/${owner}/${repo}/hooks/${id}`);
270
- }
271
- async createWebhook(owner, repo, data) {
272
- return this.request('POST', `/repos/${owner}/${repo}/hooks`, data);
273
- }
274
- async updateWebhook(owner, repo, id, data) {
275
- return this.request('PATCH', `/repos/${owner}/${repo}/hooks/${id}`, data);
276
- }
277
- async deleteWebhook(owner, repo, id) {
278
- await this.request('DELETE', `/repos/${owner}/${repo}/hooks/${id}`);
279
- }
280
- async testWebhook(owner, repo, id) {
281
- return this.request('POST', `/repos/${owner}/${repo}/hooks/${id}/tests`);
282
- }
283
- }
284
- exports.GiteaClient = GiteaClient;
285
- /**
286
- * Instância global do cliente Gitea
287
- *
288
- * USO:
289
- * - import { giteaClient } from './client.js';
290
- * - const repos = await giteaClient.getRepositories();
291
- *
292
- * RECOMENDAÇÕES:
293
- * - Use esta instância para todas as operações
294
- * - Não crie novas instâncias
295
- * - Configure antes de usar
296
- * - Monitore uso e performance
297
- */
298
- exports.giteaClient = new GiteaClient();
299
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA4D;AAC5D,2CAAqC;AACrC,mDAAuF;AA0MvF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,WAAW;IACd,KAAK,CAAg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C,UAAU,CAAC,KAAa,EAAE,IAAY,EAAE,EAAU;QACtD,OAAO,IAAI,CAAC,OAAO,CAAe,KAAK,EAAE,UAAU,KAAK,IAAI,IAAI,UAAU,EAAE,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,IAAY,EAAE,IAAS;QACxD,OAAO,IAAI,CAAC,OAAO,CAAe,MAAM,EAAE,UAAU,KAAK,IAAI,IAAI,QAAQ,EAAE,IAAI,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,IAAY,EAAE,EAAU,EAAE,IAAS;QACpE,OAAO,IAAI,CAAC,OAAO,CAAe,OAAO,EAAE,UAAU,KAAK,IAAI,IAAI,UAAU,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1F,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,IAAY,EAAE,EAAU;QACzD,MAAM,IAAI,CAAC,OAAO,CAAO,QAAQ,EAAE,UAAU,KAAK,IAAI,IAAI,UAAU,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAa,EAAE,IAAY,EAAE,EAAU;QACvD,OAAO,IAAI,CAAC,OAAO,CAAM,MAAM,EAAE,UAAU,KAAK,IAAI,IAAI,UAAU,EAAE,QAAQ,CAAC,CAAC;IAChF,CAAC;CACF;AArTD,kCAqTC;AAED;;;;;;;;;;;;GAYG;AACU,QAAA,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
@@ -1,97 +0,0 @@
1
- export declare const gitBranchProtection: {
2
- name: string;
3
- description: string;
4
- inputSchema: {
5
- type: string;
6
- properties: {
7
- action: {
8
- type: string;
9
- enum: string[];
10
- description: string;
11
- };
12
- repo: {
13
- type: string;
14
- description: string;
15
- };
16
- provider: {
17
- type: string;
18
- enum: string[];
19
- description: string;
20
- };
21
- projectPath: {
22
- type: string;
23
- description: string;
24
- };
25
- branch_name: {
26
- type: string;
27
- description: string;
28
- };
29
- protection: {
30
- type: string;
31
- description: string;
32
- properties: {
33
- required_status_checks: {
34
- type: string;
35
- properties: {
36
- strict: {
37
- type: string;
38
- };
39
- contexts: {
40
- type: string;
41
- items: {
42
- type: string;
43
- };
44
- };
45
- };
46
- };
47
- enforce_admins: {
48
- type: string;
49
- };
50
- required_pull_request_reviews: {
51
- type: string;
52
- properties: {
53
- required_approving_review_count: {
54
- type: string;
55
- };
56
- dismiss_stale_reviews: {
57
- type: string;
58
- };
59
- require_code_owner_reviews: {
60
- type: string;
61
- };
62
- };
63
- };
64
- restrictions: {
65
- type: string;
66
- properties: {
67
- users: {
68
- type: string;
69
- items: {
70
- type: string;
71
- };
72
- };
73
- teams: {
74
- type: string;
75
- items: {
76
- type: string;
77
- };
78
- };
79
- };
80
- };
81
- };
82
- };
83
- };
84
- required: string[];
85
- };
86
- handler(input: any): Promise<any>;
87
- listBranchProtections(provider: any, owner: string, repo: string): Promise<any>;
88
- createBranchProtection(provider: any, owner: string, repo: string, branchName: string, protection: any): Promise<any>;
89
- getBranchProtection(provider: any, owner: string, repo: string, branchName: string): Promise<any>;
90
- updateBranchProtection(provider: any, owner: string, repo: string, branchName: string, protection: any): Promise<any>;
91
- deleteBranchProtection(provider: any, owner: string, repo: string, branchName: string): Promise<any>;
92
- /**
93
- * Verifica se erro é relacionado a Git
94
- */
95
- isGitRelatedError(errorMessage: string): boolean;
96
- };
97
- //# sourceMappingURL=git-branch-protection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-branch-protection.d.ts","sourceRoot":"","sources":["../../src/tools/git-branch-protection.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA6DT,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;oCAgED,GAAG,SAAS,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;qCAU9C,GAAG,SAAS,MAAM,QAAQ,MAAM,cAAc,MAAM,cAAc,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;kCAUvF,GAAG,SAAS,MAAM,QAAQ,MAAM,cAAc,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;qCAUhE,GAAG,SAAS,MAAM,QAAQ,MAAM,cAAc,MAAM,cAAc,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;qCAUpF,GAAG,SAAS,MAAM,QAAQ,MAAM,cAAc,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAU1G;;OAEG;oCAC6B,MAAM,GAAG,OAAO;CAWjD,CAAC"}
@@ -1,182 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gitBranchProtection = void 0;
4
- const index_js_1 = require("../providers/index.js");
5
- exports.gitBranchProtection = {
6
- name: 'git-branch-protection',
7
- description: 'Gerencia proteções de branches em repositórios Git',
8
- inputSchema: {
9
- type: 'object',
10
- properties: {
11
- action: {
12
- type: 'string',
13
- enum: ['list', 'create', 'get', 'update', 'delete'],
14
- description: 'Ação a executar'
15
- },
16
- repo: {
17
- type: 'string',
18
- description: 'Nome do repositório'
19
- },
20
- provider: {
21
- type: 'string',
22
- enum: ['gitea', 'github'],
23
- description: 'Provedor VCS'
24
- },
25
- projectPath: {
26
- type: 'string',
27
- description: 'Caminho do projeto local'
28
- },
29
- branch_name: {
30
- type: 'string',
31
- description: 'Nome da branch para proteger'
32
- },
33
- protection: {
34
- type: 'object',
35
- description: 'Configurações de proteção',
36
- properties: {
37
- required_status_checks: {
38
- type: 'object',
39
- properties: {
40
- strict: { type: 'boolean' },
41
- contexts: { type: 'array', items: { type: 'string' } }
42
- }
43
- },
44
- enforce_admins: { type: 'boolean' },
45
- required_pull_request_reviews: {
46
- type: 'object',
47
- properties: {
48
- required_approving_review_count: { type: 'number' },
49
- dismiss_stale_reviews: { type: 'boolean' },
50
- require_code_owner_reviews: { type: 'boolean' }
51
- }
52
- },
53
- restrictions: {
54
- type: 'object',
55
- properties: {
56
- users: { type: 'array', items: { type: 'string' } },
57
- teams: { type: 'array', items: { type: 'string' } }
58
- }
59
- }
60
- }
61
- }
62
- },
63
- required: ['action', 'repo', 'provider', 'projectPath']
64
- },
65
- async handler(input) {
66
- try {
67
- const provider = index_js_1.globalProviderFactory.getProvider(input.provider);
68
- if (!provider) {
69
- throw new Error(`Provider '${input.provider}' não encontrado`);
70
- }
71
- const currentUser = await provider.getCurrentUser();
72
- const owner = currentUser.login;
73
- switch (input.action) {
74
- case 'list':
75
- return await this.listBranchProtections(provider, owner, input.repo);
76
- case 'create':
77
- if (!input.branch_name || !input.protection) {
78
- throw new Error('branch_name e protection são obrigatórios para create');
79
- }
80
- return await this.createBranchProtection(provider, owner, input.repo, input.branch_name, input.protection);
81
- case 'get':
82
- if (!input.branch_name) {
83
- throw new Error('branch_name é obrigatório para get');
84
- }
85
- return await this.getBranchProtection(provider, owner, input.repo, input.branch_name);
86
- case 'update':
87
- if (!input.branch_name || !input.protection) {
88
- throw new Error('branch_name e protection são obrigatórios para update');
89
- }
90
- return await this.updateBranchProtection(provider, owner, input.repo, input.branch_name, input.protection);
91
- case 'delete':
92
- if (!input.branch_name) {
93
- throw new Error('branch_name é obrigatório para delete');
94
- }
95
- return await this.deleteBranchProtection(provider, owner, input.repo, input.branch_name);
96
- default:
97
- throw new Error(`Ação não suportada: ${input.action}`);
98
- }
99
- }
100
- catch (error) {
101
- const errorMessage = error instanceof Error ? error.message : String(error);
102
- if (this.isGitRelatedError(errorMessage)) {
103
- return {
104
- success: false,
105
- action: input.action,
106
- message: `[${input.provider.toUpperCase()}] Erro na operação de proteção de branch`,
107
- error: errorMessage,
108
- analysis: {
109
- type: 'branch_protection_error',
110
- cause: 'Falha na operação de proteção de branch',
111
- solution: 'Verifique as permissões e configurações de proteção'
112
- }
113
- };
114
- }
115
- return {
116
- success: false,
117
- action: input.action,
118
- message: 'Erro na operação de proteção de branch',
119
- error: errorMessage
120
- };
121
- }
122
- },
123
- async listBranchProtections(provider, owner, repo) {
124
- const protections = await provider.listBranchProtections(owner, repo);
125
- return {
126
- success: true,
127
- action: 'list',
128
- message: `Proteções de branch listadas com sucesso para ${owner}/${repo}`,
129
- data: protections
130
- };
131
- },
132
- async createBranchProtection(provider, owner, repo, branchName, protection) {
133
- const result = await provider.createBranchProtection(owner, repo, branchName, protection);
134
- return {
135
- success: true,
136
- action: 'create',
137
- message: `Proteção de branch '${branchName}' criada com sucesso`,
138
- data: result
139
- };
140
- },
141
- async getBranchProtection(provider, owner, repo, branchName) {
142
- const protection = await provider.getBranchProtection(owner, repo, branchName);
143
- return {
144
- success: true,
145
- action: 'get',
146
- message: `Proteção de branch '${branchName}' obtida com sucesso`,
147
- data: protection
148
- };
149
- },
150
- async updateBranchProtection(provider, owner, repo, branchName, protection) {
151
- const result = await provider.updateBranchProtection(owner, repo, branchName, protection);
152
- return {
153
- success: true,
154
- action: 'update',
155
- message: `Proteção de branch '${branchName}' atualizada com sucesso`,
156
- data: result
157
- };
158
- },
159
- async deleteBranchProtection(provider, owner, repo, branchName) {
160
- await provider.deleteBranchProtection(owner, repo, branchName);
161
- return {
162
- success: true,
163
- action: 'delete',
164
- message: `Proteção de branch '${branchName}' removida com sucesso`,
165
- data: { branch_name: branchName, deleted: true }
166
- };
167
- },
168
- /**
169
- * Verifica se erro é relacionado a Git
170
- */
171
- isGitRelatedError(errorMessage) {
172
- const gitKeywords = [
173
- 'git', 'commit', 'push', 'pull', 'merge', 'conflict', 'branch',
174
- 'remote', 'repository', 'authentication', 'permission', 'unauthorized',
175
- 'divergent', 'non-fast-forward', 'fetch first', 'working tree',
176
- 'uncommitted', 'stash', 'rebase', 'reset', 'checkout', 'protection'
177
- ];
178
- const errorLower = errorMessage.toLowerCase();
179
- return gitKeywords.some(keyword => errorLower.includes(keyword));
180
- }
181
- };
182
- //# sourceMappingURL=git-branch-protection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-branch-protection.js","sourceRoot":"","sources":["../../src/tools/git-branch-protection.ts"],"names":[],"mappings":";;;AACA,oDAA6E;AAGhE,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,oDAAoD;IACjE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;gBACnD,WAAW,EAAE,iBAAiB;aAC/B;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;aACnC;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;gBACzB,WAAW,EAAE,cAAc;aAC5B;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;aAC5C;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2BAA2B;gBACxC,UAAU,EAAE;oBACV,sBAAsB,EAAE;wBACtB,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;yBACvD;qBACF;oBACD,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBACnC,6BAA6B,EAAE;wBAC7B,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,+BAA+B,EAAE,EAAE,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Aa,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY;SACpE,CAAC;QAEF,MAAM,UAAU,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;QAC9C,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,CAAC;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-commits.d.ts","sourceRoot":"","sources":["../../src/tools/git-commits.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;mBAAuR,GAAG;;;;;CAA0G,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commitsTool = void 0;
4
- exports.commitsTool = { name: "git-commits", description: "tool: Gerencia commits Git", inputSchema: { type: "object", properties: { action: { type: "string" }, provider: { type: "string" }, projectPath: { type: "string" } }, required: ["action", "provider", "projectPath"] }, async handler(input) { return { success: true, action: input.action, message: "Commits tool - implementação básica" }; } };
5
- //# sourceMappingURL=git-commits.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-commits.js","sourceRoot":"","sources":["../../src/tools/git-commits.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,4BAA4B,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAU,IAAI,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,wCAAwC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC"}