mcp-adr-analysis-server 2.0.11 → 2.0.12

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,527 @@
1
+ /**
2
+ * Smart Git Push MCP Tool - Version 2.0 (Clean)
3
+ *
4
+ * A focused git push tool that ensures security and tracks deployment readiness
5
+ *
6
+ * IMPORTANT FOR AI ASSISTANTS: This tool focuses on:
7
+ * 1. Security: Preventing credential leaks and sensitive data exposure
8
+ * 2. Repository Hygiene: Blocking irrelevant files (temp, build artifacts)
9
+ * 3. Deployment Readiness: Tracking real metrics (test failures, deploy success rate)
10
+ *
11
+ * Cache Dependencies:
12
+ * - CREATES/UPDATES: .mcp-adr-cache/deploy-history.json (deployment metrics)
13
+ * - USES: Enhanced sensitive detector for security scanning
14
+ *
15
+ * This tool does NOT:
16
+ * - Analyze architectural compliance
17
+ * - Update TODO tasks
18
+ * - Check knowledge graph intents
19
+ * - Make complex AI decisions
20
+ *
21
+ * Use this tool for safe, metric-driven git pushes.
22
+ */
23
+ import { McpAdrError } from '../types/index.js';
24
+ import { execSync } from 'child_process';
25
+ import { readFileSync, writeFileSync, existsSync, statSync, mkdirSync } from 'fs';
26
+ import { join, extname } from 'path';
27
+ import { jsonSafeFilePath, jsonSafeError, jsonSafeUserInput } from '../utils/json-safe.js';
28
+ import { validateMcpResponse } from '../utils/mcp-response-validator.js';
29
+ /**
30
+ * Main smart git push function - Security and Metrics Focused
31
+ */
32
+ async function smartGitPushV2(args) {
33
+ const { branch, message, testResults, skipSecurity = false, dryRun = false, projectPath = process.cwd(), forceUnsafe = false } = args;
34
+ try {
35
+ // Step 1: Get staged files
36
+ const stagedFiles = await getStagedFiles(projectPath);
37
+ if (stagedFiles.length === 0) {
38
+ const metricsText = await getDeploymentMetricsSummary(projectPath);
39
+ return {
40
+ content: [{
41
+ type: 'text',
42
+ text: createNoChangesResponse(metricsText)
43
+ }]
44
+ };
45
+ }
46
+ // Step 2: Security scan (unless skipped)
47
+ let securityIssues = [];
48
+ if (!skipSecurity) {
49
+ securityIssues = await scanForSecurityIssues(stagedFiles, projectPath);
50
+ }
51
+ // Step 3: Check for irrelevant files
52
+ const irrelevantFiles = await checkIrrelevantFiles(stagedFiles);
53
+ // Step 4: Check blocking conditions
54
+ const hasCriticalSecurity = securityIssues.some(issue => issue.severity === 'critical');
55
+ const hasFailedTests = testResults && !testResults.success;
56
+ const shouldBlock = (hasCriticalSecurity || hasFailedTests) && !forceUnsafe;
57
+ if (shouldBlock) {
58
+ return {
59
+ content: [{
60
+ type: 'text',
61
+ text: generateBlockedResponse(securityIssues, irrelevantFiles, testResults)
62
+ }]
63
+ };
64
+ }
65
+ // Step 5: Execute push if not dry run
66
+ if (!dryRun) {
67
+ const pushResult = await executePush(projectPath, branch, message);
68
+ // Update deployment history
69
+ await updateDeploymentHistory(projectPath, {
70
+ success: true,
71
+ ...(testResults && { testResults }),
72
+ filesChanged: stagedFiles.length
73
+ });
74
+ return {
75
+ content: [{
76
+ type: 'text',
77
+ text: generateSuccessResponse(stagedFiles, securityIssues, irrelevantFiles, testResults, pushResult, branch)
78
+ }]
79
+ };
80
+ }
81
+ else {
82
+ // Dry run response
83
+ return {
84
+ content: [{
85
+ type: 'text',
86
+ text: generateDryRunResponse(stagedFiles, securityIssues, irrelevantFiles, testResults, branch)
87
+ }]
88
+ };
89
+ }
90
+ }
91
+ catch (error) {
92
+ // Update deployment history with failure
93
+ await updateDeploymentHistory(projectPath, {
94
+ success: false,
95
+ testResults: testResults || { success: false, testsRun: 0, testsPassed: 0, testsFailed: 0 },
96
+ filesChanged: 0
97
+ });
98
+ throw new McpAdrError('Smart git push failed: ' + jsonSafeError(error), 'GIT_PUSH_ERROR');
99
+ }
100
+ }
101
+ /**
102
+ * Get staged files
103
+ */
104
+ async function getStagedFiles(projectPath) {
105
+ try {
106
+ const gitOutput = execSync('git diff --cached --name-status', {
107
+ cwd: projectPath,
108
+ encoding: 'utf8'
109
+ });
110
+ if (!gitOutput.trim()) {
111
+ return [];
112
+ }
113
+ const files = [];
114
+ const lines = gitOutput.trim().split('\n');
115
+ for (const line of lines) {
116
+ const [status, ...pathParts] = line.split('\t');
117
+ const path = pathParts.join('\t');
118
+ const fullPath = join(projectPath, path);
119
+ let content;
120
+ let size = 0;
121
+ if (status !== 'D' && existsSync(fullPath)) {
122
+ try {
123
+ const stats = statSync(fullPath);
124
+ size = stats.size;
125
+ // Only read content for small text files (< 100KB)
126
+ if (size < 100 * 1024 && isTextFile(path)) {
127
+ content = readFileSync(fullPath, 'utf8');
128
+ }
129
+ }
130
+ catch (err) {
131
+ // Ignore read errors
132
+ }
133
+ }
134
+ files.push({
135
+ path,
136
+ status: mapGitStatus(status || 'M'),
137
+ content: content || '',
138
+ size
139
+ });
140
+ }
141
+ return files;
142
+ }
143
+ catch (error) {
144
+ throw new McpAdrError('Failed to get staged files: ' + jsonSafeError(error), 'GIT_STATUS_ERROR');
145
+ }
146
+ }
147
+ /**
148
+ * Scan for security issues
149
+ */
150
+ async function scanForSecurityIssues(files, _projectPath) {
151
+ const issues = [];
152
+ try {
153
+ const { analyzeSensitiveContent } = await import('../utils/enhanced-sensitive-detector.js');
154
+ for (const file of files) {
155
+ if (file.status === 'deleted' || !file.content)
156
+ continue;
157
+ const result = await analyzeSensitiveContent(file.path, file.content);
158
+ for (const match of result.matches) {
159
+ // Map to our simplified security issue format
160
+ const severity = match.pattern.severity === 'critical' ? 'critical' :
161
+ match.pattern.severity === 'high' ? 'high' : 'medium';
162
+ issues.push({
163
+ type: mapPatternToType(match.pattern.name),
164
+ severity,
165
+ file: file.path,
166
+ line: match.line,
167
+ pattern: match.pattern.name,
168
+ recommendation: getSecurityRecommendation(match.pattern.name)
169
+ });
170
+ }
171
+ }
172
+ }
173
+ catch (error) {
174
+ console.error('Security scan error:', error);
175
+ }
176
+ return issues;
177
+ }
178
+ /**
179
+ * Check for irrelevant files
180
+ */
181
+ async function checkIrrelevantFiles(files) {
182
+ const irrelevant = [];
183
+ const patterns = {
184
+ 'temp-file': /\.(tmp|temp|cache|swp|swo|swn|bak|backup)$/i,
185
+ 'build-artifact': /^(dist|build|out|target|bin|obj)\//,
186
+ 'ide-config': /^\.(vscode|idea|eclipse|sublime-|atom|brackets)\//,
187
+ 'log-file': /\.(log|logs)$/i,
188
+ 'cache-file': /^(\.(cache|npm|yarn|pnpm)|node_modules|__pycache__|\.pytest_cache)\//
189
+ };
190
+ for (const file of files) {
191
+ if (file.status === 'deleted')
192
+ continue;
193
+ for (const [reason, pattern] of Object.entries(patterns)) {
194
+ if (pattern.test(file.path)) {
195
+ irrelevant.push({
196
+ path: file.path,
197
+ reason: reason,
198
+ recommendation: getIrrelevantFileRecommendation(reason)
199
+ });
200
+ break;
201
+ }
202
+ }
203
+ // Check for large files (> 10MB)
204
+ if (file.size > 10 * 1024 * 1024) {
205
+ irrelevant.push({
206
+ path: file.path,
207
+ reason: 'build-artifact',
208
+ recommendation: 'Large file (' + Math.round(file.size / 1024 / 1024) + 'MB) - consider using Git LFS'
209
+ });
210
+ }
211
+ }
212
+ return irrelevant;
213
+ }
214
+ /**
215
+ * Update deployment history
216
+ */
217
+ async function updateDeploymentHistory(projectPath, result) {
218
+ const cacheDir = join(projectPath, '.mcp-adr-cache');
219
+ const historyFile = join(cacheDir, 'deploy-history.json');
220
+ // Ensure cache directory exists
221
+ if (!existsSync(cacheDir)) {
222
+ mkdirSync(cacheDir, { recursive: true });
223
+ }
224
+ // Load existing history
225
+ let history = {
226
+ successful: 0,
227
+ failed: 0,
228
+ testResults: {
229
+ totalTestsRun: 0,
230
+ totalTestsPassed: 0,
231
+ totalTestsFailed: 0,
232
+ averageDuration: 0,
233
+ testTypes: {}
234
+ },
235
+ successRate: 0,
236
+ testPassRate: 0
237
+ };
238
+ if (existsSync(historyFile)) {
239
+ try {
240
+ history = JSON.parse(readFileSync(historyFile, 'utf8'));
241
+ }
242
+ catch (error) {
243
+ // Ignore parse errors
244
+ }
245
+ }
246
+ // Update history
247
+ if (result.success) {
248
+ history.successful++;
249
+ history.lastDeploy = new Date().toISOString();
250
+ history.lastDeploySuccess = true;
251
+ }
252
+ else {
253
+ history.failed++;
254
+ history.lastDeploy = new Date().toISOString();
255
+ history.lastDeploySuccess = false;
256
+ }
257
+ // Update test results from AI-provided data
258
+ if (result.testResults) {
259
+ history.testResults.totalTestsRun += result.testResults.testsRun;
260
+ history.testResults.totalTestsPassed += result.testResults.testsPassed;
261
+ history.testResults.totalTestsFailed += result.testResults.testsFailed;
262
+ history.testResults.lastRun = new Date().toISOString();
263
+ history.testResults.lastRunSuccess = result.testResults.success;
264
+ // Update test types tracking
265
+ if (result.testResults.testTypes) {
266
+ for (const [testType, results] of Object.entries(result.testResults.testTypes)) {
267
+ if (!history.testResults.testTypes[testType]) {
268
+ history.testResults.testTypes[testType] = { passed: 0, failed: 0 };
269
+ }
270
+ history.testResults.testTypes[testType].passed += results.passed;
271
+ history.testResults.testTypes[testType].failed += results.failed;
272
+ }
273
+ }
274
+ // Update average duration
275
+ if (result.testResults.duration) {
276
+ const currentAvg = history.testResults.averageDuration || 0;
277
+ const totalRuns = history.successful + history.failed;
278
+ history.testResults.averageDuration =
279
+ totalRuns > 1 ? (currentAvg * (totalRuns - 1) + result.testResults.duration) / totalRuns : result.testResults.duration;
280
+ }
281
+ // Set last test suite if command provided
282
+ if (result.testResults.command) {
283
+ history.testResults.lastTestSuite = result.testResults.command;
284
+ }
285
+ }
286
+ // Calculate rates
287
+ const totalDeploys = history.successful + history.failed;
288
+ history.successRate = totalDeploys > 0 ?
289
+ Math.round((history.successful / totalDeploys) * 100) : 0;
290
+ const totalTests = history.testResults.totalTestsPassed + history.testResults.totalTestsFailed;
291
+ history.testPassRate = totalTests > 0 ?
292
+ Math.round((history.testResults.totalTestsPassed / totalTests) * 100) : 0;
293
+ // Save updated history
294
+ writeFileSync(historyFile, JSON.stringify(history, null, 2));
295
+ }
296
+ /**
297
+ * Get deployment metrics summary
298
+ */
299
+ async function getDeploymentMetricsSummary(projectPath) {
300
+ const historyFile = join(projectPath, '.mcp-adr-cache', 'deploy-history.json');
301
+ if (!existsSync(historyFile)) {
302
+ return '- No deployment history available';
303
+ }
304
+ try {
305
+ const history = JSON.parse(readFileSync(historyFile, 'utf8'));
306
+ const lines = [
307
+ '- **Deploy Success Rate**: ' + history.successRate + '% (' + history.successful + '/' + (history.successful + history.failed) + ')',
308
+ '- **Test Pass Rate**: ' + history.testPassRate + '% (' + history.testResults.totalTestsPassed + '/' + (history.testResults.totalTestsPassed + history.testResults.totalTestsFailed) + ')',
309
+ '- **Last Deploy**: ' + (history.lastDeploy ? new Date(history.lastDeploy).toLocaleString() : 'Never') + ' ' + (history.lastDeploySuccess ? '✅' : '❌'),
310
+ '- **Last Test Run**: ' + (history.testResults.lastRun ? new Date(history.testResults.lastRun).toLocaleString() : 'Never') + ' ' + (history.testResults.lastRunSuccess ? '✅' : '❌'),
311
+ '- **Total Tests Executed**: ' + history.testResults.totalTestsRun,
312
+ '- **Avg Test Duration**: ' + (history.testResults.averageDuration ? Math.round(history.testResults.averageDuration) + 's' : 'N/A')
313
+ ];
314
+ return lines.join('\n');
315
+ }
316
+ catch (error) {
317
+ return '- Error reading deployment history';
318
+ }
319
+ }
320
+ /**
321
+ * Execute git push
322
+ */
323
+ async function executePush(projectPath, branch, message) {
324
+ try {
325
+ let output = '';
326
+ if (message) {
327
+ const commitOutput = execSync('git commit -m "' + message + '"', {
328
+ cwd: projectPath,
329
+ encoding: 'utf8'
330
+ });
331
+ output += 'Commit:\n' + commitOutput + '\n\n';
332
+ }
333
+ const pushCommand = branch ? 'git push origin ' + branch : 'git push';
334
+ const pushOutput = execSync(pushCommand, {
335
+ cwd: projectPath,
336
+ encoding: 'utf8',
337
+ stdio: ['pipe', 'pipe', 'pipe']
338
+ });
339
+ output += 'Push:\n' + pushOutput;
340
+ return { output, success: true };
341
+ }
342
+ catch (error) {
343
+ throw new McpAdrError('Git push failed: ' + jsonSafeError(error), 'GIT_PUSH_FAILED');
344
+ }
345
+ }
346
+ // Helper functions
347
+ function mapGitStatus(status) {
348
+ switch (status) {
349
+ case 'A': return 'added';
350
+ case 'M': return 'modified';
351
+ case 'D': return 'deleted';
352
+ case 'R': return 'renamed';
353
+ default: return 'modified';
354
+ }
355
+ }
356
+ function isTextFile(path) {
357
+ const textExtensions = [
358
+ '.js', '.ts', '.jsx', '.tsx', '.json', '.md', '.txt', '.yml', '.yaml',
359
+ '.py', '.rb', '.java', '.cs', '.go', '.rs', '.cpp', '.c', '.h', '.hpp',
360
+ '.php', '.html', '.css', '.scss', '.sass', '.less', '.vue', '.svelte'
361
+ ];
362
+ return textExtensions.includes(extname(path).toLowerCase());
363
+ }
364
+ function mapPatternToType(patternName) {
365
+ if (patternName.includes('api') || patternName.includes('key'))
366
+ return 'api-key';
367
+ if (patternName.includes('private') || patternName.includes('rsa'))
368
+ return 'private-key';
369
+ if (patternName.includes('token'))
370
+ return 'token';
371
+ if (patternName.includes('password') || patternName.includes('pwd'))
372
+ return 'password';
373
+ return 'credential';
374
+ }
375
+ function getSecurityRecommendation(pattern) {
376
+ if (pattern.includes('api'))
377
+ return 'Move API keys to environment variables';
378
+ if (pattern.includes('private'))
379
+ return 'Never commit private keys - use key management service';
380
+ if (pattern.includes('token'))
381
+ return 'Use environment variables or secure token storage';
382
+ if (pattern.includes('password'))
383
+ return 'Never hardcode passwords - use secure credential storage';
384
+ return 'Remove sensitive data and use environment variables';
385
+ }
386
+ function getIrrelevantFileRecommendation(reason) {
387
+ switch (reason) {
388
+ case 'temp-file': return 'Add to .gitignore - temporary files should not be committed';
389
+ case 'build-artifact': return 'Add to .gitignore - build outputs should not be in source control';
390
+ case 'ide-config': return 'Add to .gitignore - IDE configurations are user-specific';
391
+ case 'log-file': return 'Add to .gitignore - log files should not be committed';
392
+ case 'cache-file': return 'Add to .gitignore - cache files are generated';
393
+ default: return 'Consider adding to .gitignore';
394
+ }
395
+ }
396
+ // Response generators
397
+ function createNoChangesResponse(metricsText) {
398
+ return '# Smart Git Push - No Changes\n\n' +
399
+ '## Status\n' +
400
+ 'No staged files found. Use git add to stage files before pushing.\n\n' +
401
+ '## Deployment Metrics\n' +
402
+ metricsText + '\n\n' +
403
+ '## Available Commands\n' +
404
+ '- git add . - Stage all changes\n' +
405
+ '- git add <file> - Stage specific file\n' +
406
+ '- git status - Check current status';
407
+ }
408
+ function generateBlockedResponse(securityIssues, _irrelevantFiles, testResults) {
409
+ let response = '# Smart Git Push - Blocked 🚫\n\n## Push Blocked Due to Critical Issues\n\n';
410
+ if (securityIssues.some(i => i.severity === 'critical')) {
411
+ const criticalIssues = securityIssues.filter(i => i.severity === 'critical').map(issue => '- **' + issue.type + '** in ' + jsonSafeFilePath(issue.file) + (issue.line ? ' (line ' + issue.line + ')' : '') + '\n' +
412
+ ' Pattern: ' + issue.pattern + '\n' +
413
+ ' Fix: ' + issue.recommendation).join('\n\n');
414
+ response += '### 🔐 Critical Security Issues Found\n' + criticalIssues + '\n\n';
415
+ }
416
+ if (testResults && !testResults.success) {
417
+ response += '### 🧪 Tests Failed\n' +
418
+ '- **Command**: ' + testResults.command + '\n' +
419
+ '- **Output**:\n' +
420
+ '-------\n' +
421
+ jsonSafeUserInput(testResults.output) + '\n' +
422
+ '-------\n\n';
423
+ }
424
+ response += '## Required Actions\n' +
425
+ '1. Fix all critical security issues\n' +
426
+ '2. Ensure all tests pass\n' +
427
+ '3. Review and fix any warnings\n\n' +
428
+ 'Use --forceUnsafe to override (NOT RECOMMENDED)';
429
+ return response;
430
+ }
431
+ function generateSuccessResponse(stagedFiles, securityIssues, irrelevantFiles, testResults, pushResult, branch) {
432
+ let response = '# Smart Git Push - Success ✅\n\n' +
433
+ '## Push Summary\n' +
434
+ '- **Branch**: ' + (branch || 'current') + '\n' +
435
+ '- **Files**: ' + stagedFiles.length + ' staged files\n' +
436
+ '- **Security Issues**: ' + securityIssues.length + ' (' + securityIssues.filter(i => i.severity === 'critical').length + ' critical)\n' +
437
+ '- **Irrelevant Files**: ' + irrelevantFiles.length + '\n' +
438
+ '- **Tests**: ' + (testResults ? (testResults.success ? '✅ Passed' : '❌ Failed') : 'Skipped') + '\n\n' +
439
+ '## Deployment Metrics Updated\n' +
440
+ getDeploymentMetricsUpdate() + '\n\n' +
441
+ '## Files Pushed\n' +
442
+ stagedFiles.map(f => '- ' + jsonSafeFilePath(f.path) + ' (' + f.status + ')').join('\n');
443
+ if (securityIssues.length > 0) {
444
+ const nonCriticalIssues = securityIssues.filter(i => i.severity !== 'critical');
445
+ if (nonCriticalIssues.length > 0) {
446
+ response += '\n\n## Security Warnings (Non-Critical)\n' +
447
+ nonCriticalIssues.map(issue => '- **' + issue.type + '** in ' + jsonSafeFilePath(issue.file) + ': ' + issue.recommendation).join('\n');
448
+ }
449
+ }
450
+ if (irrelevantFiles.length > 0) {
451
+ response += '\n\n## Irrelevant Files (Consider .gitignore)\n' +
452
+ irrelevantFiles.map(f => '- ' + jsonSafeFilePath(f.path) + ' (' + f.reason + '): ' + f.recommendation).join('\n');
453
+ }
454
+ response += '\n\n## Git Output\n' +
455
+ '-------\n' +
456
+ jsonSafeUserInput(pushResult.output) + '\n' +
457
+ '-------\n\n' +
458
+ '## Next Steps\n' +
459
+ '- Monitor CI/CD pipeline\n' +
460
+ '- Check deployment status\n' +
461
+ '- Review any warnings above';
462
+ return response;
463
+ }
464
+ function generateDryRunResponse(stagedFiles, securityIssues, irrelevantFiles, testResults, branch) {
465
+ const hasCritical = securityIssues.some(i => i.severity === 'critical');
466
+ const wouldBlock = hasCritical || (testResults && !testResults.success);
467
+ let response = '# Smart Git Push - Dry Run 🔍\n\n' +
468
+ '## Analysis Results\n' +
469
+ '- **Files to Push**: ' + stagedFiles.length + '\n' +
470
+ '- **Security Issues**: ' + securityIssues.length + ' (' + securityIssues.filter(i => i.severity === 'critical').length + ' critical)\n' +
471
+ '- **Irrelevant Files**: ' + irrelevantFiles.length + '\n' +
472
+ '- **Would Block**: ' + (wouldBlock ? '❌ Yes' : '✅ No') + '\n\n' +
473
+ '## Staged Files\n' +
474
+ stagedFiles.map(f => '- ' + jsonSafeFilePath(f.path) + ' (' + f.status + ') - ' + f.size + ' bytes').join('\n');
475
+ if (securityIssues.length > 0) {
476
+ response += '\n\n## Security Issues Found\n' +
477
+ securityIssues.map(issue => '- **' + issue.severity.toUpperCase() + '** ' + issue.type + ' in ' + jsonSafeFilePath(issue.file) + (issue.line ? ' (line ' + issue.line + ')' : '') + '\n' +
478
+ ' Fix: ' + issue.recommendation).join('\n');
479
+ }
480
+ else {
481
+ response += '\n\n## ✅ No Security Issues Found';
482
+ }
483
+ if (irrelevantFiles.length > 0) {
484
+ response += '\n\n## Irrelevant Files Detected\n' +
485
+ irrelevantFiles.map(f => '- ' + jsonSafeFilePath(f.path) + ' (' + f.reason + ')\n' +
486
+ ' ' + f.recommendation).join('\n');
487
+ }
488
+ response += '\n\n## Command to Execute\n' +
489
+ '-------\n' +
490
+ '# Run without dry run to actually push\n' +
491
+ 'git push' + (branch ? ' origin ' + branch : '') + '\n' +
492
+ '-------\n\n' +
493
+ '**Note:** This was a dry run. No files were pushed.' +
494
+ (wouldBlock ? '\n⚠️ **Warning**: This push would be BLOCKED due to critical issues.' : '');
495
+ return response;
496
+ }
497
+ function getDeploymentMetricsUpdate() {
498
+ return '- Deploy success rate updated\n' +
499
+ '- Test results recorded\n' +
500
+ '- Metrics available in .mcp-adr-cache/deploy-history.json';
501
+ }
502
+ /**
503
+ * Exported smart git push function
504
+ */
505
+ export async function smartGitPush(args) {
506
+ const result = await smartGitPushV2(args);
507
+ return validateMcpResponse(result);
508
+ }
509
+ /**
510
+ * MCP-safe wrapper
511
+ */
512
+ export async function smartGitPushMcpSafe(args) {
513
+ try {
514
+ return await smartGitPush(args);
515
+ }
516
+ catch (error) {
517
+ const errorResponse = {
518
+ content: [{
519
+ type: 'text',
520
+ text: '# Smart Git Push - Error\n\n**Error**: ' + jsonSafeError(error) + '\n\nPlease check your git configuration and try again.'
521
+ }],
522
+ isError: true
523
+ };
524
+ return validateMcpResponse(errorResponse);
525
+ }
526
+ }
527
+ //# sourceMappingURL=smart-git-push-tool-v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-git-push-tool-v2.js","sourceRoot":"","sources":["../../../src/tools/smart-git-push-tool-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAiEzE;;GAEG;AACH,KAAK,UAAU,cAAc,CAAC,IAAsB;IAClD,MAAM,EACJ,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,GAAG,KAAK,EACpB,MAAM,GAAG,KAAK,EACd,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,EAC3B,WAAW,GAAG,KAAK,EACpB,GAAG,IAAI,CAAC;IAET,IAAI,CAAC;QACH,2BAA2B;QAC3B,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;QAEtD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,WAAW,GAAG,MAAM,2BAA2B,CAAC,WAAW,CAAC,CAAC;YACnE,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,uBAAuB,CAAC,WAAW,CAAC;qBAC3C,CAAC;aACH,CAAC;QACJ,CAAC;QAED,yCAAyC;QACzC,IAAI,cAAc,GAAoB,E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C,IAAI,CAAC,CAAC;IAC1C,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAsB;IAC9D,IAAI,CAAC;QACH,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,aAAa,GAAG;YACpB,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,yCAAyC,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,wDAAwD;iBAClI,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;QACF,OAAO,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC"}
@@ -1,24 +1,31 @@
1
1
  /**
2
- * Smart Git Push MCP Tool
2
+ * Smart Git Push MCP Tool - Knowledge Graph Enhanced
3
3
  *
4
- * Intelligent git push with sensitive content and LLM artifact filtering
5
- * Leverages existing content security tools and git CLI integration
4
+ * AI-powered git push with full knowledge graph integration and architectural awareness
5
+ * Leverages the complete .mcp-adr-cache system for intelligent decision making
6
6
  *
7
- * IMPORTANT FOR AI ASSISTANTS: This tool has significant side effects that happen
8
- * silently during execution. It not only performs git push operations but also:
7
+ * IMPORTANT FOR AI ASSISTANTS: This tool is deeply integrated with the knowledge graph
8
+ * and cache system. It performs comprehensive analysis before allowing pushes:
9
9
  *
10
- * Side Effects:
11
- * - Updates TODO task statuses based on file changes
12
- * - Recalculates project health scores
13
- * - Performs release readiness analysis
14
- * - Updates .mcp-adr-cache/todo-data.json
15
- * - Updates .mcp-adr-cache/project-health-scores.json
10
+ * Knowledge Graph Integration:
11
+ * - Analyzes active intents and their progress toward goals
12
+ * - Checks ADR compliance of changes being pushed
13
+ * - Verifies architectural alignment with project decisions
14
+ * - Tracks tool execution chains and their impacts
16
15
  *
17
- * Cache Dependencies:
18
- * - May require: .mcp-adr-cache/todo-data.json (for task updates)
19
- * - May require: .mcp-adr-cache/project-health-scores.json (for health scoring)
16
+ * Cache System Dependencies:
17
+ * - REQUIRES: .mcp-adr-cache/knowledge-graph-snapshots.json (for context analysis)
18
+ * - REQUIRES: .mcp-adr-cache/todo-data.json (for task dependency checking)
19
+ * - UPDATES: .mcp-adr-cache/todo-sync-state.json (after successful pushes)
20
+ * - UPDATES: .mcp-adr-cache/project-health-scores.json (continuous scoring)
20
21
  *
21
- * Use this tool when you want both git push AND project state updates.
22
+ * Architectural Intelligence:
23
+ * - Blocks pushes that violate architectural decisions
24
+ * - Ensures critical tasks are completed before deployment-related pushes
25
+ * - Validates that changes advance stated project goals
26
+ * - Provides context-aware recommendations based on project state
27
+ *
28
+ * Use this tool when you want AI-powered git push decisions based on project context.
22
29
  */
23
30
  interface SmartGitPushArgs {
24
31
  branch?: string;
@@ -31,6 +38,7 @@ interface SmartGitPushArgs {
31
38
  projectPath?: string;
32
39
  checkReleaseReadiness?: boolean;
33
40
  releaseType?: 'major' | 'minor' | 'patch';
41
+ skipKnowledgeGraphAnalysis?: boolean;
34
42
  }
35
43
  /**
36
44
  * Exported smart git push function with JSON-safe content escaping
@@ -1 +1 @@
1
- {"version":3,"file":"smart-git-push-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/smart-git-push-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAUH,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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