@entro314labs/ai-changelog-generator 3.7.0 → 3.8.0
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/bin/ai-changelog.js +5 -1
- package/package.json +13 -10
- package/src/application/orchestrators/changelog.orchestrator.js +16 -10
- package/src/application/services/application.service.js +10 -2
- package/src/domains/analysis/analysis.engine.js +25 -22
- package/src/domains/changelog/changelog.service.js +66 -8
- package/src/domains/git/git-manager.js +15 -7
- package/src/domains/git/git.service.js +36 -13
- package/src/infrastructure/cli/cli.controller.js +61 -42
- package/src/infrastructure/config/configuration.manager.js +6 -4
- package/src/infrastructure/interactive/interactive-workflow.service.js +119 -12
- package/src/infrastructure/mcp/mcp-server.service.js +13 -10
- package/src/infrastructure/providers/core/base-provider.js +2 -1
- package/src/infrastructure/providers/utils/model-config.js +3 -1
- package/src/infrastructure/validation/commit-message-validation.service.js +1 -1
- package/src/shared/constants/colors.js +2 -1
- package/src/shared/utils/cli-entry-utils.js +3 -1
- package/src/shared/utils/cli-ui.js +17 -14
- package/src/shared/utils/diff-processor.js +3 -13
- package/src/shared/utils/json-utils.js +6 -2
- package/src/shared/utils/utils.js +16 -10
|
@@ -288,9 +288,13 @@ export class JsonUtils {
|
|
|
288
288
|
if (typeof obj === 'string') {
|
|
289
289
|
strings.push(obj)
|
|
290
290
|
} else if (Array.isArray(obj)) {
|
|
291
|
-
obj.forEach((item) =>
|
|
291
|
+
obj.forEach((item) => {
|
|
292
|
+
JsonUtils.extractStrings(item, strings)
|
|
293
|
+
})
|
|
292
294
|
} else if (obj && typeof obj === 'object') {
|
|
293
|
-
Object.values(obj).forEach((value) =>
|
|
295
|
+
Object.values(obj).forEach((value) => {
|
|
296
|
+
JsonUtils.extractStrings(value, strings)
|
|
297
|
+
})
|
|
294
298
|
}
|
|
295
299
|
return strings
|
|
296
300
|
}
|
|
@@ -720,7 +720,9 @@ export function throttle(func, limit) {
|
|
|
720
720
|
if (!inThrottle) {
|
|
721
721
|
func.apply(this, args)
|
|
722
722
|
inThrottle = true
|
|
723
|
-
setTimeout(() =>
|
|
723
|
+
setTimeout(() => {
|
|
724
|
+
inThrottle = false
|
|
725
|
+
}, limit)
|
|
724
726
|
}
|
|
725
727
|
}
|
|
726
728
|
}
|
|
@@ -814,7 +816,9 @@ export function analyzeSemanticChanges(diff, filePath) {
|
|
|
814
816
|
const matches = [...diff.matchAll(regex)]
|
|
815
817
|
if (matches.length > 0) {
|
|
816
818
|
analysis.patterns.add(pattern)
|
|
817
|
-
matches.forEach((match) =>
|
|
819
|
+
matches.forEach((match) => {
|
|
820
|
+
analysis.codeElements.add(match[1])
|
|
821
|
+
})
|
|
818
822
|
}
|
|
819
823
|
})
|
|
820
824
|
|
|
@@ -1059,14 +1063,11 @@ export function buildEnhancedPrompt(commitAnalysis, analysisMode = 'standard') {
|
|
|
1059
1063
|
const {
|
|
1060
1064
|
subject,
|
|
1061
1065
|
files = [],
|
|
1062
|
-
semanticAnalysis
|
|
1063
|
-
diffStats = {},
|
|
1064
|
-
complexity = {},
|
|
1065
|
-
riskAssessment = {},
|
|
1066
|
+
// semanticAnalysis, diffStats, complexity, riskAssessment - unused
|
|
1066
1067
|
} = commitAnalysis
|
|
1067
1068
|
|
|
1068
1069
|
// Detect merge commits and upgrade analysis mode for better specificity
|
|
1069
|
-
const isMergeCommit = subject
|
|
1070
|
+
const isMergeCommit = subject?.toLowerCase().includes('merge')
|
|
1070
1071
|
const effectiveAnalysisMode = isMergeCommit && files.length > 10 ? 'detailed' : analysisMode
|
|
1071
1072
|
|
|
1072
1073
|
// Debug logging for merge commits (disabled)
|
|
@@ -1185,7 +1186,7 @@ Provide a JSON response with ONLY these fields (use definitive language - NO "li
|
|
|
1185
1186
|
* Validate and correct AI categorization and impact assessment based on commit characteristics
|
|
1186
1187
|
*/
|
|
1187
1188
|
export function validateCommitCategory(category, commitAnalysis) {
|
|
1188
|
-
const { files = []
|
|
1189
|
+
const { files = [] } = commitAnalysis
|
|
1189
1190
|
const fileCount = files.length
|
|
1190
1191
|
const addedFiles = files.filter((f) => f.status === 'A' || f.status === '??').length
|
|
1191
1192
|
const { insertions = 0, deletions = 0 } = diffStats
|
|
@@ -1431,9 +1432,13 @@ function extractCategoryFromText(content) {
|
|
|
1431
1432
|
*
|
|
1432
1433
|
* @returns {Array} Array of change objects with status and filePath
|
|
1433
1434
|
*/
|
|
1434
|
-
export function getWorkingDirectoryChanges() {
|
|
1435
|
+
export function getWorkingDirectoryChanges(cwd = undefined) {
|
|
1435
1436
|
try {
|
|
1436
|
-
const
|
|
1437
|
+
const execOptions = { encoding: 'utf8' }
|
|
1438
|
+
if (cwd) {
|
|
1439
|
+
execOptions.cwd = cwd
|
|
1440
|
+
}
|
|
1441
|
+
const result = execSync('git status --porcelain', execOptions)
|
|
1437
1442
|
|
|
1438
1443
|
if (!result.trim()) {
|
|
1439
1444
|
return []
|
|
@@ -1621,6 +1626,7 @@ export function summarizeFileChanges(changes) {
|
|
|
1621
1626
|
summary,
|
|
1622
1627
|
categories,
|
|
1623
1628
|
stats,
|
|
1629
|
+
totalFiles: changes.length,
|
|
1624
1630
|
languages: Array.from(languages),
|
|
1625
1631
|
}
|
|
1626
1632
|
}
|