mcp-adr-analysis-server 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +70 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tools/smart-git-push-tool.d.ts +24 -0
- package/dist/src/tools/smart-git-push-tool.d.ts.map +1 -0
- package/dist/src/tools/smart-git-push-tool.js +526 -0
- package/dist/src/tools/smart-git-push-tool.js.map +1 -0
- package/dist/src/utils/enhanced-sensitive-detector.d.ts +61 -0
- package/dist/src/utils/enhanced-sensitive-detector.d.ts.map +1 -0
- package/dist/src/utils/enhanced-sensitive-detector.js +437 -0
- package/dist/src/utils/enhanced-sensitive-detector.js.map +1 -0
- package/dist/src/utils/interactive-approval.d.ts +63 -0
- package/dist/src/utils/interactive-approval.d.ts.map +1 -0
- package/dist/src/utils/interactive-approval.js +441 -0
- package/dist/src/utils/interactive-approval.js.map +1 -0
- package/dist/src/utils/llm-artifact-detector.d.ts +76 -0
- package/dist/src/utils/llm-artifact-detector.d.ts.map +1 -0
- package/dist/src/utils/llm-artifact-detector.js +422 -0
- package/dist/src/utils/llm-artifact-detector.js.map +1 -0
- package/dist/src/utils/location-filter.d.ts +79 -0
- package/dist/src/utils/location-filter.d.ts.map +1 -0
- package/dist/src/utils/location-filter.js +327 -0
- package/dist/src/utils/location-filter.js.map +1 -0
- package/dist/src/utils/release-readiness-detector.d.ts +47 -0
- package/dist/src/utils/release-readiness-detector.d.ts.map +1 -0
- package/dist/src/utils/release-readiness-detector.js +413 -0
- package/dist/src/utils/release-readiness-detector.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location-based filtering system for smart git push
|
|
3
|
+
*
|
|
4
|
+
* Determines if files are in appropriate locations based on their type and content
|
|
5
|
+
*/
|
|
6
|
+
import { basename, dirname, extname } from 'path';
|
|
7
|
+
/**
|
|
8
|
+
* Default location rules for common development artifacts
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_LOCATION_RULES = [
|
|
11
|
+
// Debug files
|
|
12
|
+
{
|
|
13
|
+
name: 'debug-scripts',
|
|
14
|
+
description: 'Debug scripts should be in development directories',
|
|
15
|
+
filePattern: /^debug_.*\.(py|js|ts|sh|rb|go)$/,
|
|
16
|
+
contentPattern: /print\s*\(.*debug.*\)|console\.log\s*\(.*debug.*\)|logging\.debug|debugger;/i,
|
|
17
|
+
allowedPaths: ['tests/', 'test/', 'scripts/', 'tools/', 'dev/', 'debug/'],
|
|
18
|
+
blockedPaths: ['src/', 'lib/', 'app/', './'],
|
|
19
|
+
severity: 'warning',
|
|
20
|
+
category: 'development'
|
|
21
|
+
},
|
|
22
|
+
// Test files
|
|
23
|
+
{
|
|
24
|
+
name: 'test-files',
|
|
25
|
+
description: 'Test files should be in test directories',
|
|
26
|
+
filePattern: /^test_.*\.(py|js|ts|rb|go)$|.*\.test\.(js|ts|py)$|.*\.spec\.(js|ts|py)$/,
|
|
27
|
+
allowedPaths: ['tests/', 'test/', '__tests__/', 'spec/', 'specs/'],
|
|
28
|
+
blockedPaths: ['src/', 'lib/', 'app/', './'],
|
|
29
|
+
severity: 'error',
|
|
30
|
+
category: 'testing'
|
|
31
|
+
},
|
|
32
|
+
// Mock files
|
|
33
|
+
{
|
|
34
|
+
name: 'mock-data',
|
|
35
|
+
description: 'Mock data files should be in test or fixture directories',
|
|
36
|
+
filePattern: /^mock_.*\.(json|js|ts|py|yaml|yml)$/,
|
|
37
|
+
contentPattern: /mock|fixture|fake.*data|dummy.*data/i,
|
|
38
|
+
allowedPaths: ['tests/', 'test/', '__tests__/', 'fixtures/', 'mocks/', 'dev/'],
|
|
39
|
+
blockedPaths: ['src/', 'lib/', 'app/', './'],
|
|
40
|
+
severity: 'warning',
|
|
41
|
+
category: 'testing'
|
|
42
|
+
},
|
|
43
|
+
// Temporary files
|
|
44
|
+
{
|
|
45
|
+
name: 'temporary-files',
|
|
46
|
+
description: 'Temporary files should not be committed',
|
|
47
|
+
filePattern: /^temp_.*|.*\.tmp$|.*\.temp$|.*\.bak$|.*\.orig$/,
|
|
48
|
+
allowedPaths: ['tmp/', 'temp/', 'dev/'],
|
|
49
|
+
blockedPaths: ['src/', 'lib/', 'app/', 'tests/', './'],
|
|
50
|
+
severity: 'error',
|
|
51
|
+
category: 'temporary'
|
|
52
|
+
},
|
|
53
|
+
// Log files
|
|
54
|
+
{
|
|
55
|
+
name: 'log-files',
|
|
56
|
+
description: 'Log files should not be committed to main codebase',
|
|
57
|
+
filePattern: /.*\.log$|.*\.out$|.*\.err$/,
|
|
58
|
+
allowedPaths: ['logs/', 'dev/', 'examples/'],
|
|
59
|
+
blockedPaths: ['src/', 'lib/', 'app/', 'tests/', './'],
|
|
60
|
+
severity: 'error',
|
|
61
|
+
category: 'temporary'
|
|
62
|
+
},
|
|
63
|
+
// Configuration files with secrets
|
|
64
|
+
{
|
|
65
|
+
name: 'config-secrets',
|
|
66
|
+
description: 'Configuration files with secrets need careful review',
|
|
67
|
+
filePattern: /\.env$|config\..*\.(json|yaml|yml|ini)$|secrets\..*$/,
|
|
68
|
+
contentPattern: /password|secret|key|token|api.*key|private.*key/i,
|
|
69
|
+
allowedPaths: ['config/', 'configs/', 'env/', 'examples/'],
|
|
70
|
+
blockedPaths: ['./'],
|
|
71
|
+
severity: 'error',
|
|
72
|
+
category: 'security'
|
|
73
|
+
},
|
|
74
|
+
// Scripts
|
|
75
|
+
{
|
|
76
|
+
name: 'utility-scripts',
|
|
77
|
+
description: 'Utility scripts should be in scripts directory',
|
|
78
|
+
filePattern: /^util_.*\.(sh|py|js|ts|rb)$|^helper_.*\.(sh|py|js|ts|rb)$/,
|
|
79
|
+
allowedPaths: ['scripts/', 'tools/', 'bin/', 'utils/'],
|
|
80
|
+
blockedPaths: ['src/', 'lib/', 'app/', './'],
|
|
81
|
+
severity: 'info',
|
|
82
|
+
category: 'development'
|
|
83
|
+
},
|
|
84
|
+
// Experimental code
|
|
85
|
+
{
|
|
86
|
+
name: 'experimental-code',
|
|
87
|
+
description: 'Experimental code should be in development directories',
|
|
88
|
+
filePattern: /^experiment_.*|^poc_.*|^prototype_.*|^scratch_.*|^playground_.*/,
|
|
89
|
+
allowedPaths: ['experiments/', 'poc/', 'dev/', 'playground/', 'prototypes/'],
|
|
90
|
+
blockedPaths: ['src/', 'lib/', 'app/', './'],
|
|
91
|
+
severity: 'warning',
|
|
92
|
+
category: 'development'
|
|
93
|
+
},
|
|
94
|
+
// Documentation drafts
|
|
95
|
+
{
|
|
96
|
+
name: 'documentation-drafts',
|
|
97
|
+
description: 'Documentation drafts should be organized properly',
|
|
98
|
+
filePattern: /^draft_.*\.md$|^notes_.*\.md$|^todo_.*\.md$/,
|
|
99
|
+
allowedPaths: ['docs/', 'documentation/', 'dev/', 'drafts/'],
|
|
100
|
+
blockedPaths: ['src/', 'lib/', 'app/', './'],
|
|
101
|
+
severity: 'info',
|
|
102
|
+
category: 'development'
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
/**
|
|
106
|
+
* Validate file location against rules
|
|
107
|
+
*/
|
|
108
|
+
export function validateFileLocation(filePath, content, customRules = []) {
|
|
109
|
+
const fileName = basename(filePath);
|
|
110
|
+
const dirPath = dirname(filePath);
|
|
111
|
+
const allRules = [...DEFAULT_LOCATION_RULES, ...customRules];
|
|
112
|
+
// Check each rule
|
|
113
|
+
for (const rule of allRules) {
|
|
114
|
+
if (rule.filePattern.test(fileName)) {
|
|
115
|
+
// Check content pattern if specified
|
|
116
|
+
if (rule.contentPattern && content && !rule.contentPattern.test(content)) {
|
|
117
|
+
continue; // Content pattern doesn't match, skip this rule
|
|
118
|
+
}
|
|
119
|
+
// Check if current path is blocked
|
|
120
|
+
const isBlocked = rule.blockedPaths.some(blocked => dirPath.startsWith(blocked) || dirPath === blocked.replace('/', ''));
|
|
121
|
+
if (isBlocked) {
|
|
122
|
+
return {
|
|
123
|
+
isValid: false,
|
|
124
|
+
rule,
|
|
125
|
+
currentPath: dirPath,
|
|
126
|
+
suggestedPaths: rule.allowedPaths,
|
|
127
|
+
severity: rule.severity,
|
|
128
|
+
message: `${rule.description}. Currently in '${dirPath}/', should be in: ${rule.allowedPaths.join(', ')}`
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
// Check if current path is allowed
|
|
132
|
+
const isAllowed = rule.allowedPaths.some(allowed => dirPath.startsWith(allowed) || dirPath === allowed.replace('/', ''));
|
|
133
|
+
if (!isAllowed) {
|
|
134
|
+
return {
|
|
135
|
+
isValid: false,
|
|
136
|
+
rule,
|
|
137
|
+
currentPath: dirPath,
|
|
138
|
+
suggestedPaths: rule.allowedPaths,
|
|
139
|
+
severity: rule.severity,
|
|
140
|
+
message: `${rule.description}. Currently in '${dirPath}/', should be in: ${rule.allowedPaths.join(', ')}`
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
// File is in correct location
|
|
144
|
+
return {
|
|
145
|
+
isValid: true,
|
|
146
|
+
rule,
|
|
147
|
+
currentPath: dirPath,
|
|
148
|
+
suggestedPaths: [],
|
|
149
|
+
severity: 'info',
|
|
150
|
+
message: `File is correctly located in '${dirPath}/'`
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// No specific rule found, file is generally acceptable
|
|
155
|
+
return {
|
|
156
|
+
isValid: true,
|
|
157
|
+
currentPath: dirPath,
|
|
158
|
+
suggestedPaths: [],
|
|
159
|
+
severity: 'info',
|
|
160
|
+
message: 'No specific location restrictions apply'
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Get location suggestions for a file
|
|
165
|
+
*/
|
|
166
|
+
export function getLocationSuggestions(filePath, content, customRules = []) {
|
|
167
|
+
const fileName = basename(filePath);
|
|
168
|
+
const fileExt = extname(filePath);
|
|
169
|
+
const allRules = [...DEFAULT_LOCATION_RULES, ...customRules];
|
|
170
|
+
// Find matching rules
|
|
171
|
+
const matchingRules = allRules.filter(rule => {
|
|
172
|
+
const fileMatches = rule.filePattern.test(fileName);
|
|
173
|
+
const contentMatches = !rule.contentPattern || !content || rule.contentPattern.test(content);
|
|
174
|
+
return fileMatches && contentMatches;
|
|
175
|
+
});
|
|
176
|
+
if (matchingRules.length > 0) {
|
|
177
|
+
const rule = matchingRules[0]; // Use first matching rule
|
|
178
|
+
return {
|
|
179
|
+
suggestions: rule.allowedPaths,
|
|
180
|
+
reasoning: rule.description,
|
|
181
|
+
category: rule.category
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
// Generic suggestions based on file type
|
|
185
|
+
const genericSuggestions = getGenericLocationSuggestions(fileName, fileExt);
|
|
186
|
+
return {
|
|
187
|
+
suggestions: genericSuggestions,
|
|
188
|
+
reasoning: 'Based on file type and naming conventions',
|
|
189
|
+
category: 'general'
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get generic location suggestions based on file characteristics
|
|
194
|
+
*/
|
|
195
|
+
function getGenericLocationSuggestions(fileName, fileExt) {
|
|
196
|
+
const suggestions = [];
|
|
197
|
+
// Test files
|
|
198
|
+
if (fileName.includes('test') || fileName.includes('spec')) {
|
|
199
|
+
suggestions.push('tests/', 'test/', '__tests__/');
|
|
200
|
+
}
|
|
201
|
+
// Config files
|
|
202
|
+
if (fileName.includes('config') || fileName.includes('settings')) {
|
|
203
|
+
suggestions.push('config/', 'configs/', 'settings/');
|
|
204
|
+
}
|
|
205
|
+
// Documentation
|
|
206
|
+
if (['.md', '.txt', '.rst'].includes(fileExt)) {
|
|
207
|
+
suggestions.push('docs/', 'documentation/');
|
|
208
|
+
}
|
|
209
|
+
// Scripts
|
|
210
|
+
if (['.sh', '.bat', '.ps1'].includes(fileExt)) {
|
|
211
|
+
suggestions.push('scripts/', 'bin/', 'tools/');
|
|
212
|
+
}
|
|
213
|
+
// Data files
|
|
214
|
+
if (['.json', '.yaml', '.yml', '.xml', '.csv'].includes(fileExt)) {
|
|
215
|
+
suggestions.push('data/', 'fixtures/', 'config/');
|
|
216
|
+
}
|
|
217
|
+
// Default suggestions
|
|
218
|
+
if (suggestions.length === 0) {
|
|
219
|
+
suggestions.push('src/', 'lib/', 'utils/');
|
|
220
|
+
}
|
|
221
|
+
return suggestions;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Check if a file should be ignored based on common patterns
|
|
225
|
+
*/
|
|
226
|
+
export function shouldIgnoreFile(filePath) {
|
|
227
|
+
const fileName = basename(filePath);
|
|
228
|
+
// Temporary files that should definitely be ignored
|
|
229
|
+
const temporaryPatterns = [
|
|
230
|
+
{ pattern: /.*\.tmp$/, reason: 'Temporary file' },
|
|
231
|
+
{ pattern: /.*\.temp$/, reason: 'Temporary file' },
|
|
232
|
+
{ pattern: /.*\.bak$/, reason: 'Backup file' },
|
|
233
|
+
{ pattern: /.*\.orig$/, reason: 'Original file backup' },
|
|
234
|
+
{ pattern: /.*~$/, reason: 'Editor backup file' },
|
|
235
|
+
{ pattern: /^\.DS_Store$/, reason: 'macOS system file' },
|
|
236
|
+
{ pattern: /^Thumbs\.db$/, reason: 'Windows system file' },
|
|
237
|
+
{ pattern: /^\.env\.local$/, reason: 'Local environment file' },
|
|
238
|
+
{ pattern: /^\.env\.dev$/, reason: 'Development environment file' }
|
|
239
|
+
];
|
|
240
|
+
for (const { pattern, reason } of temporaryPatterns) {
|
|
241
|
+
if (pattern.test(fileName)) {
|
|
242
|
+
return {
|
|
243
|
+
shouldIgnore: true,
|
|
244
|
+
reason,
|
|
245
|
+
severity: 'error'
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// Development files that should probably be ignored
|
|
250
|
+
const developmentPatterns = [
|
|
251
|
+
{ pattern: /^debug_/, reason: 'Debug script' },
|
|
252
|
+
{ pattern: /^scratch_/, reason: 'Scratch file' },
|
|
253
|
+
{ pattern: /^playground_/, reason: 'Playground file' },
|
|
254
|
+
{ pattern: /^experiment_/, reason: 'Experimental file' },
|
|
255
|
+
{ pattern: /.*\.debug$/, reason: 'Debug file' },
|
|
256
|
+
{ pattern: /.*\.log$/, reason: 'Log file' }
|
|
257
|
+
];
|
|
258
|
+
for (const { pattern, reason } of developmentPatterns) {
|
|
259
|
+
if (pattern.test(fileName)) {
|
|
260
|
+
return {
|
|
261
|
+
shouldIgnore: true,
|
|
262
|
+
reason,
|
|
263
|
+
severity: 'warning'
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
shouldIgnore: false,
|
|
269
|
+
reason: 'File appears to be legitimate',
|
|
270
|
+
severity: 'info'
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Create a custom location rule
|
|
275
|
+
*/
|
|
276
|
+
export function createLocationRule(name, description, filePattern, allowedPaths, blockedPaths = [], severity = 'warning', category = 'development', contentPattern) {
|
|
277
|
+
return {
|
|
278
|
+
name,
|
|
279
|
+
description,
|
|
280
|
+
filePattern: new RegExp(filePattern),
|
|
281
|
+
...(contentPattern && { contentPattern: new RegExp(contentPattern, 'i') }),
|
|
282
|
+
allowedPaths,
|
|
283
|
+
blockedPaths,
|
|
284
|
+
severity,
|
|
285
|
+
category
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Load location rules from project configuration
|
|
290
|
+
*/
|
|
291
|
+
export function loadLocationRules(_projectPath) {
|
|
292
|
+
// This would load from .smartgit.json or similar configuration file
|
|
293
|
+
// For now, return default rules
|
|
294
|
+
return DEFAULT_LOCATION_RULES;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Validate multiple files at once
|
|
298
|
+
*/
|
|
299
|
+
export function validateMultipleFiles(files, customRules = []) {
|
|
300
|
+
return files.map(file => ({
|
|
301
|
+
filePath: file.path,
|
|
302
|
+
...validateFileLocation(file.path, file.content, customRules)
|
|
303
|
+
}));
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Get summary statistics for location validation
|
|
307
|
+
*/
|
|
308
|
+
export function getLocationValidationSummary(results) {
|
|
309
|
+
const summary = {
|
|
310
|
+
totalFiles: results.length,
|
|
311
|
+
validFiles: results.filter(r => r.isValid).length,
|
|
312
|
+
invalidFiles: results.filter(r => !r.isValid).length,
|
|
313
|
+
errorCount: results.filter(r => r.severity === 'error').length,
|
|
314
|
+
warningCount: results.filter(r => r.severity === 'warning').length,
|
|
315
|
+
infoCount: results.filter(r => r.severity === 'info').length,
|
|
316
|
+
categorySummary: {}
|
|
317
|
+
};
|
|
318
|
+
// Count by category
|
|
319
|
+
for (const result of results) {
|
|
320
|
+
if (result.rule) {
|
|
321
|
+
const category = result.rule.category;
|
|
322
|
+
summary.categorySummary[category] = (summary.categorySummary[category] || 0) + 1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return summary;
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=location-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-filter.js","sourceRoot":"","sources":["../../../src/utils/location-filter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAsBlD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAmB;IACpD,cAAc;IACd;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,oDAAoD;QACjE,WAAW,EAAE,iCAAiC;QAC9C,cAAc,EAAE,8EAA8E;QAC9F,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;QACzE,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC;QAC5C,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,aAAa;KACxB;IAED,aAAa;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CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,MAAM;QAC9D,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,MAAM;QAClE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,MAAM;QAC5D,eAAe,EAAE,EAA4B;KAC9C,CAAC;IAEF,oBAAoB;IACpB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release Readiness Detector for Smart Git Push
|
|
3
|
+
*
|
|
4
|
+
* Analyzes TODO.md, project state, and commit patterns to determine
|
|
5
|
+
* if a release is ready, preventing endless development cycles
|
|
6
|
+
*/
|
|
7
|
+
export interface ReleaseReadinessResult {
|
|
8
|
+
isReady: boolean;
|
|
9
|
+
score: number;
|
|
10
|
+
confidence: number;
|
|
11
|
+
blockers: ReleaseBlocker[];
|
|
12
|
+
recommendations: string[];
|
|
13
|
+
milestones: MilestoneStatus[];
|
|
14
|
+
summary: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ReleaseBlocker {
|
|
17
|
+
type: 'critical-todos' | 'incomplete-features' | 'test-failures' | 'security-issues' | 'unstable-code';
|
|
18
|
+
severity: 'error' | 'warning' | 'info';
|
|
19
|
+
message: string;
|
|
20
|
+
todoItems?: string[];
|
|
21
|
+
suggestedActions: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface MilestoneStatus {
|
|
24
|
+
name: string;
|
|
25
|
+
completed: number;
|
|
26
|
+
total: number;
|
|
27
|
+
completionRate: number;
|
|
28
|
+
criticalTodos: number;
|
|
29
|
+
blockers: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface ReleaseReadinessOptions {
|
|
32
|
+
projectPath: string;
|
|
33
|
+
todoPath?: string;
|
|
34
|
+
minCompletionRate?: number;
|
|
35
|
+
maxCriticalTodos?: number;
|
|
36
|
+
includeAnalysis?: boolean;
|
|
37
|
+
releaseType?: 'major' | 'minor' | 'patch';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Main release readiness analysis function
|
|
41
|
+
*/
|
|
42
|
+
export declare function analyzeReleaseReadiness(options: ReleaseReadinessOptions): Promise<ReleaseReadinessResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Integration with existing MCP tools
|
|
45
|
+
*/
|
|
46
|
+
export declare function integrateWithMcpTools(projectPath: string, options?: Partial<ReleaseReadinessOptions>): Promise<ReleaseReadinessResult>;
|
|
47
|
+
//# sourceMappingURL=release-readiness-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-readiness-detector.d.ts","sourceRoot":"","sources":["../../../src/utils/release-readiness-detector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,gBAAgB,GAAG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