@entro314labs/ai-changelog-generator 3.1.1 → 3.2.1
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/CHANGELOG.md +412 -875
- package/README.md +8 -3
- package/ai-changelog-mcp.sh +0 -0
- package/ai-changelog.sh +0 -0
- package/bin/ai-changelog-dxt.js +9 -9
- package/bin/ai-changelog-mcp.js +19 -17
- package/bin/ai-changelog.js +6 -6
- package/package.json +80 -48
- package/src/ai-changelog-generator.js +91 -81
- package/src/application/orchestrators/changelog.orchestrator.js +791 -516
- package/src/application/services/application.service.js +137 -128
- package/src/cli.js +76 -57
- package/src/domains/ai/ai-analysis.service.js +289 -209
- package/src/domains/analysis/analysis.engine.js +328 -192
- package/src/domains/changelog/changelog.service.js +1174 -783
- package/src/domains/changelog/workspace-changelog.service.js +487 -249
- package/src/domains/git/git-repository.analyzer.js +348 -258
- package/src/domains/git/git.service.js +132 -112
- package/src/infrastructure/cli/cli.controller.js +390 -274
- package/src/infrastructure/config/configuration.manager.js +220 -190
- package/src/infrastructure/interactive/interactive-staging.service.js +154 -135
- package/src/infrastructure/interactive/interactive-workflow.service.js +200 -159
- package/src/infrastructure/mcp/mcp-server.service.js +208 -207
- package/src/infrastructure/metrics/metrics.collector.js +140 -123
- package/src/infrastructure/providers/core/base-provider.js +87 -40
- package/src/infrastructure/providers/implementations/anthropic.js +101 -99
- package/src/infrastructure/providers/implementations/azure.js +124 -101
- package/src/infrastructure/providers/implementations/bedrock.js +136 -126
- package/src/infrastructure/providers/implementations/dummy.js +23 -23
- package/src/infrastructure/providers/implementations/google.js +123 -114
- package/src/infrastructure/providers/implementations/huggingface.js +94 -87
- package/src/infrastructure/providers/implementations/lmstudio.js +75 -60
- package/src/infrastructure/providers/implementations/mock.js +69 -73
- package/src/infrastructure/providers/implementations/ollama.js +89 -66
- package/src/infrastructure/providers/implementations/openai.js +88 -89
- package/src/infrastructure/providers/implementations/vertex.js +227 -197
- package/src/infrastructure/providers/provider-management.service.js +245 -207
- package/src/infrastructure/providers/provider-manager.service.js +145 -125
- package/src/infrastructure/providers/utils/base-provider-helpers.js +308 -302
- package/src/infrastructure/providers/utils/model-config.js +220 -195
- package/src/infrastructure/providers/utils/provider-utils.js +105 -100
- package/src/infrastructure/validation/commit-message-validation.service.js +259 -161
- package/src/shared/constants/colors.js +453 -180
- package/src/shared/utils/cli-demo.js +285 -0
- package/src/shared/utils/cli-entry-utils.js +257 -249
- package/src/shared/utils/cli-ui.js +447 -0
- package/src/shared/utils/diff-processor.js +513 -0
- package/src/shared/utils/error-classes.js +125 -156
- package/src/shared/utils/json-utils.js +93 -89
- package/src/shared/utils/utils.js +1117 -945
- package/types/index.d.ts +353 -344
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { ApplicationService } from './application/services/application.service.js'
|
|
4
|
-
import colors from './shared/constants/colors.js'
|
|
3
|
+
import { ApplicationService } from './application/services/application.service.js'
|
|
4
|
+
import colors from './shared/constants/colors.js'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* AI Changelog Generator - Main Facade Class
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Provides the primary interface for changelog generation functionality
|
|
10
10
|
* by delegating to domain services through the ApplicationService layer.
|
|
11
|
-
*
|
|
11
|
+
*
|
|
12
12
|
* Features:
|
|
13
13
|
* - Automatic changelog generation from git commits
|
|
14
14
|
* - Working directory change analysis
|
|
@@ -17,17 +17,17 @@ import colors from './shared/constants/colors.js';
|
|
|
17
17
|
*/
|
|
18
18
|
export class AIChangelogGenerator {
|
|
19
19
|
constructor(options = {}) {
|
|
20
|
-
this.options = options
|
|
21
|
-
this.appService = new ApplicationService(options)
|
|
22
|
-
|
|
20
|
+
this.options = options
|
|
21
|
+
this.appService = new ApplicationService(options)
|
|
22
|
+
|
|
23
23
|
// Simple configuration
|
|
24
|
-
this.analysisMode = options.analysisMode || 'standard'
|
|
25
|
-
this.modelOverride = options.modelOverride || null
|
|
26
|
-
this.dryRun = options.dryRun
|
|
27
|
-
this.silent = options.silent
|
|
28
|
-
|
|
24
|
+
this.analysisMode = options.analysisMode || 'standard'
|
|
25
|
+
this.modelOverride = options.modelOverride || null
|
|
26
|
+
this.dryRun = options.dryRun
|
|
27
|
+
this.silent = options.silent
|
|
28
|
+
|
|
29
29
|
if (!this.silent) {
|
|
30
|
-
console.log(colors.successMessage('🚀 AI Changelog Generator initialized'))
|
|
30
|
+
console.log(colors.successMessage('🚀 AI Changelog Generator initialized'))
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -35,224 +35,234 @@ export class AIChangelogGenerator {
|
|
|
35
35
|
async generateChangelog(version = null, since = null) {
|
|
36
36
|
try {
|
|
37
37
|
if (this.dryRun && !this.silent) {
|
|
38
|
-
console.log(colors.infoMessage('DRY RUN MODE - No files will be written'))
|
|
38
|
+
console.log(colors.infoMessage('DRY RUN MODE - No files will be written'))
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
return await this.appService.generateChangelog({ version, since })
|
|
40
|
+
|
|
41
|
+
return await this.appService.generateChangelog({ version, since })
|
|
42
42
|
} catch (error) {
|
|
43
43
|
if (!this.silent) {
|
|
44
|
-
console.error(colors.errorMessage('Changelog generation failed:'), error.message)
|
|
44
|
+
console.error(colors.errorMessage('Changelog generation failed:'), error.message)
|
|
45
45
|
}
|
|
46
|
-
throw error
|
|
46
|
+
throw error
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// Repository analysis - delegates to analysis engine
|
|
51
51
|
async analyzeRepository(config = {}) {
|
|
52
52
|
try {
|
|
53
|
-
return await this.appService.analyzeRepository(config)
|
|
53
|
+
return await this.appService.analyzeRepository(config)
|
|
54
54
|
} catch (error) {
|
|
55
55
|
if (!this.silent) {
|
|
56
|
-
console.error(colors.errorMessage('Repository analysis failed:'), error.message)
|
|
56
|
+
console.error(colors.errorMessage('Repository analysis failed:'), error.message)
|
|
57
57
|
}
|
|
58
|
-
throw error
|
|
58
|
+
throw error
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// Current changes analysis
|
|
63
63
|
async analyzeCurrentChanges() {
|
|
64
64
|
try {
|
|
65
|
-
return await this.appService.analyzeCurrentChanges()
|
|
65
|
+
return await this.appService.analyzeCurrentChanges()
|
|
66
66
|
} catch (error) {
|
|
67
67
|
if (!this.silent) {
|
|
68
|
-
console.error(colors.errorMessage('Changes analysis failed:'), error.message)
|
|
68
|
+
console.error(colors.errorMessage('Changes analysis failed:'), error.message)
|
|
69
69
|
}
|
|
70
|
-
throw error
|
|
70
|
+
throw error
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// Recent commits analysis
|
|
75
75
|
async analyzeRecentCommits(limit = 10) {
|
|
76
76
|
try {
|
|
77
|
-
return await this.appService.analyzeRecentCommits(limit)
|
|
77
|
+
return await this.appService.analyzeRecentCommits(limit)
|
|
78
78
|
} catch (error) {
|
|
79
79
|
if (!this.silent) {
|
|
80
|
-
console.error(colors.errorMessage('Commits analysis failed:'), error.message)
|
|
80
|
+
console.error(colors.errorMessage('Commits analysis failed:'), error.message)
|
|
81
81
|
}
|
|
82
|
-
throw error
|
|
82
|
+
throw error
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// Branches analysis - delegates to analysis engine
|
|
87
87
|
async analyzeBranches(config = {}) {
|
|
88
88
|
try {
|
|
89
|
-
return await this.appService.analyzeRepository({ ...config, type: 'branches' })
|
|
89
|
+
return await this.appService.analyzeRepository({ ...config, type: 'branches' })
|
|
90
90
|
} catch (error) {
|
|
91
91
|
if (!this.silent) {
|
|
92
|
-
console.error(colors.errorMessage('Branches analysis failed:'), error.message)
|
|
92
|
+
console.error(colors.errorMessage('Branches analysis failed:'), error.message)
|
|
93
93
|
}
|
|
94
|
-
throw error
|
|
94
|
+
throw error
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
// Comprehensive analysis - delegates to analysis engine
|
|
99
99
|
async analyzeComprehensive(config = {}) {
|
|
100
100
|
try {
|
|
101
|
-
return await this.appService.analyzeRepository({ ...config, type: 'comprehensive' })
|
|
101
|
+
return await this.appService.analyzeRepository({ ...config, type: 'comprehensive' })
|
|
102
102
|
} catch (error) {
|
|
103
103
|
if (!this.silent) {
|
|
104
|
-
console.error(colors.errorMessage('Comprehensive analysis failed:'), error.message)
|
|
104
|
+
console.error(colors.errorMessage('Comprehensive analysis failed:'), error.message)
|
|
105
105
|
}
|
|
106
|
-
throw error
|
|
106
|
+
throw error
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// Untracked files analysis - delegates to analysis engine
|
|
111
111
|
async analyzeUntrackedFiles(config = {}) {
|
|
112
112
|
try {
|
|
113
|
-
return await this.appService.analyzeRepository({ ...config, type: 'untracked' })
|
|
113
|
+
return await this.appService.analyzeRepository({ ...config, type: 'untracked' })
|
|
114
114
|
} catch (error) {
|
|
115
115
|
if (!this.silent) {
|
|
116
|
-
console.error(colors.errorMessage('Untracked files analysis failed:'), error.message)
|
|
116
|
+
console.error(colors.errorMessage('Untracked files analysis failed:'), error.message)
|
|
117
117
|
}
|
|
118
|
-
throw error
|
|
118
|
+
throw error
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
// Repository health assessment
|
|
123
123
|
async assessRepositoryHealth(config = {}) {
|
|
124
124
|
try {
|
|
125
|
-
return await this.appService.assessHealth(config)
|
|
125
|
+
return await this.appService.assessHealth(config)
|
|
126
126
|
} catch (error) {
|
|
127
127
|
if (!this.silent) {
|
|
128
|
-
console.error(colors.errorMessage('Health assessment failed:'), error.message)
|
|
128
|
+
console.error(colors.errorMessage('Health assessment failed:'), error.message)
|
|
129
129
|
}
|
|
130
|
-
throw error
|
|
130
|
+
throw error
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// Working directory changelog
|
|
135
135
|
async generateChangelogFromChanges(version = null) {
|
|
136
136
|
try {
|
|
137
|
-
return await this.appService.generateChangelogFromChanges(version)
|
|
137
|
+
return await this.appService.generateChangelogFromChanges(version)
|
|
138
138
|
} catch (error) {
|
|
139
139
|
if (!this.silent) {
|
|
140
|
-
console.error(colors.errorMessage('Working directory changelog failed:'), error.message)
|
|
140
|
+
console.error(colors.errorMessage('Working directory changelog failed:'), error.message)
|
|
141
141
|
}
|
|
142
|
-
throw error
|
|
142
|
+
throw error
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// Interactive mode
|
|
147
147
|
async runInteractive() {
|
|
148
148
|
try {
|
|
149
|
-
return await this.appService.runInteractive()
|
|
149
|
+
return await this.appService.runInteractive()
|
|
150
150
|
} catch (error) {
|
|
151
151
|
if (!this.silent) {
|
|
152
|
-
console.error(colors.errorMessage('Interactive mode failed:'), error.message)
|
|
152
|
+
console.error(colors.errorMessage('Interactive mode failed:'), error.message)
|
|
153
153
|
}
|
|
154
|
-
throw error
|
|
154
|
+
throw error
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
// Health check
|
|
159
159
|
async healthCheck() {
|
|
160
160
|
try {
|
|
161
|
-
return await this.appService.healthCheck()
|
|
161
|
+
return await this.appService.healthCheck()
|
|
162
162
|
} catch (error) {
|
|
163
163
|
if (!this.silent) {
|
|
164
|
-
console.error(colors.errorMessage('Health check failed:'), error.message)
|
|
164
|
+
console.error(colors.errorMessage('Health check failed:'), error.message)
|
|
165
165
|
}
|
|
166
|
-
throw error
|
|
166
|
+
throw error
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
// Configuration methods - simple delegation
|
|
171
171
|
setAnalysisMode(mode) {
|
|
172
|
-
this.analysisMode = mode
|
|
173
|
-
this.appService.setAnalysisMode(mode)
|
|
172
|
+
this.analysisMode = mode
|
|
173
|
+
this.appService.setAnalysisMode(mode)
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
setModelOverride(model) {
|
|
177
|
-
this.modelOverride = model
|
|
178
|
-
this.appService.setModelOverride(model)
|
|
177
|
+
this.modelOverride = model
|
|
178
|
+
this.appService.setModelOverride(model)
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
// Provider management - delegates to service layer
|
|
182
182
|
async listProviders() {
|
|
183
|
-
return await this.appService.listProviders()
|
|
183
|
+
return await this.appService.listProviders()
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
async switchProvider(providerName) {
|
|
187
|
-
return await this.appService.switchProvider(providerName)
|
|
187
|
+
return await this.appService.switchProvider(providerName)
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// Metrics - delegates to orchestrator
|
|
191
191
|
getMetrics() {
|
|
192
|
-
return this.appService.getMetrics()
|
|
192
|
+
return this.appService.getMetrics()
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
resetMetrics() {
|
|
196
|
-
this.appService.resetMetrics()
|
|
196
|
+
this.appService.resetMetrics()
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// Configuration validation
|
|
200
200
|
async validateConfiguration() {
|
|
201
|
-
return await this.appService.validateConfiguration()
|
|
201
|
+
return await this.appService.validateConfiguration()
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
// Utility methods for backward compatibility
|
|
205
205
|
get hasAI() {
|
|
206
|
-
|
|
206
|
+
try {
|
|
207
|
+
return this.appService?.orchestrator?.aiProvider?.isAvailable() || false
|
|
208
|
+
} catch (error) {
|
|
209
|
+
return false
|
|
210
|
+
}
|
|
207
211
|
}
|
|
208
212
|
|
|
209
213
|
get gitExists() {
|
|
210
|
-
|
|
214
|
+
try {
|
|
215
|
+
return this.appService?.orchestrator?.gitManager?.isGitRepo || false
|
|
216
|
+
} catch (error) {
|
|
217
|
+
return false
|
|
218
|
+
}
|
|
211
219
|
}
|
|
212
220
|
|
|
213
221
|
// Simple logging method
|
|
214
222
|
log(message, type = 'info') {
|
|
215
|
-
if (this.silent)
|
|
216
|
-
|
|
223
|
+
if (this.silent) {
|
|
224
|
+
return
|
|
225
|
+
}
|
|
226
|
+
|
|
217
227
|
switch (type) {
|
|
218
228
|
case 'error':
|
|
219
|
-
console.error(colors.errorMessage(message))
|
|
220
|
-
break
|
|
229
|
+
console.error(colors.errorMessage(message))
|
|
230
|
+
break
|
|
221
231
|
case 'warning':
|
|
222
|
-
console.warn(colors.warningMessage(message))
|
|
223
|
-
break
|
|
232
|
+
console.warn(colors.warningMessage(message))
|
|
233
|
+
break
|
|
224
234
|
case 'success':
|
|
225
|
-
console.log(colors.successMessage(message))
|
|
226
|
-
break
|
|
235
|
+
console.log(colors.successMessage(message))
|
|
236
|
+
break
|
|
227
237
|
default:
|
|
228
|
-
console.log(colors.infoMessage(message))
|
|
238
|
+
console.log(colors.infoMessage(message))
|
|
229
239
|
}
|
|
230
240
|
}
|
|
231
241
|
}
|
|
232
242
|
|
|
233
243
|
// Export for backwards compatibility
|
|
234
|
-
export default AIChangelogGenerator
|
|
244
|
+
export default AIChangelogGenerator
|
|
235
245
|
|
|
236
246
|
// CLI integration point (would be moved to separate CLI file)
|
|
237
247
|
export async function createGenerator(options = {}) {
|
|
238
248
|
try {
|
|
239
|
-
const generator = new AIChangelogGenerator(options)
|
|
240
|
-
|
|
249
|
+
const generator = new AIChangelogGenerator(options)
|
|
250
|
+
|
|
241
251
|
// Perform health check on initialization
|
|
242
|
-
const health = await generator.healthCheck()
|
|
243
|
-
|
|
252
|
+
const health = await generator.healthCheck()
|
|
253
|
+
|
|
244
254
|
if (health.status === 'unhealthy') {
|
|
245
|
-
console.warn(colors.warningMessage('⚠️ Health check failed:'))
|
|
255
|
+
console.warn(colors.warningMessage('⚠️ Health check failed:'))
|
|
246
256
|
Object.entries(health.checks).forEach(([check, result]) => {
|
|
247
257
|
if (result.status === 'error') {
|
|
248
|
-
console.warn(colors.errorMessage(` ❌ ${check}: ${result.message}`))
|
|
258
|
+
console.warn(colors.errorMessage(` ❌ ${check}: ${result.message}`))
|
|
249
259
|
}
|
|
250
|
-
})
|
|
260
|
+
})
|
|
251
261
|
}
|
|
252
|
-
|
|
253
|
-
return generator
|
|
262
|
+
|
|
263
|
+
return generator
|
|
254
264
|
} catch (error) {
|
|
255
|
-
console.error(colors.errorMessage('Failed to create generator:'), error.message)
|
|
256
|
-
throw error
|
|
265
|
+
console.error(colors.errorMessage('Failed to create generator:'), error.message)
|
|
266
|
+
throw error
|
|
257
267
|
}
|
|
258
|
-
}
|
|
268
|
+
}
|