@andrebuzeli/git-mcp 5.0.4 → 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.
Files changed (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +143 -89
  3. package/dist/config.d.ts +72 -71
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +226 -139
  6. package/dist/config.js.map +1 -1
  7. package/dist/index.d.ts +15 -17
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +133 -128
  10. package/dist/index.js.map +1 -1
  11. package/dist/providers/base-provider.d.ts +42 -153
  12. package/dist/providers/base-provider.d.ts.map +1 -1
  13. package/dist/providers/base-provider.js +42 -302
  14. package/dist/providers/base-provider.js.map +1 -1
  15. package/dist/providers/gitea-provider.d.ts +67 -118
  16. package/dist/providers/gitea-provider.d.ts.map +1 -1
  17. package/dist/providers/gitea-provider.js +487 -1161
  18. package/dist/providers/gitea-provider.js.map +1 -1
  19. package/dist/providers/github-provider.d.ts +70 -81
  20. package/dist/providers/github-provider.d.ts.map +1 -1
  21. package/dist/providers/github-provider.js +641 -278
  22. package/dist/providers/github-provider.js.map +1 -1
  23. package/dist/providers/index.d.ts +9 -9
  24. package/dist/providers/index.d.ts.map +1 -1
  25. package/dist/providers/index.js +13 -19
  26. package/dist/providers/index.js.map +1 -1
  27. package/dist/providers/provider-factory.d.ts +29 -59
  28. package/dist/providers/provider-factory.d.ts.map +1 -1
  29. package/dist/providers/provider-factory.js +134 -265
  30. package/dist/providers/provider-factory.js.map +1 -1
  31. package/dist/providers/provider-operation-handler.d.ts +93 -0
  32. package/dist/providers/provider-operation-handler.d.ts.map +1 -0
  33. package/dist/providers/provider-operation-handler.js +280 -0
  34. package/dist/providers/provider-operation-handler.js.map +1 -0
  35. package/dist/providers/types.d.ts +201 -355
  36. package/dist/providers/types.d.ts.map +1 -1
  37. package/dist/providers/types.js +3 -2
  38. package/dist/providers/types.js.map +1 -1
  39. package/dist/server.d.ts +34 -4
  40. package/dist/server.d.ts.map +1 -1
  41. package/dist/server.js +439 -262
  42. package/dist/server.js.map +1 -1
  43. package/dist/tools/git-analytics.d.ts +239 -16
  44. package/dist/tools/git-analytics.d.ts.map +1 -1
  45. package/dist/tools/git-analytics.js +737 -25
  46. package/dist/tools/git-analytics.js.map +1 -1
  47. package/dist/tools/git-archive.d.ts +109 -15
  48. package/dist/tools/git-archive.d.ts.map +1 -1
  49. package/dist/tools/git-archive.js +462 -10
  50. package/dist/tools/git-archive.js.map +1 -1
  51. package/dist/tools/git-backup.d.ts +101 -15
  52. package/dist/tools/git-backup.d.ts.map +1 -1
  53. package/dist/tools/git-backup.js +410 -10
  54. package/dist/tools/git-backup.js.map +1 -1
  55. package/dist/tools/git-branches.d.ts +141 -15
  56. package/dist/tools/git-branches.d.ts.map +1 -1
  57. package/dist/tools/git-branches.js +466 -11
  58. package/dist/tools/git-branches.js.map +1 -1
  59. package/dist/tools/git-config.d.ts +115 -15
  60. package/dist/tools/git-config.d.ts.map +1 -1
  61. package/dist/tools/git-config.js +446 -11
  62. package/dist/tools/git-config.js.map +1 -1
  63. package/dist/tools/git-files.d.ts +179 -59
  64. package/dist/tools/git-files.d.ts.map +1 -1
  65. package/dist/tools/git-files.js +682 -222
  66. package/dist/tools/git-files.js.map +1 -1
  67. package/dist/tools/git-issues.d.ts +158 -15
  68. package/dist/tools/git-issues.d.ts.map +1 -1
  69. package/dist/tools/git-issues.js +323 -11
  70. package/dist/tools/git-issues.js.map +1 -1
  71. package/dist/tools/git-monitor.d.ts +149 -14
  72. package/dist/tools/git-monitor.d.ts.map +1 -1
  73. package/dist/tools/git-monitor.js +528 -11
  74. package/dist/tools/git-monitor.js.map +1 -1
  75. package/dist/tools/git-packages.d.ts +163 -15
  76. package/dist/tools/git-packages.d.ts.map +1 -1
  77. package/dist/tools/git-packages.js +526 -11
  78. package/dist/tools/git-packages.js.map +1 -1
  79. package/dist/tools/git-pulls.d.ts +174 -15
  80. package/dist/tools/git-pulls.d.ts.map +1 -1
  81. package/dist/tools/git-pulls.js +352 -11
  82. package/dist/tools/git-pulls.js.map +1 -1
  83. package/dist/tools/git-release.d.ts +167 -15
  84. package/dist/tools/git-release.d.ts.map +1 -1
  85. package/dist/tools/git-release.js +465 -11
  86. package/dist/tools/git-release.js.map +1 -1
  87. package/dist/tools/git-remote.d.ts +124 -15
  88. package/dist/tools/git-remote.d.ts.map +1 -1
  89. package/dist/tools/git-remote.js +539 -11
  90. package/dist/tools/git-remote.js.map +1 -1
  91. package/dist/tools/git-reset.d.ts +100 -15
  92. package/dist/tools/git-reset.d.ts.map +1 -1
  93. package/dist/tools/git-reset.js +409 -11
  94. package/dist/tools/git-reset.js.map +1 -1
  95. package/dist/tools/git-stash.d.ts +120 -15
  96. package/dist/tools/git-stash.d.ts.map +1 -1
  97. package/dist/tools/git-stash.js +503 -11
  98. package/dist/tools/git-stash.js.map +1 -1
  99. package/dist/tools/git-sync.d.ts +160 -16
  100. package/dist/tools/git-sync.d.ts.map +1 -1
  101. package/dist/tools/git-sync.js +462 -113
  102. package/dist/tools/git-sync.js.map +1 -1
  103. package/dist/tools/git-tags.d.ts +142 -15
  104. package/dist/tools/git-tags.d.ts.map +1 -1
  105. package/dist/tools/git-tags.js +471 -11
  106. package/dist/tools/git-tags.js.map +1 -1
  107. package/dist/tools/git-workflow.d.ts +151 -80
  108. package/dist/tools/git-workflow.d.ts.map +1 -1
  109. package/dist/tools/git-workflow.js +407 -912
  110. package/dist/tools/git-workflow.js.map +1 -1
  111. package/dist/utils/credential-manager.d.ts +119 -0
  112. package/dist/utils/credential-manager.d.ts.map +1 -0
  113. package/dist/utils/credential-manager.js +450 -0
  114. package/dist/utils/credential-manager.js.map +1 -0
  115. package/dist/utils/git-command-executor.d.ts +326 -0
  116. package/dist/utils/git-command-executor.d.ts.map +1 -0
  117. package/dist/utils/git-command-executor.js +877 -0
  118. package/dist/utils/git-command-executor.js.map +1 -0
  119. package/dist/utils/logger.d.ts +143 -0
  120. package/dist/utils/logger.d.ts.map +1 -0
  121. package/dist/utils/logger.js +473 -0
  122. package/dist/utils/logger.js.map +1 -0
  123. package/dist/utils/operation-error-handler.d.ts +54 -41
  124. package/dist/utils/operation-error-handler.d.ts.map +1 -1
  125. package/dist/utils/operation-error-handler.js +211 -227
  126. package/dist/utils/operation-error-handler.js.map +1 -1
  127. package/dist/utils/parameter-validator.d.ts +41 -0
  128. package/dist/utils/parameter-validator.d.ts.map +1 -0
  129. package/dist/utils/parameter-validator.js +464 -0
  130. package/dist/utils/parameter-validator.js.map +1 -0
  131. package/dist/utils/repository-detector.d.ts +128 -0
  132. package/dist/utils/repository-detector.d.ts.map +1 -0
  133. package/dist/utils/repository-detector.js +422 -0
  134. package/dist/utils/repository-detector.js.map +1 -0
  135. package/dist/utils/response-formatter.d.ts +146 -0
  136. package/dist/utils/response-formatter.d.ts.map +1 -0
  137. package/dist/utils/response-formatter.js +378 -0
  138. package/dist/utils/response-formatter.js.map +1 -0
  139. package/dist/utils/retry.d.ts +12 -0
  140. package/dist/utils/retry.d.ts.map +1 -0
  141. package/dist/utils/retry.js +28 -0
  142. package/dist/utils/retry.js.map +1 -0
  143. package/dist/utils/terminal-controller.d.ts +73 -139
  144. package/dist/utils/terminal-controller.d.ts.map +1 -1
  145. package/dist/utils/terminal-controller.js +234 -459
  146. package/dist/utils/terminal-controller.js.map +1 -1
  147. package/package.json +79 -60
  148. package/dist/providers/error-handler.d.ts +0 -51
  149. package/dist/providers/error-handler.d.ts.map +0 -1
  150. package/dist/providers/error-handler.js +0 -176
  151. package/dist/providers/error-handler.js.map +0 -1
  152. package/dist/providers/github-provider-backup.d.ts +0 -81
  153. package/dist/providers/github-provider-backup.d.ts.map +0 -1
  154. package/dist/providers/github-provider-backup.js +0 -1179
  155. package/dist/providers/github-provider-backup.js.map +0 -1
  156. package/dist/providers/github-provider-complete.d.ts +0 -1
  157. package/dist/providers/github-provider-complete.d.ts.map +0 -1
  158. package/dist/providers/github-provider-complete.js +0 -2
  159. package/dist/providers/github-provider-complete.js.map +0 -1
  160. package/dist/tools/git-init.d.ts +0 -50
  161. package/dist/tools/git-init.d.ts.map +0 -1
  162. package/dist/tools/git-init.js +0 -258
  163. package/dist/tools/git-init.js.map +0 -1
  164. package/dist/tools/git-log.d.ts +0 -67
  165. package/dist/tools/git-log.d.ts.map +0 -1
  166. package/dist/tools/git-log.js +0 -320
  167. package/dist/tools/git-log.js.map +0 -1
  168. package/dist/tools/git-status.d.ts +0 -29
  169. package/dist/tools/git-status.d.ts.map +0 -1
  170. package/dist/tools/git-status.js +0 -182
  171. package/dist/tools/git-status.js.map +0 -1
  172. package/dist/tools/git-update.d.ts +0 -34
  173. package/dist/tools/git-update.d.ts.map +0 -1
  174. package/dist/tools/git-update.js +0 -191
  175. package/dist/tools/git-update.js.map +0 -1
  176. package/dist/utils/auto-detection.d.ts +0 -120
  177. package/dist/utils/auto-detection.d.ts.map +0 -1
  178. package/dist/utils/auto-detection.js +0 -259
  179. package/dist/utils/auto-detection.js.map +0 -1
  180. package/dist/utils/configuration-error-generator.d.ts +0 -41
  181. package/dist/utils/configuration-error-generator.d.ts.map +0 -1
  182. package/dist/utils/configuration-error-generator.js +0 -168
  183. package/dist/utils/configuration-error-generator.js.map +0 -1
  184. package/dist/utils/configuration-validator.d.ts +0 -67
  185. package/dist/utils/configuration-validator.d.ts.map +0 -1
  186. package/dist/utils/configuration-validator.js +0 -257
  187. package/dist/utils/configuration-validator.js.map +0 -1
  188. package/dist/utils/error-handler.d.ts +0 -107
  189. package/dist/utils/error-handler.d.ts.map +0 -1
  190. package/dist/utils/error-handler.js +0 -331
  191. package/dist/utils/error-handler.js.map +0 -1
  192. package/dist/utils/git-operations.d.ts +0 -200
  193. package/dist/utils/git-operations.d.ts.map +0 -1
  194. package/dist/utils/git-operations.js +0 -836
  195. package/dist/utils/git-operations.js.map +0 -1
  196. package/dist/utils/multi-provider-error-handler.d.ts +0 -75
  197. package/dist/utils/multi-provider-error-handler.d.ts.map +0 -1
  198. package/dist/utils/multi-provider-error-handler.js +0 -276
  199. package/dist/utils/multi-provider-error-handler.js.map +0 -1
  200. package/dist/utils/multi-provider-operation-handler.d.ts +0 -113
  201. package/dist/utils/multi-provider-operation-handler.d.ts.map +0 -1
  202. package/dist/utils/multi-provider-operation-handler.js +0 -303
  203. package/dist/utils/multi-provider-operation-handler.js.map +0 -1
  204. package/dist/utils/provider-operation-handler.d.ts +0 -80
  205. package/dist/utils/provider-operation-handler.d.ts.map +0 -1
  206. package/dist/utils/provider-operation-handler.js +0 -201
  207. package/dist/utils/provider-operation-handler.js.map +0 -1
  208. package/dist/utils/response-helper.d.ts +0 -57
  209. package/dist/utils/response-helper.d.ts.map +0 -1
  210. package/dist/utils/response-helper.js +0 -54
  211. package/dist/utils/response-helper.js.map +0 -1
  212. package/dist/utils/user-detection.d.ts +0 -25
  213. package/dist/utils/user-detection.d.ts.map +0 -1
  214. package/dist/utils/user-detection.js +0 -54
  215. package/dist/utils/user-detection.js.map +0 -1
@@ -1,320 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gitLogTool = 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 Log Tool - Histórico de Alterações
10
- *
11
- * Fornece histórico completo de alterações no projeto:
12
- * - Log de commits com detalhes
13
- * - Histórico de alterações em arquivos específicos
14
- * - Histórico de branches
15
- * - Comparação entre commits
16
- * - Estatísticas de contribuições
17
- */
18
- const inputSchema = {
19
- type: 'object',
20
- properties: {
21
- projectPath: {
22
- type: 'string',
23
- description: 'Caminho do projeto (obrigatório)'
24
- },
25
- provider: {
26
- type: 'string',
27
- enum: ['github', 'gitea', 'both'],
28
- description: 'Provider para operações remotas (obrigatório)'
29
- },
30
- type: {
31
- type: 'string',
32
- enum: ['commits', 'file', 'branch', 'stats'],
33
- description: 'Tipo de histórico (padrão: commits)'
34
- },
35
- filePath: {
36
- type: 'string',
37
- description: 'Caminho do arquivo para histórico específico (para type=file)'
38
- },
39
- branch: {
40
- type: 'string',
41
- description: 'Branch para análise (padrão: current)'
42
- },
43
- limit: {
44
- type: 'number',
45
- description: 'Número máximo de commits (padrão: 20)'
46
- },
47
- since: {
48
- type: 'string',
49
- description: 'Data inicial (formato: YYYY-MM-DD ou "1 week ago")'
50
- },
51
- until: {
52
- type: 'string',
53
- description: 'Data final (formato: YYYY-MM-DD)'
54
- },
55
- author: {
56
- type: 'string',
57
- description: 'Filtrar por autor'
58
- },
59
- grep: {
60
- type: 'string',
61
- description: 'Buscar por mensagem de commit'
62
- },
63
- oneline: {
64
- type: 'boolean',
65
- description: 'Formato resumido (padrão: false)'
66
- },
67
- graph: {
68
- type: 'boolean',
69
- description: 'Mostrar gráfico de branches (padrão: false)'
70
- },
71
- includeRemote: {
72
- type: 'boolean',
73
- description: 'Incluir commits remotos (padrão: true)'
74
- }
75
- },
76
- required: ['projectPath', 'provider']
77
- };
78
- exports.gitLogTool = {
79
- name: 'git-log',
80
- description: '📜 HISTÓRICO GIT - Histórico completo de commits e alterações no projeto',
81
- inputSchema,
82
- async handler(input) {
83
- try {
84
- const { projectPath, provider, type = 'commits', filePath, branch, limit = 20, since, until, author, grep, oneline = false, graph = false, includeRemote = true } = input;
85
- const detection = (0, auto_detection_js_1.autoDetect)(projectPath);
86
- // Validar provider obrigatório
87
- if (!provider) {
88
- throw new Error('Provider é obrigatório. Use: github, gitea, ou both');
89
- }
90
- // Validar provider
91
- const providerValidation = configuration_validator_js_1.ConfigurationValidator.validateProvider(provider);
92
- if (!providerValidation.valid) {
93
- return (0, auto_detection_js_1.createUniversalResponse)(false, 'log', providerValidation.error.message, detection, 'git-log', undefined, {
94
- code: providerValidation.error.code,
95
- message: providerValidation.error.message,
96
- cause: 'Invalid provider parameter',
97
- suggestion: providerValidation.error.suggestion
98
- });
99
- }
100
- // Verificar se é um repositório Git
101
- if (!(0, terminal_controller_js_1.isGitRepository)(projectPath)) {
102
- throw new Error('Diretório não é um repositório Git válido');
103
- }
104
- const logData = {
105
- type,
106
- projectPath,
107
- repoName: detection.repoName,
108
- owner: detection.owner,
109
- provider
110
- };
111
- // Construir opções do git log
112
- const logOptions = [];
113
- if (limit)
114
- logOptions.push(`--max-count=${limit}`);
115
- if (since)
116
- logOptions.push(`--since="${since}"`);
117
- if (until)
118
- logOptions.push(`--until="${until}"`);
119
- if (author)
120
- logOptions.push(`--author="${author}"`);
121
- if (grep)
122
- logOptions.push(`--grep="${grep}"`);
123
- if (oneline)
124
- logOptions.push('--oneline');
125
- if (graph)
126
- logOptions.push('--graph');
127
- if (branch)
128
- logOptions.push(branch);
129
- switch (type) {
130
- case 'commits':
131
- try {
132
- const log = await (0, terminal_controller_js_1.getGitLog)(projectPath, logOptions);
133
- const commits = parseGitLog(log, oneline);
134
- logData.commits = commits;
135
- logData.totalCommits = commits.length;
136
- logData.options = logOptions;
137
- // Estatísticas básicas
138
- if (commits.length > 0) {
139
- const authors = new Set(commits.map(c => c.author).filter(Boolean));
140
- const dateRange = {
141
- oldest: commits[commits.length - 1]?.date,
142
- newest: commits[0]?.date
143
- };
144
- logData.statistics = {
145
- totalCommits: commits.length,
146
- uniqueAuthors: authors.size,
147
- authors: Array.from(authors),
148
- dateRange
149
- };
150
- }
151
- }
152
- catch (error) {
153
- throw new Error(`Falha ao obter log de commits: ${error instanceof Error ? error.message : String(error)}`);
154
- }
155
- break;
156
- case 'file':
157
- if (!filePath) {
158
- throw new Error('filePath é obrigatório para type=file');
159
- }
160
- try {
161
- const fileLog = await (0, terminal_controller_js_1.getFileHistory)(projectPath, filePath, logOptions);
162
- const commits = parseGitLog(fileLog, oneline);
163
- logData.filePath = filePath;
164
- logData.commits = commits;
165
- logData.totalCommits = commits.length;
166
- // Estatísticas do arquivo
167
- if (commits.length > 0) {
168
- const authors = new Set(commits.map(c => c.author).filter(Boolean));
169
- logData.fileStatistics = {
170
- totalChanges: commits.length,
171
- uniqueAuthors: authors.size,
172
- authors: Array.from(authors),
173
- firstChange: commits[commits.length - 1]?.date,
174
- lastChange: commits[0]?.date
175
- };
176
- }
177
- }
178
- catch (error) {
179
- throw new Error(`Falha ao obter histórico do arquivo: ${error instanceof Error ? error.message : String(error)}`);
180
- }
181
- break;
182
- case 'branch':
183
- try {
184
- const branchLog = await (0, terminal_controller_js_1.getBranchHistory)(projectPath, branch || 'HEAD', logOptions);
185
- const commits = parseGitLog(branchLog, oneline);
186
- logData.branch = branch || 'current';
187
- logData.commits = commits;
188
- logData.totalCommits = commits.length;
189
- }
190
- catch (error) {
191
- throw new Error(`Falha ao obter histórico da branch: ${error instanceof Error ? error.message : String(error)}`);
192
- }
193
- break;
194
- case 'stats':
195
- try {
196
- // Log com estatísticas detalhadas
197
- const statsOptions = [...logOptions, '--stat', '--shortstat'];
198
- const statsLog = await (0, terminal_controller_js_1.getGitLog)(projectPath, statsOptions);
199
- logData.statsLog = statsLog;
200
- logData.analysis = analyzeGitStats(statsLog);
201
- }
202
- catch (error) {
203
- throw new Error(`Falha ao obter estatísticas: ${error instanceof Error ? error.message : String(error)}`);
204
- }
205
- break;
206
- default:
207
- throw new Error(`Tipo '${type}' não suportado. Use: commits, file, branch, stats`);
208
- }
209
- // Incluir informações remotas se solicitado
210
- if (includeRemote && provider !== 'both') {
211
- try {
212
- const providerInstance = index_js_1.globalProviderFactory.getProvider(provider);
213
- if (providerInstance && detection.owner && detection.repoName) {
214
- const remoteCommits = await providerInstance.listCommits(detection.owner, detection.repoName, branch, 1, limit);
215
- logData.remoteCommits = remoteCommits;
216
- logData.remoteTotal = remoteCommits.length;
217
- }
218
- }
219
- catch (error) {
220
- logData.remoteError = error instanceof Error ? error.message : String(error);
221
- }
222
- }
223
- const message = `Histórico ${type} obtido - ${logData.totalCommits || 0} entradas encontradas`;
224
- return (0, auto_detection_js_1.createUniversalResponse)(true, 'log', message, detection, 'git-log', logData);
225
- }
226
- catch (error) {
227
- const detection = (0, auto_detection_js_1.autoDetect)(input.projectPath || '');
228
- const errorInstance = error instanceof Error ? error : new Error(String(error));
229
- return (0, auto_detection_js_1.createUniversalResponse)(false, 'log', `Erro ao obter histórico: ${errorInstance.message}`, detection, 'git-log', undefined, {
230
- code: 'LOG_ERROR',
231
- message: errorInstance.message,
232
- cause: 'Git log operation failed'
233
- });
234
- }
235
- }
236
- };
237
- /**
238
- * Parse git log output into structured data
239
- */
240
- function parseGitLog(logOutput, oneline) {
241
- if (!logOutput.trim())
242
- return [];
243
- const commits = [];
244
- if (oneline) {
245
- // Parse oneline format: hash message
246
- const lines = logOutput.split('\n').filter(line => line.trim());
247
- for (const line of lines) {
248
- const match = line.match(/^([a-f0-9]+)\s+(.+)$/);
249
- if (match) {
250
- commits.push({
251
- hash: match[1],
252
- message: match[2],
253
- short: true
254
- });
255
- }
256
- }
257
- }
258
- else {
259
- // Parse full format
260
- const commitBlocks = logOutput.split('\ncommit ').filter(block => block.trim());
261
- for (let block of commitBlocks) {
262
- if (!block.startsWith('commit ')) {
263
- block = 'commit ' + block;
264
- }
265
- const lines = block.split('\n');
266
- const commit = {};
267
- for (let i = 0; i < lines.length; i++) {
268
- const line = lines[i].trim();
269
- if (line.startsWith('commit ')) {
270
- commit.hash = line.replace('commit ', '').trim();
271
- }
272
- else if (line.startsWith('Author: ')) {
273
- commit.author = line.replace('Author: ', '').trim();
274
- }
275
- else if (line.startsWith('Date: ')) {
276
- commit.date = line.replace('Date: ', '').trim();
277
- }
278
- else if (line && !line.startsWith(' ') && commit.hash && !commit.message) {
279
- // First non-indented line after headers is likely the message
280
- commit.message = line;
281
- }
282
- else if (line.startsWith(' ') && !commit.message) {
283
- // Indented line is commit message
284
- commit.message = line.trim();
285
- }
286
- }
287
- if (commit.hash) {
288
- commits.push(commit);
289
- }
290
- }
291
- }
292
- return commits;
293
- }
294
- /**
295
- * Analyze git stats output
296
- */
297
- function analyzeGitStats(statsOutput) {
298
- const analysis = {
299
- totalCommits: 0,
300
- totalInsertions: 0,
301
- totalDeletions: 0,
302
- filesChanged: 0
303
- };
304
- const lines = statsOutput.split('\n');
305
- for (const line of lines) {
306
- if (line.includes('files changed')) {
307
- const match = line.match(/(\d+) files? changed(?:, (\d+) insertions?\(\+\))?(?:, (\d+) deletions?\(-\))?/);
308
- if (match) {
309
- analysis.filesChanged += parseInt(match[1]) || 0;
310
- analysis.totalInsertions += parseInt(match[2]) || 0;
311
- analysis.totalDeletions += parseInt(match[3]) || 0;
312
- }
313
- }
314
- if (line.startsWith('commit ')) {
315
- analysis.totalCommits++;
316
- }
317
- }
318
- return analysis;
319
- }
320
- //# sourceMappingURL=git-log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-log.js","sourceRoot":"","sources":["../../src/tools/git-log.ts"],"names":[],"mappings":";;;AAAA,kEAAoG;AACpG,oFAA6E;AAC7E,oDAA8D;AAC9D,4EAKyC;AAEzC;;;;;;;;;GASG;AAEH,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,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,+CAA+C;SAC7D;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC;YAC5C,WAAW,EAAE,qCAAqC;SACnD;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+DAA+D;SAC7E;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;SACrD;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCA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B,CAAC;YACH,CAAC;YAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,WAAmB;IAC1C,MAAM,QAAQ,GAAQ;QACpB,YAAY,EAAE,CAAC;QACf,eAAe,EAAE,CAAC;QAClB,cAAc,EAAE,CAAC;QACjB,YAAY,EAAE,CAAC;KAChB,CAAC;IAEF,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,gFAAgF,CAAC,CAAC;YAC3G,IAAI,KAAK,EAAE,CAAC;gBACV,QAAQ,CAAC,YAAY,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBACjD,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBACpD,QAAQ,CAAC,cAAc,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,29 +0,0 @@
1
- import { UniversalResponse } from '../utils/auto-detection.js';
2
- export declare const gitStatusTool: {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: string;
7
- properties: {
8
- projectPath: {
9
- type: string;
10
- description: string;
11
- };
12
- detailed: {
13
- type: string;
14
- description: string;
15
- };
16
- showRemotes: {
17
- type: string;
18
- description: string;
19
- };
20
- showLastCommit: {
21
- type: string;
22
- description: string;
23
- };
24
- };
25
- required: string[];
26
- };
27
- handler(input: any): Promise<UniversalResponse>;
28
- };
29
- //# sourceMappingURL=git-status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-status.d.ts","sourceRoot":"","sources":["../../src/tools/git-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,iBAAiB,EAAc,MAAM,4BAA4B,CAAC;AA2CpG,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;mBAIH,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAiLtD,CAAC"}
@@ -1,182 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gitStatusTool = void 0;
4
- const auto_detection_js_1 = require("../utils/auto-detection.js");
5
- const terminal_controller_js_1 = require("../utils/terminal-controller.js");
6
- /**
7
- * Git Status Tool - Status Detalhado do Git
8
- *
9
- * Fornece informações completas sobre o status atual do repositório Git:
10
- * - Status dos arquivos (modificados, não rastreados, etc.)
11
- * - Branch atual
12
- * - Remotes configurados
13
- * - Último commit
14
- * - Informações do repositório
15
- */
16
- const inputSchema = {
17
- type: 'object',
18
- properties: {
19
- projectPath: {
20
- type: 'string',
21
- description: 'Caminho do projeto (obrigatório)'
22
- },
23
- detailed: {
24
- type: 'boolean',
25
- description: 'Mostrar informações detalhadas (padrão: true)'
26
- },
27
- showRemotes: {
28
- type: 'boolean',
29
- description: 'Mostrar informações dos remotes (padrão: true)'
30
- },
31
- showLastCommit: {
32
- type: 'boolean',
33
- description: 'Mostrar último commit (padrão: true)'
34
- }
35
- },
36
- required: ['projectPath']
37
- };
38
- exports.gitStatusTool = {
39
- name: 'git-status',
40
- description: '📊 STATUS DO GIT - Status detalhado do repositório Git atual',
41
- inputSchema,
42
- async handler(input) {
43
- try {
44
- const { projectPath, detailed = true, showRemotes = true, showLastCommit = true } = input;
45
- const detection = (0, auto_detection_js_1.autoDetect)(projectPath);
46
- // Verificar se é um repositório Git
47
- if (!(0, terminal_controller_js_1.isGitRepository)(projectPath)) {
48
- return (0, auto_detection_js_1.createUniversalResponse)(false, 'status', 'Diretório não é um repositório Git válido', detection, 'git-status', {
49
- isGitRepo: false,
50
- projectPath,
51
- suggestion: 'Use git-init para inicializar um repositório Git'
52
- });
53
- }
54
- const statusData = {
55
- isGitRepo: true,
56
- projectPath,
57
- repoName: detection.repoName,
58
- owner: detection.owner
59
- };
60
- // 1. Status básico dos arquivos
61
- try {
62
- const statusResult = await (0, terminal_controller_js_1.getGitStatus)(projectPath);
63
- const status = statusResult.output;
64
- statusData.status = status;
65
- statusData.statusClean = status.includes('nothing to commit') && status.includes('working tree clean');
66
- // Analisar o status para extrair informações
67
- const lines = status.split('\n');
68
- const modifiedFiles = [];
69
- const untrackedFiles = [];
70
- const stagedFiles = [];
71
- for (const line of lines) {
72
- if (line.includes('modified:')) {
73
- modifiedFiles.push(line.replace(/.*modified:\s*/, '').trim());
74
- }
75
- else if (line.includes('new file:')) {
76
- stagedFiles.push(line.replace(/.*new file:\s*/, '').trim());
77
- }
78
- else if (line.includes('deleted:')) {
79
- modifiedFiles.push(line.replace(/.*deleted:\s*/, '').trim());
80
- }
81
- else if (line.startsWith('\t') && !line.includes(':')) {
82
- untrackedFiles.push(line.trim());
83
- }
84
- }
85
- statusData.filesSummary = {
86
- modified: modifiedFiles.length,
87
- untracked: untrackedFiles.length,
88
- staged: stagedFiles.length,
89
- modifiedFiles: detailed ? modifiedFiles : undefined,
90
- untrackedFiles: detailed ? untrackedFiles : undefined,
91
- stagedFiles: detailed ? stagedFiles : undefined
92
- };
93
- }
94
- catch (error) {
95
- statusData.statusError = error instanceof Error ? error.message : String(error);
96
- }
97
- // 2. Branch atual
98
- try {
99
- const currentBranch = await (0, terminal_controller_js_1.getCurrentBranch)(projectPath);
100
- statusData.currentBranch = currentBranch;
101
- }
102
- catch (error) {
103
- statusData.branchError = error instanceof Error ? error.message : String(error);
104
- }
105
- // 3. Remotes (se solicitado)
106
- if (showRemotes) {
107
- try {
108
- const remotes = await (0, terminal_controller_js_1.getRemotes)(projectPath);
109
- statusData.remotes = remotes;
110
- // Analisar remotes para detectar providers
111
- const providers = [];
112
- if (remotes.includes('github.com'))
113
- providers.push('github');
114
- if (remotes.includes('gitea') || remotes.includes('forgejo'))
115
- providers.push('gitea');
116
- statusData.detectedProviders = providers;
117
- }
118
- catch (error) {
119
- statusData.remotesError = error instanceof Error ? error.message : String(error);
120
- }
121
- }
122
- // 4. Último commit (se solicitado)
123
- if (showLastCommit) {
124
- try {
125
- const lastCommit = await (0, terminal_controller_js_1.getLastCommit)(projectPath);
126
- statusData.lastCommit = lastCommit;
127
- // Extrair informações do commit
128
- const commitLines = lastCommit.split('\n');
129
- if (commitLines.length > 0) {
130
- const commitHash = commitLines[0].split(' ')[0];
131
- const commitMessage = commitLines[0].substring(commitHash.length + 1);
132
- statusData.lastCommitInfo = {
133
- hash: commitHash,
134
- message: commitMessage,
135
- full: lastCommit
136
- };
137
- }
138
- }
139
- catch (error) {
140
- statusData.lastCommitError = error instanceof Error ? error.message : String(error);
141
- }
142
- }
143
- // 5. Resumo geral
144
- const summary = [];
145
- if (statusData.statusClean) {
146
- summary.push('✅ Working tree clean');
147
- }
148
- else {
149
- if (statusData.filesSummary?.modified > 0) {
150
- summary.push(`📝 ${statusData.filesSummary.modified} modified files`);
151
- }
152
- if (statusData.filesSummary?.untracked > 0) {
153
- summary.push(`❓ ${statusData.filesSummary.untracked} untracked files`);
154
- }
155
- if (statusData.filesSummary?.staged > 0) {
156
- summary.push(`✅ ${statusData.filesSummary.staged} staged files`);
157
- }
158
- }
159
- if (statusData.currentBranch) {
160
- summary.push(`🌿 Branch: ${statusData.currentBranch}`);
161
- }
162
- if (statusData.detectedProviders?.length > 0) {
163
- summary.push(`🔗 Providers: ${statusData.detectedProviders.join(', ')}`);
164
- }
165
- statusData.summary = summary;
166
- const message = statusData.statusClean
167
- ? 'Repositório está limpo e atualizado'
168
- : `Status obtido - ${summary.join(' | ')}`;
169
- return (0, auto_detection_js_1.createUniversalResponse)(true, 'status', message, detection, 'git-status', statusData);
170
- }
171
- catch (error) {
172
- const detection = (0, auto_detection_js_1.autoDetect)(input.projectPath || '');
173
- const errorInstance = error instanceof Error ? error : new Error(String(error));
174
- return (0, auto_detection_js_1.createUniversalResponse)(false, 'status', `Erro ao obter status: ${errorInstance.message}`, detection, 'git-status', undefined, {
175
- code: 'STATUS_ERROR',
176
- message: errorInstance.message,
177
- cause: 'Git status operation failed'
178
- });
179
- }
180
- }
181
- };
182
- //# sourceMappingURL=git-status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-status.js","sourceRoot":"","sources":["../../src/tools/git-status.ts"],"names":[],"mappings":";;;AAAA,kEAAoG;AACpG,4EAMyC;AAEzC;;;;;;;;;GASG;AAEH,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kCAAkC;SAChD;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,+CAA+C;SAC7D;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,gDAAgD;SAC9D;QACD,cAAc,EAAE;YACd,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,sCAAsC;SACpD;KACF;IACD,QAAQ,EAAE,CAAC,aAAa,CAAC;CAC1B,CAAC;AAEW,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,8DAA8D;IAC3E,WAAW;IACX,KAAK,CAAC,OAAO,CAAC,KAAU;QACtB,IAAI,CAAC;YACH,MAAM,EACJ,WAAW,EACX,QAAQ,GAAG,IAAI,EACf,WAAW,GAAG,I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ACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -1,34 +0,0 @@
1
- import { UniversalResponse } from '../utils/auto-detection.js';
2
- export declare const gitUpdateTool: {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: string;
7
- properties: {
8
- projectPath: {
9
- type: string;
10
- description: string;
11
- };
12
- message: {
13
- type: string;
14
- description: string;
15
- };
16
- provider: {
17
- type: string;
18
- enum: string[];
19
- description: string;
20
- };
21
- branch: {
22
- type: string;
23
- description: string;
24
- };
25
- pullFirst: {
26
- type: string;
27
- description: string;
28
- };
29
- };
30
- required: string[];
31
- };
32
- handler(input: any): Promise<UniversalResponse>;
33
- };
34
- //# sourceMappingURL=git-update.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-update.d.ts","sourceRoot":"","sources":["../../src/tools/git-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,iBAAiB,EAAc,MAAM,4BAA4B,CAAC;AAkDpG,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAIH,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA2LtD,CAAC"}