@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
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// This file is for demonstration purposes and is not needed for production
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CLI Enhancement Demo
|
|
7
|
+
* Demonstrates the new CLI styling capabilities
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import process from 'node:process'
|
|
11
|
+
|
|
12
|
+
import colors from '../constants/colors.js'
|
|
13
|
+
import { cliUtils, EnhancedConsole, ProgressBar, SimpleSpinner, TaskList } from './cli-ui.js'
|
|
14
|
+
|
|
15
|
+
async function demoBasicStyling() {
|
|
16
|
+
EnhancedConsole.section('🎨 Basic Styling Demo')
|
|
17
|
+
|
|
18
|
+
// Status messages
|
|
19
|
+
EnhancedConsole.success('Operation completed successfully')
|
|
20
|
+
EnhancedConsole.error('Something went wrong')
|
|
21
|
+
EnhancedConsole.warn('This is a warning message')
|
|
22
|
+
EnhancedConsole.info("Here's some information")
|
|
23
|
+
EnhancedConsole.processing('Processing your request...')
|
|
24
|
+
EnhancedConsole.ai('AI analysis complete')
|
|
25
|
+
EnhancedConsole.metrics('Performance metrics updated')
|
|
26
|
+
|
|
27
|
+
EnhancedConsole.space()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function demoSpinners() {
|
|
31
|
+
EnhancedConsole.section('⏳ Loading Indicators')
|
|
32
|
+
|
|
33
|
+
const spinner = new SimpleSpinner('Analyzing codebase...')
|
|
34
|
+
spinner.start()
|
|
35
|
+
|
|
36
|
+
await new Promise((resolve) => setTimeout(resolve, 2000))
|
|
37
|
+
spinner.succeed('Codebase analysis complete')
|
|
38
|
+
|
|
39
|
+
const spinner2 = new SimpleSpinner('Connecting to AI service...')
|
|
40
|
+
spinner2.start()
|
|
41
|
+
|
|
42
|
+
await new Promise((resolve) => setTimeout(resolve, 1500))
|
|
43
|
+
spinner2.warn('Connection timeout, using fallback')
|
|
44
|
+
|
|
45
|
+
EnhancedConsole.space()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function demoProgressBar() {
|
|
49
|
+
EnhancedConsole.section('📊 Progress Indicators')
|
|
50
|
+
|
|
51
|
+
const progress = new ProgressBar(100, 50)
|
|
52
|
+
|
|
53
|
+
for (let i = 0; i <= 100; i += 5) {
|
|
54
|
+
progress.update(i, i < 30 ? 'Initializing...' : i < 70 ? 'Processing...' : 'Finalizing...')
|
|
55
|
+
await new Promise((resolve) => setTimeout(resolve, 50))
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
progress.finish('All files processed successfully')
|
|
59
|
+
EnhancedConsole.space()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function demoTaskList() {
|
|
63
|
+
EnhancedConsole.section('✅ Task Management')
|
|
64
|
+
|
|
65
|
+
const tasks = new TaskList([
|
|
66
|
+
'Initialize project configuration',
|
|
67
|
+
'Analyze git repository',
|
|
68
|
+
'Process commit history',
|
|
69
|
+
'Generate changelog content',
|
|
70
|
+
'Validate output format',
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
for (let i = 0; i < tasks.tasks.length; i++) {
|
|
74
|
+
tasks.start(i)
|
|
75
|
+
await new Promise((resolve) => setTimeout(resolve, 800))
|
|
76
|
+
|
|
77
|
+
if (i === 2) {
|
|
78
|
+
tasks.fail(i, 'Network timeout')
|
|
79
|
+
} else {
|
|
80
|
+
tasks.complete(i, `${Math.floor(Math.random() * 500)}ms`)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
tasks.summary()
|
|
85
|
+
EnhancedConsole.space()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function demoBoxes() {
|
|
89
|
+
EnhancedConsole.section('📦 Boxed Content')
|
|
90
|
+
|
|
91
|
+
EnhancedConsole.box(
|
|
92
|
+
'System Information',
|
|
93
|
+
`
|
|
94
|
+
Platform: ${process.platform}
|
|
95
|
+
Node.js: ${process.version}
|
|
96
|
+
Memory: ${Math.round(process.memoryUsage().rss / 1024 / 1024)}MB
|
|
97
|
+
Uptime: ${cliUtils.formatDuration(process.uptime() * 1000)}
|
|
98
|
+
`,
|
|
99
|
+
{ borderStyle: 'rounded', borderColor: 'success' }
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
EnhancedConsole.box(
|
|
103
|
+
'Configuration',
|
|
104
|
+
`
|
|
105
|
+
${colors.label('AI Provider')}: ${colors.value('OpenAI GPT-4')}
|
|
106
|
+
${colors.label('Model')}: ${colors.value('gpt-4-turbo-preview')}
|
|
107
|
+
${colors.label('Max Tokens')}: ${colors.value('4096')}
|
|
108
|
+
${colors.label('Temperature')}: ${colors.value('0.7')}
|
|
109
|
+
`,
|
|
110
|
+
{ borderStyle: 'double', borderColor: 'info' }
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
EnhancedConsole.space()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function demoTables() {
|
|
117
|
+
EnhancedConsole.section('📋 Data Tables')
|
|
118
|
+
|
|
119
|
+
const commitData = [
|
|
120
|
+
{ hash: 'a1b2c3d', type: 'feat', message: 'Add new authentication system', files: 12 },
|
|
121
|
+
{ hash: 'e4f5g6h', type: 'fix', message: 'Fix memory leak in parser', files: 3 },
|
|
122
|
+
{ hash: 'i7j8k9l', type: 'docs', message: 'Update API documentation', files: 8 },
|
|
123
|
+
{ hash: 'm1n2o3p', type: 'refactor', message: 'Restructure service layer', files: 15 },
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
EnhancedConsole.table(commitData, {
|
|
127
|
+
headers: ['Hash', 'Type', 'Message', 'Files'],
|
|
128
|
+
align: 'left',
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
EnhancedConsole.space()
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function demoFileList() {
|
|
135
|
+
EnhancedConsole.section('📁 File Listings')
|
|
136
|
+
|
|
137
|
+
const files = [
|
|
138
|
+
'src/components/Header.tsx',
|
|
139
|
+
'src/styles/main.scss',
|
|
140
|
+
'docs/README.md',
|
|
141
|
+
'package.json',
|
|
142
|
+
'config/database.yml',
|
|
143
|
+
'scripts/deploy.sql',
|
|
144
|
+
'tests/auth.test.js',
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
EnhancedConsole.fileList(files, 'Modified Files')
|
|
148
|
+
EnhancedConsole.space()
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function demoMetrics() {
|
|
152
|
+
EnhancedConsole.section('📈 Metrics Display')
|
|
153
|
+
|
|
154
|
+
const metrics = {
|
|
155
|
+
'Lines Added': colors.success('+247'),
|
|
156
|
+
'Lines Removed': colors.error('-89'),
|
|
157
|
+
'Files Changed': '12',
|
|
158
|
+
'Complexity Score': colors.warning('7.2/10'),
|
|
159
|
+
'Test Coverage': colors.success('94%'),
|
|
160
|
+
'Bundle Size': '2.3MB',
|
|
161
|
+
'Build Time': '12.4s',
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
EnhancedConsole.metrics(metrics)
|
|
165
|
+
EnhancedConsole.space()
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function demoSymbols() {
|
|
169
|
+
EnhancedConsole.section('🔤 Unicode Symbols')
|
|
170
|
+
|
|
171
|
+
console.log('Status symbols:')
|
|
172
|
+
console.log(` ${colors.success(colors.symbols.success)} Success`)
|
|
173
|
+
console.log(` ${colors.error(colors.symbols.error)} Error`)
|
|
174
|
+
console.log(` ${colors.warning(colors.symbols.warning)} Warning`)
|
|
175
|
+
console.log(` ${colors.info(colors.symbols.info)} Information`)
|
|
176
|
+
console.log(` ${colors.highlight(colors.symbols.refresh)} Processing`)
|
|
177
|
+
|
|
178
|
+
console.log('\nNavigation symbols:')
|
|
179
|
+
console.log(` ${colors.symbols.arrow} Next step`)
|
|
180
|
+
console.log(` ${colors.symbols.bullet} List item`)
|
|
181
|
+
console.log(` ${colors.symbols.play} Start process`)
|
|
182
|
+
console.log(` ${colors.symbols.stop} End process`)
|
|
183
|
+
|
|
184
|
+
console.log('\nMath & special:')
|
|
185
|
+
console.log(` ${colors.symbols.plus} Addition`)
|
|
186
|
+
console.log(` ${colors.symbols.minus} Subtraction`)
|
|
187
|
+
console.log(` ${colors.symbols.multiply} Multiplication`)
|
|
188
|
+
console.log(` ${colors.symbols.degree} Temperature: 23${colors.symbols.degree}C`)
|
|
189
|
+
console.log(` ${colors.symbols.micro} Microsecond: 150${colors.symbols.micro}s`)
|
|
190
|
+
|
|
191
|
+
EnhancedConsole.space()
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
async function runDemo() {
|
|
195
|
+
console.clear()
|
|
196
|
+
|
|
197
|
+
// Import gradient-string if available
|
|
198
|
+
let gradientTitle = '🚀 AI Changelog Generator'
|
|
199
|
+
try {
|
|
200
|
+
const { default: gradient } = await import('gradient-string')
|
|
201
|
+
gradientTitle = gradient(['#FF6B6B', '#4ECDC4', '#45B7D1'])(gradientTitle)
|
|
202
|
+
} catch {
|
|
203
|
+
gradientTitle = colors.highlight(gradientTitle)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Welcome header
|
|
207
|
+
console.log(
|
|
208
|
+
colors.boxed(
|
|
209
|
+
`
|
|
210
|
+
${gradientTitle}
|
|
211
|
+
${colors.secondary('Enhanced CLI Styling Demo')}
|
|
212
|
+
|
|
213
|
+
${colors.dim('Press Ctrl+C to exit at any time')}
|
|
214
|
+
`,
|
|
215
|
+
{
|
|
216
|
+
title: 'Welcome',
|
|
217
|
+
borderStyle: 'double',
|
|
218
|
+
borderColor: 'highlight',
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
console.log('\n')
|
|
224
|
+
|
|
225
|
+
try {
|
|
226
|
+
await demoBasicStyling()
|
|
227
|
+
await demoSpinners()
|
|
228
|
+
await demoProgressBar()
|
|
229
|
+
await demoTaskList()
|
|
230
|
+
await demoBoxes()
|
|
231
|
+
await demoTables()
|
|
232
|
+
await demoFileList()
|
|
233
|
+
await demoMetrics()
|
|
234
|
+
await demoSymbols()
|
|
235
|
+
|
|
236
|
+
// Final summary
|
|
237
|
+
EnhancedConsole.divider('═', 70)
|
|
238
|
+
console.log(
|
|
239
|
+
colors.boxed(
|
|
240
|
+
`
|
|
241
|
+
${colors.success('✨ Demo Complete!')}
|
|
242
|
+
|
|
243
|
+
These styling enhancements are now available throughout your CLI:
|
|
244
|
+
|
|
245
|
+
${colors.bullet} ${colors.highlight('Enhanced colors and symbols')}
|
|
246
|
+
${colors.bullet} ${colors.highlight('Loading spinners and progress bars')}
|
|
247
|
+
${colors.bullet} ${colors.highlight('Structured tables and boxes')}
|
|
248
|
+
${colors.bullet} ${colors.highlight('File type syntax highlighting')}
|
|
249
|
+
${colors.bullet} ${colors.highlight('Metrics and data visualization')}
|
|
250
|
+
|
|
251
|
+
${colors.dim('Integration examples can be found in:')}
|
|
252
|
+
${colors.file('src/shared/utils/cli-ui.js')}
|
|
253
|
+
${colors.file('src/shared/constants/colors.js')}
|
|
254
|
+
`,
|
|
255
|
+
{
|
|
256
|
+
title: '🎯 Summary',
|
|
257
|
+
borderStyle: 'rounded',
|
|
258
|
+
borderColor: 'success',
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
)
|
|
262
|
+
} catch (error) {
|
|
263
|
+
EnhancedConsole.error(`Demo failed: ${error.message}`)
|
|
264
|
+
process.exit(1)
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Export for use as a module
|
|
269
|
+
export {
|
|
270
|
+
demoBasicStyling,
|
|
271
|
+
demoSpinners,
|
|
272
|
+
demoProgressBar,
|
|
273
|
+
demoTaskList,
|
|
274
|
+
demoBoxes,
|
|
275
|
+
demoTables,
|
|
276
|
+
demoFileList,
|
|
277
|
+
demoMetrics,
|
|
278
|
+
demoSymbols,
|
|
279
|
+
runDemo,
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Run demo if called directly
|
|
283
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
284
|
+
runDemo().catch(console.error)
|
|
285
|
+
}
|