@andrebuzeli/git-mcp 5.4.6 → 5.4.8

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.
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Git Auto Monitor Tool
3
+ *
4
+ * Automatic change tracking tool that monitors Git repositories locally and remotely.
5
+ * Generates history automatically without needing to be called manually.
6
+ * Uses Git hooks for local monitoring and webhooks/polling for remote monitoring.
7
+ *
8
+ * Operations: setup, start, stop, status, history
9
+ */
10
+ import { ToolParams } from '../utils/parameter-validator.js';
11
+ import { ToolResult } from '../utils/operation-error-handler.js';
12
+ export interface GitAutoMonitorParams extends ToolParams {
13
+ action: 'setup' | 'start' | 'stop' | 'status' | 'history';
14
+ enableLocal?: boolean;
15
+ enableRemote?: boolean;
16
+ historyPath?: string;
17
+ webhookUrl?: string;
18
+ pollInterval?: number;
19
+ since?: string;
20
+ until?: string;
21
+ author?: string;
22
+ limit?: number;
23
+ }
24
+ export interface ChangeRecord {
25
+ id: string;
26
+ timestamp: string;
27
+ type: 'local' | 'remote';
28
+ action: 'commit' | 'push' | 'pull' | 'merge' | 'branch_create' | 'branch_delete';
29
+ repository: string;
30
+ branch: string;
31
+ author: string;
32
+ files: string[];
33
+ message?: string;
34
+ hash?: string;
35
+ remoteInfo?: {
36
+ provider: 'github' | 'gitea';
37
+ repo: string;
38
+ url: string;
39
+ };
40
+ }
41
+ export interface MonitorStatus {
42
+ localMonitoring: boolean;
43
+ remoteMonitoring: boolean;
44
+ hooksInstalled: boolean;
45
+ webhookConfigured: boolean;
46
+ lastLocalCheck: string;
47
+ lastRemoteCheck: string;
48
+ totalChanges: number;
49
+ }
50
+ export declare class GitAutoMonitorTool {
51
+ private gitExecutor;
52
+ private historyFile;
53
+ private hooksDir;
54
+ private isMonitoring;
55
+ constructor();
56
+ /**
57
+ * Execute git-auto-monitor operation
58
+ */
59
+ execute(params: GitAutoMonitorParams): Promise<ToolResult>;
60
+ /**
61
+ * Setup automatic monitoring
62
+ */
63
+ private handleSetup;
64
+ /**
65
+ * Setup Git hooks for local monitoring
66
+ */
67
+ private setupGitHooks;
68
+ /**
69
+ * Setup remote monitoring
70
+ */
71
+ private setupRemoteMonitoring;
72
+ /**
73
+ * Record local change
74
+ */
75
+ recordLocalChange(action: string, repoPath: string): Promise<void>;
76
+ /**
77
+ * Start monitoring
78
+ */
79
+ private handleStart;
80
+ /**
81
+ * Stop monitoring
82
+ */
83
+ private handleStop;
84
+ /**
85
+ * Get monitoring status
86
+ */
87
+ private handleStatus;
88
+ /**
89
+ * Get change history
90
+ */
91
+ private handleHistory;
92
+ /**
93
+ * Start background monitoring for remote changes
94
+ */
95
+ private startBackgroundMonitoring;
96
+ /**
97
+ * Check for remote changes
98
+ */
99
+ private checkRemoteChanges;
100
+ /**
101
+ * Get current branch
102
+ */
103
+ private getCurrentBranch;
104
+ /**
105
+ * Get last commit info
106
+ */
107
+ private getLastCommit;
108
+ /**
109
+ * Get changed files in last commit
110
+ */
111
+ private getChangedFiles;
112
+ /**
113
+ * Load change history
114
+ */
115
+ private loadHistory;
116
+ /**
117
+ * Save change record
118
+ */
119
+ private saveRecord;
120
+ /**
121
+ * Get tool schema for MCP registration
122
+ */
123
+ static getToolSchema(): {
124
+ name: string;
125
+ description: string;
126
+ inputSchema: {
127
+ type: string;
128
+ properties: {
129
+ action: {
130
+ type: string;
131
+ enum: string[];
132
+ description: string;
133
+ };
134
+ projectPath: {
135
+ type: string;
136
+ description: string;
137
+ };
138
+ enableLocal: {
139
+ type: string;
140
+ description: string;
141
+ default: boolean;
142
+ };
143
+ enableRemote: {
144
+ type: string;
145
+ description: string;
146
+ };
147
+ webhookUrl: {
148
+ type: string;
149
+ description: string;
150
+ };
151
+ pollInterval: {
152
+ type: string;
153
+ description: string;
154
+ minimum: number;
155
+ maximum: number;
156
+ };
157
+ since: {
158
+ type: string;
159
+ description: string;
160
+ };
161
+ until: {
162
+ type: string;
163
+ description: string;
164
+ };
165
+ author: {
166
+ type: string;
167
+ description: string;
168
+ };
169
+ limit: {
170
+ type: string;
171
+ description: string;
172
+ minimum: number;
173
+ maximum: number;
174
+ };
175
+ };
176
+ required: string[];
177
+ };
178
+ };
179
+ }
180
+ //# sourceMappingURL=git-auto-monitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-auto-monitor.d.ts","sourceRoot":"","sources":["../../src/tools/git-auto-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAsB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAyB,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAKxF,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAG1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,eAAe,CAAC;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DrB"}
@@ -0,0 +1,522 @@
1
+ "use strict";
2
+ /**
3
+ * Git Auto Monitor Tool
4
+ *
5
+ * Automatic change tracking tool that monitors Git repositories locally and remotely.
6
+ * Generates history automatically without needing to be called manually.
7
+ * Uses Git hooks for local monitoring and webhooks/polling for remote monitoring.
8
+ *
9
+ * Operations: setup, start, stop, status, history
10
+ */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.GitAutoMonitorTool = void 0;
46
+ const git_command_executor_js_1 = require("../utils/git-command-executor.js");
47
+ const parameter_validator_js_1 = require("../utils/parameter-validator.js");
48
+ const operation_error_handler_js_1 = require("../utils/operation-error-handler.js");
49
+ const fs = __importStar(require("fs"));
50
+ const path = __importStar(require("path"));
51
+ class GitAutoMonitorTool {
52
+ gitExecutor;
53
+ historyFile;
54
+ hooksDir;
55
+ isMonitoring = false;
56
+ constructor() {
57
+ this.gitExecutor = new git_command_executor_js_1.GitCommandExecutor();
58
+ this.historyFile = path.join(process.cwd(), '.git-auto-monitor-history.json');
59
+ this.hooksDir = path.join(process.cwd(), '.git', 'hooks');
60
+ }
61
+ /**
62
+ * Execute git-auto-monitor operation
63
+ */
64
+ async execute(params) {
65
+ const startTime = Date.now();
66
+ try {
67
+ // Validate parameters
68
+ const validation = parameter_validator_js_1.ParameterValidator.validateToolParams('git-auto-monitor', params);
69
+ if (!validation.isValid) {
70
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Parameter validation failed: ${validation.errors.join(', ')}`, params.action, { validationErrors: validation.errors }, validation.suggestions);
71
+ }
72
+ // Route to appropriate handler
73
+ switch (params.action) {
74
+ case 'setup':
75
+ return await this.handleSetup(params, startTime);
76
+ case 'start':
77
+ return await this.handleStart(params, startTime);
78
+ case 'stop':
79
+ return await this.handleStop(params, startTime);
80
+ case 'status':
81
+ return await this.handleStatus(params, startTime);
82
+ case 'history':
83
+ return await this.handleHistory(params, startTime);
84
+ default:
85
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('UNSUPPORTED_OPERATION', `Unsupported operation: ${params.action}`, params.action, { supportedOperations: ['setup', 'start', 'stop', 'status', 'history'] }, ['Use one of the supported operations']);
86
+ }
87
+ }
88
+ catch (error) {
89
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
90
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('EXECUTION_ERROR', `Failed to execute git-auto-monitor operation: ${errorMessage}`, params.action, { error: errorMessage });
91
+ }
92
+ }
93
+ /**
94
+ * Setup automatic monitoring
95
+ */
96
+ async handleSetup(params, startTime) {
97
+ try {
98
+ const setupResults = [];
99
+ // Setup history file
100
+ if (!fs.existsSync(this.historyFile)) {
101
+ fs.writeFileSync(this.historyFile, JSON.stringify([], null, 2));
102
+ setupResults.push('Created history file');
103
+ }
104
+ // Setup local Git hooks
105
+ if (params.enableLocal !== false) {
106
+ const hooksResult = await this.setupGitHooks();
107
+ setupResults.push(...hooksResult);
108
+ }
109
+ // Setup remote monitoring
110
+ if (params.enableRemote) {
111
+ const remoteResult = await this.setupRemoteMonitoring(params);
112
+ setupResults.push(...remoteResult);
113
+ }
114
+ return {
115
+ success: true,
116
+ data: {
117
+ setupResults,
118
+ historyFile: this.historyFile,
119
+ hooksDir: this.hooksDir
120
+ },
121
+ metadata: {
122
+ operation: params.action,
123
+ executionTime: Date.now() - startTime,
124
+ timestamp: new Date().toISOString()
125
+ }
126
+ };
127
+ }
128
+ catch (error) {
129
+ const errorMessage = error instanceof Error ? error.message : 'Setup failed';
130
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('SETUP_FAILED', `Setup operation failed: ${errorMessage}`, params.action, { error: errorMessage });
131
+ }
132
+ }
133
+ /**
134
+ * Setup Git hooks for local monitoring
135
+ */
136
+ async setupGitHooks() {
137
+ const results = [];
138
+ // Ensure hooks directory exists
139
+ if (!fs.existsSync(this.hooksDir)) {
140
+ fs.mkdirSync(this.hooksDir, { recursive: true });
141
+ }
142
+ // Post-commit hook
143
+ const postCommitHook = path.join(this.hooksDir, 'post-commit');
144
+ const postCommitScript = `#!/bin/sh
145
+ # Git Auto Monitor - Post Commit Hook
146
+ node -e "
147
+ const { GitAutoMonitorTool } = require('${path.join(__dirname, 'git-auto-monitor.js')}');
148
+ const monitor = new GitAutoMonitorTool();
149
+ monitor.recordLocalChange('commit', process.cwd()).catch(console.error);
150
+ "
151
+ `;
152
+ fs.writeFileSync(postCommitHook, postCommitScript);
153
+ fs.chmodSync(postCommitHook, '755');
154
+ results.push('Installed post-commit hook');
155
+ // Post-merge hook
156
+ const postMergeHook = path.join(this.hooksDir, 'post-merge');
157
+ const postMergeScript = `#!/bin/sh
158
+ # Git Auto Monitor - Post Merge Hook
159
+ node -e "
160
+ const { GitAutoMonitorTool } = require('${path.join(__dirname, 'git-auto-monitor.js')}');
161
+ const monitor = new GitAutoMonitorTool();
162
+ monitor.recordLocalChange('merge', process.cwd()).catch(console.error);
163
+ "
164
+ `;
165
+ fs.writeFileSync(postMergeHook, postMergeScript);
166
+ fs.chmodSync(postMergeHook, '755');
167
+ results.push('Installed post-merge hook');
168
+ // Pre-push hook
169
+ const prePushHook = path.join(this.hooksDir, 'pre-push');
170
+ const prePushScript = `#!/bin/sh
171
+ # Git Auto Monitor - Pre Push Hook
172
+ node -e "
173
+ const { GitAutoMonitorTool } = require('${path.join(__dirname, 'git-auto-monitor.js')}');
174
+ const monitor = new GitAutoMonitorTool();
175
+ monitor.recordLocalChange('push', process.cwd()).catch(console.error);
176
+ "
177
+ `;
178
+ fs.writeFileSync(prePushHook, prePushScript);
179
+ fs.chmodSync(prePushHook, '755');
180
+ results.push('Installed pre-push hook');
181
+ return results;
182
+ }
183
+ /**
184
+ * Setup remote monitoring
185
+ */
186
+ async setupRemoteMonitoring(params) {
187
+ const results = [];
188
+ if (params.webhookUrl) {
189
+ // Setup webhook configuration
190
+ const config = {
191
+ webhookUrl: params.webhookUrl,
192
+ enabled: true,
193
+ lastCheck: new Date().toISOString()
194
+ };
195
+ fs.writeFileSync(path.join(process.cwd(), '.git-auto-monitor-webhook.json'), JSON.stringify(config, null, 2));
196
+ results.push(`Configured webhook: ${params.webhookUrl}`);
197
+ }
198
+ if (params.pollInterval) {
199
+ // Setup polling configuration
200
+ const config = {
201
+ pollInterval: params.pollInterval,
202
+ enabled: true,
203
+ lastCheck: new Date().toISOString()
204
+ };
205
+ fs.writeFileSync(path.join(process.cwd(), '.git-auto-monitor-poll.json'), JSON.stringify(config, null, 2));
206
+ results.push(`Configured polling every ${params.pollInterval} minutes`);
207
+ }
208
+ return results;
209
+ }
210
+ /**
211
+ * Record local change
212
+ */
213
+ async recordLocalChange(action, repoPath) {
214
+ try {
215
+ const branch = await this.getCurrentBranch(repoPath);
216
+ const lastCommit = await this.getLastCommit(repoPath);
217
+ const files = await this.getChangedFiles(repoPath);
218
+ const record = {
219
+ id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
220
+ timestamp: new Date().toISOString(),
221
+ type: 'local',
222
+ action: action,
223
+ repository: path.basename(repoPath),
224
+ branch: branch || 'unknown',
225
+ author: lastCommit?.author || 'unknown',
226
+ files: files,
227
+ message: lastCommit?.message,
228
+ hash: lastCommit?.hash
229
+ };
230
+ this.saveRecord(record);
231
+ }
232
+ catch (error) {
233
+ console.error('Failed to record local change:', error);
234
+ }
235
+ }
236
+ /**
237
+ * Start monitoring
238
+ */
239
+ async handleStart(params, startTime) {
240
+ try {
241
+ this.isMonitoring = true;
242
+ // Start background monitoring
243
+ this.startBackgroundMonitoring();
244
+ return {
245
+ success: true,
246
+ data: {
247
+ monitoring: true,
248
+ message: 'Auto monitoring started'
249
+ },
250
+ metadata: {
251
+ operation: params.action,
252
+ executionTime: Date.now() - startTime,
253
+ timestamp: new Date().toISOString()
254
+ }
255
+ };
256
+ }
257
+ catch (error) {
258
+ const errorMessage = error instanceof Error ? error.message : 'Start failed';
259
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('START_FAILED', `Start operation failed: ${errorMessage}`, params.action, { error: errorMessage });
260
+ }
261
+ }
262
+ /**
263
+ * Stop monitoring
264
+ */
265
+ async handleStop(params, startTime) {
266
+ try {
267
+ this.isMonitoring = false;
268
+ return {
269
+ success: true,
270
+ data: {
271
+ monitoring: false,
272
+ message: 'Auto monitoring stopped'
273
+ },
274
+ metadata: {
275
+ operation: params.action,
276
+ executionTime: Date.now() - startTime,
277
+ timestamp: new Date().toISOString()
278
+ }
279
+ };
280
+ }
281
+ catch (error) {
282
+ const errorMessage = error instanceof Error ? error.message : 'Stop failed';
283
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('STOP_FAILED', `Stop operation failed: ${errorMessage}`, params.action, { error: errorMessage });
284
+ }
285
+ }
286
+ /**
287
+ * Get monitoring status
288
+ */
289
+ async handleStatus(params, startTime) {
290
+ try {
291
+ const history = this.loadHistory();
292
+ const hooksInstalled = fs.existsSync(path.join(this.hooksDir, 'post-commit'));
293
+ const webhookConfigured = fs.existsSync(path.join(process.cwd(), '.git-auto-monitor-webhook.json'));
294
+ const status = {
295
+ localMonitoring: this.isMonitoring,
296
+ remoteMonitoring: this.isMonitoring,
297
+ hooksInstalled,
298
+ webhookConfigured,
299
+ lastLocalCheck: new Date().toISOString(),
300
+ lastRemoteCheck: new Date().toISOString(),
301
+ totalChanges: history.length
302
+ };
303
+ return {
304
+ success: true,
305
+ data: { status },
306
+ metadata: {
307
+ operation: params.action,
308
+ executionTime: Date.now() - startTime,
309
+ timestamp: new Date().toISOString()
310
+ }
311
+ };
312
+ }
313
+ catch (error) {
314
+ const errorMessage = error instanceof Error ? error.message : 'Status check failed';
315
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('STATUS_FAILED', `Status operation failed: ${errorMessage}`, params.action, { error: errorMessage });
316
+ }
317
+ }
318
+ /**
319
+ * Get change history
320
+ */
321
+ async handleHistory(params, startTime) {
322
+ try {
323
+ let history = this.loadHistory();
324
+ // Apply filters
325
+ if (params.since) {
326
+ const sinceDate = new Date(params.since);
327
+ history = history.filter(record => new Date(record.timestamp) >= sinceDate);
328
+ }
329
+ if (params.until) {
330
+ const untilDate = new Date(params.until);
331
+ history = history.filter(record => new Date(record.timestamp) <= untilDate);
332
+ }
333
+ if (params.author) {
334
+ history = history.filter(record => record.author.toLowerCase().includes(params.author.toLowerCase()));
335
+ }
336
+ if (params.limit) {
337
+ history = history.slice(-params.limit);
338
+ }
339
+ return {
340
+ success: true,
341
+ data: {
342
+ history,
343
+ totalRecords: history.length
344
+ },
345
+ metadata: {
346
+ operation: params.action,
347
+ executionTime: Date.now() - startTime,
348
+ timestamp: new Date().toISOString()
349
+ }
350
+ };
351
+ }
352
+ catch (error) {
353
+ const errorMessage = error instanceof Error ? error.message : 'History retrieval failed';
354
+ return operation_error_handler_js_1.OperationErrorHandler.createToolError('HISTORY_FAILED', `History operation failed: ${errorMessage}`, params.action, { error: errorMessage });
355
+ }
356
+ }
357
+ /**
358
+ * Start background monitoring for remote changes
359
+ */
360
+ startBackgroundMonitoring() {
361
+ // Check for remote changes every 5 minutes
362
+ setInterval(async () => {
363
+ if (!this.isMonitoring)
364
+ return;
365
+ try {
366
+ await this.checkRemoteChanges();
367
+ }
368
+ catch (error) {
369
+ console.error('Background monitoring error:', error);
370
+ }
371
+ }, 5 * 60 * 1000);
372
+ }
373
+ /**
374
+ * Check for remote changes
375
+ */
376
+ async checkRemoteChanges() {
377
+ const webhookConfigPath = path.join(process.cwd(), '.git-auto-monitor-webhook.json');
378
+ if (!fs.existsSync(webhookConfigPath))
379
+ return;
380
+ const config = JSON.parse(fs.readFileSync(webhookConfigPath, 'utf8'));
381
+ if (!config.enabled)
382
+ return;
383
+ // This would integrate with GitHub/GitLab APIs to check for changes
384
+ // For now, just log that remote monitoring is active
385
+ console.log('Remote monitoring active - checking for changes...');
386
+ }
387
+ /**
388
+ * Get current branch
389
+ */
390
+ async getCurrentBranch(repoPath) {
391
+ try {
392
+ const result = await this.gitExecutor.executeGitCommand('branch', ['--show-current'], repoPath);
393
+ return result.success ? result.stdout.trim() : null;
394
+ }
395
+ catch {
396
+ return null;
397
+ }
398
+ }
399
+ /**
400
+ * Get last commit info
401
+ */
402
+ async getLastCommit(repoPath) {
403
+ try {
404
+ const result = await this.gitExecutor.executeGitCommand('log', ['-1', '--format=%H|%s|%an'], repoPath);
405
+ if (result.success && result.stdout.trim()) {
406
+ const [hash, message, author] = result.stdout.trim().split('|');
407
+ return { hash, message, author };
408
+ }
409
+ return null;
410
+ }
411
+ catch {
412
+ return null;
413
+ }
414
+ }
415
+ /**
416
+ * Get changed files in last commit
417
+ */
418
+ async getChangedFiles(repoPath) {
419
+ try {
420
+ const result = await this.gitExecutor.executeGitCommand('diff-tree', ['--no-commit-id', '--name-only', '-r', 'HEAD'], repoPath);
421
+ return result.success ? result.stdout.trim().split('\n').filter(Boolean) : [];
422
+ }
423
+ catch {
424
+ return [];
425
+ }
426
+ }
427
+ /**
428
+ * Load change history
429
+ */
430
+ loadHistory() {
431
+ try {
432
+ if (fs.existsSync(this.historyFile)) {
433
+ const data = fs.readFileSync(this.historyFile, 'utf8');
434
+ return JSON.parse(data);
435
+ }
436
+ }
437
+ catch (error) {
438
+ console.error('Failed to load history:', error);
439
+ }
440
+ return [];
441
+ }
442
+ /**
443
+ * Save change record
444
+ */
445
+ saveRecord(record) {
446
+ try {
447
+ const history = this.loadHistory();
448
+ history.push(record);
449
+ // Keep only last 10000 records
450
+ if (history.length > 10000) {
451
+ history.splice(0, history.length - 10000);
452
+ }
453
+ fs.writeFileSync(this.historyFile, JSON.stringify(history, null, 2));
454
+ }
455
+ catch (error) {
456
+ console.error('Failed to save record:', error);
457
+ }
458
+ }
459
+ /**
460
+ * Get tool schema for MCP registration
461
+ */
462
+ static getToolSchema() {
463
+ return {
464
+ name: 'git-auto-monitor',
465
+ description: 'Automatic Git change tracking tool that monitors repositories locally and remotely. Generates history automatically without manual calls. Uses Git hooks for local monitoring and webhooks/polling for remote monitoring.',
466
+ inputSchema: {
467
+ type: 'object',
468
+ properties: {
469
+ action: {
470
+ type: 'string',
471
+ enum: ['setup', 'start', 'stop', 'status', 'history'],
472
+ description: 'The auto-monitor operation to perform'
473
+ },
474
+ projectPath: {
475
+ type: 'string',
476
+ description: 'Absolute path to the project directory'
477
+ },
478
+ enableLocal: {
479
+ type: 'boolean',
480
+ description: 'Enable local Git hooks monitoring (default: true)',
481
+ default: true
482
+ },
483
+ enableRemote: {
484
+ type: 'boolean',
485
+ description: 'Enable remote webhook monitoring'
486
+ },
487
+ webhookUrl: {
488
+ type: 'string',
489
+ description: 'Webhook URL for remote change notifications'
490
+ },
491
+ pollInterval: {
492
+ type: 'number',
493
+ description: 'Polling interval in minutes for remote monitoring',
494
+ minimum: 1,
495
+ maximum: 1440
496
+ },
497
+ since: {
498
+ type: 'string',
499
+ description: 'Start date for history filtering (ISO format)'
500
+ },
501
+ until: {
502
+ type: 'string',
503
+ description: 'End date for history filtering (ISO format)'
504
+ },
505
+ author: {
506
+ type: 'string',
507
+ description: 'Filter history by author'
508
+ },
509
+ limit: {
510
+ type: 'number',
511
+ description: 'Limit number of history records',
512
+ minimum: 1,
513
+ maximum: 1000
514
+ }
515
+ },
516
+ required: ['action', 'projectPath']
517
+ }
518
+ };
519
+ }
520
+ }
521
+ exports.GitAutoMonitorTool = GitAutoMonitorTool;
522
+ //# sourceMappingURL=git-auto-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-auto-monitor.js","sourceRoot":"","sources":["../../src/tools/git-auto-monitor.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8EAAwF;AACxF,4EAAiF;AACjF,oFAAwF;AAExF,uCAAyB;AACzB,2CAA6B;AA+C7B,MAAa,kBAAkB;IACrB,WAAW,CAAqB;IAChC,WAAW,CAAS;IACpB,QAAQ,CAAS;IACjB,YAAY,GAAY,KAAK,CAAC;IAEtC;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,4CAAkB,EAAE,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gCAAgC,CAAC,CAAC;QAC9E,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,MAA4B;QACxC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC;YACH,sBAAsB;YACtB,MAAM,UAAU,GA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BACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,6CAA6C;qBAC3D;oBACD,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,mDAAmD;wBAChE,OAAO,EAAE,CAAC;wBACV,OAAO,EAAE,IAAI;qBACd;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,+CAA+C;qBAC7D;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,6CAA6C;qBAC3D;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,0BAA0B;qBACxC;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iCAAiC;wBAC9C,OAAO,EAAE,CAAC;wBACV,OAAO,EAAE,IAAI;qBACd;iBACF;gBACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;aACpC;SACF,CAAC;IACJ,CAAC;CACF;AAriBD,gDAqiBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrebuzeli/git-mcp",
3
- "version": "5.4.6",
3
+ "version": "5.4.8",
4
4
  "description": "Professional MCP server for Git operations with Universal Mode - automatic multi-provider support (GitHub + Gitea), enhanced security, and comprehensive safety features",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",