grok-cli-hurry-mode 1.0.3 → 1.0.5
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/agent/grok-agent.js.map +1 -1
- package/dist/hooks/use-input-handler.js +590 -2
- package/dist/hooks/use-input-handler.js.map +1 -1
- package/dist/mcp/client.js +6 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/subagents/subagent-framework.d.ts +66 -0
- package/dist/subagents/subagent-framework.js +349 -0
- package/dist/subagents/subagent-framework.js.map +1 -0
- package/dist/tools/documentation/agent-system-generator.d.ts +30 -0
- package/dist/tools/documentation/agent-system-generator.js +816 -0
- package/dist/tools/documentation/agent-system-generator.js.map +1 -0
- package/dist/tools/documentation/api-docs-generator.d.ts +89 -0
- package/dist/tools/documentation/api-docs-generator.js +344 -0
- package/dist/tools/documentation/api-docs-generator.js.map +1 -0
- package/dist/tools/documentation/auto-update-system.d.ts +47 -0
- package/dist/tools/documentation/auto-update-system.js +278 -0
- package/dist/tools/documentation/auto-update-system.js.map +1 -0
- package/dist/tools/documentation/changelog-generator.d.ts +39 -0
- package/dist/tools/documentation/changelog-generator.js +255 -0
- package/dist/tools/documentation/changelog-generator.js.map +1 -0
- package/dist/tools/documentation/claude-md-parser.d.ts +25 -0
- package/dist/tools/documentation/claude-md-parser.js +108 -0
- package/dist/tools/documentation/claude-md-parser.js.map +1 -0
- package/dist/tools/documentation/comments-generator.d.ts +55 -0
- package/dist/tools/documentation/comments-generator.js +238 -0
- package/dist/tools/documentation/comments-generator.js.map +1 -0
- package/dist/tools/documentation/docs-menu.d.ts +9 -0
- package/dist/tools/documentation/docs-menu.js +57 -0
- package/dist/tools/documentation/docs-menu.js.map +1 -0
- package/dist/tools/documentation/readme-generator.d.ts +31 -0
- package/dist/tools/documentation/readme-generator.js +244 -0
- package/dist/tools/documentation/readme-generator.js.map +1 -0
- package/dist/tools/documentation/self-healing-system.d.ts +66 -0
- package/dist/tools/documentation/self-healing-system.js +444 -0
- package/dist/tools/documentation/self-healing-system.js.map +1 -0
- package/dist/tools/documentation/smart-prd-assistant.d.ts +45 -0
- package/dist/tools/documentation/smart-prd-assistant.js +325 -0
- package/dist/tools/documentation/smart-prd-assistant.js.map +1 -0
- package/dist/tools/documentation/update-agent-docs.d.ts +37 -0
- package/dist/tools/documentation/update-agent-docs.js +275 -0
- package/dist/tools/documentation/update-agent-docs.js.map +1 -0
- package/dist/tools/intelligence/ast-parser.js +22 -4
- package/dist/tools/intelligence/ast-parser.js.map +1 -1
- package/dist/ui/app.d.ts +2 -1
- package/dist/ui/app.js +27 -6
- package/dist/ui/app.js.map +1 -1
- package/dist/ui/components/api-key-input.d.ts +2 -1
- package/dist/ui/components/api-key-input.js +18 -3
- package/dist/ui/components/api-key-input.js.map +1 -1
- package/dist/ui/components/chat-history.d.ts +2 -1
- package/dist/ui/components/chat-history.js +35 -13
- package/dist/ui/components/chat-history.js.map +1 -1
- package/dist/ui/components/chat-input.d.ts +2 -1
- package/dist/ui/components/chat-input.js +37 -16
- package/dist/ui/components/chat-input.js.map +1 -1
- package/dist/ui/components/chat-interface.d.ts +2 -1
- package/dist/ui/components/chat-interface.js +42 -8
- package/dist/ui/components/chat-interface.js.map +1 -1
- package/dist/ui/components/command-suggestions.d.ts +2 -1
- package/dist/ui/components/command-suggestions.js +8 -3
- package/dist/ui/components/command-suggestions.js.map +1 -1
- package/dist/ui/components/confirmation-dialog.d.ts +2 -1
- package/dist/ui/components/confirmation-dialog.js +39 -4
- package/dist/ui/components/confirmation-dialog.js.map +1 -1
- package/dist/ui/components/diff-renderer.js +66 -57
- package/dist/ui/components/diff-renderer.js.map +1 -1
- package/dist/ui/components/loading-spinner.d.ts +2 -1
- package/dist/ui/components/loading-spinner.js +13 -3
- package/dist/ui/components/loading-spinner.js.map +1 -1
- package/dist/ui/components/mcp-status.d.ts +2 -1
- package/dist/ui/components/mcp-status.js +6 -3
- package/dist/ui/components/mcp-status.js.map +1 -1
- package/dist/ui/components/model-selection.d.ts +2 -1
- package/dist/ui/components/model-selection.js +11 -2
- package/dist/ui/components/model-selection.js.map +1 -1
- package/dist/ui/shared/max-sized-box.js +2 -2
- package/dist/ui/shared/max-sized-box.js.map +1 -1
- package/dist/ui/utils/code-colorizer.js +2 -2
- package/dist/ui/utils/code-colorizer.js.map +1 -1
- package/dist/ui/utils/markdown-renderer.d.ts +2 -1
- package/dist/ui/utils/markdown-renderer.js +3 -3
- package/dist/ui/utils/markdown-renderer.js.map +1 -1
- package/package.json +21 -12
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import { existsSync } from 'fs';
|
|
4
|
+
export class AutoUpdateSystem {
|
|
5
|
+
constructor(rootPath, config) {
|
|
6
|
+
this.tokenCount = 0;
|
|
7
|
+
this.lastUpdateTime = Date.now();
|
|
8
|
+
this.rootPath = rootPath;
|
|
9
|
+
this.config = {
|
|
10
|
+
enabled: true,
|
|
11
|
+
triggers: {
|
|
12
|
+
keyFiles: true,
|
|
13
|
+
tokenThreshold: 1000,
|
|
14
|
+
sessionEnd: true,
|
|
15
|
+
gitCommits: true
|
|
16
|
+
},
|
|
17
|
+
keyFiles: [
|
|
18
|
+
'package.json',
|
|
19
|
+
'tsconfig.json',
|
|
20
|
+
'src/**/*.ts',
|
|
21
|
+
'README.md',
|
|
22
|
+
'*.config.*',
|
|
23
|
+
'.grok/**'
|
|
24
|
+
],
|
|
25
|
+
reminderStyle: 'gentle',
|
|
26
|
+
autoPrompt: true,
|
|
27
|
+
updateFrequency: 'smart',
|
|
28
|
+
...config
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async loadConfigFromSettings() {
|
|
32
|
+
try {
|
|
33
|
+
const settingsPath = path.join(this.rootPath, '.grok', 'settings.json');
|
|
34
|
+
if (existsSync(settingsPath)) {
|
|
35
|
+
const settings = JSON.parse(await fs.readFile(settingsPath, 'utf-8'));
|
|
36
|
+
if (settings.documentation?.autoUpdate) {
|
|
37
|
+
this.config = { ...this.config, ...settings.documentation.autoUpdate };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
// Use default config
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async saveConfigToSettings() {
|
|
46
|
+
try {
|
|
47
|
+
const settingsPath = path.join(this.rootPath, '.grok', 'settings.json');
|
|
48
|
+
let settings = {};
|
|
49
|
+
if (existsSync(settingsPath)) {
|
|
50
|
+
settings = JSON.parse(await fs.readFile(settingsPath, 'utf-8'));
|
|
51
|
+
}
|
|
52
|
+
const updatedSettings = {
|
|
53
|
+
...settings,
|
|
54
|
+
documentation: {
|
|
55
|
+
...(settings.documentation || {}),
|
|
56
|
+
autoUpdate: this.config
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
// Ensure .grok directory exists
|
|
60
|
+
const grokDir = path.join(this.rootPath, '.grok');
|
|
61
|
+
if (!existsSync(grokDir)) {
|
|
62
|
+
await fs.mkdir(grokDir, { recursive: true });
|
|
63
|
+
}
|
|
64
|
+
await fs.writeFile(settingsPath, JSON.stringify(updatedSettings, null, 2));
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
// Fail silently for now
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
updateTokenCount(count) {
|
|
71
|
+
this.tokenCount = count;
|
|
72
|
+
}
|
|
73
|
+
async checkTriggers() {
|
|
74
|
+
if (!this.config.enabled) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
const triggers = [];
|
|
78
|
+
// Check key file changes
|
|
79
|
+
if (this.config.triggers.keyFiles) {
|
|
80
|
+
const keyFileChanges = await this.checkKeyFileChanges();
|
|
81
|
+
if (keyFileChanges) {
|
|
82
|
+
triggers.push({
|
|
83
|
+
type: 'keyFiles',
|
|
84
|
+
message: '💡 Key files have been modified. Consider updating documentation?',
|
|
85
|
+
priority: 'medium',
|
|
86
|
+
actionSuggested: '/update-agent-docs'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Check token threshold
|
|
91
|
+
if (this.config.triggers.tokenThreshold && this.tokenCount >= this.config.triggers.tokenThreshold) {
|
|
92
|
+
triggers.push({
|
|
93
|
+
type: 'tokenThreshold',
|
|
94
|
+
message: `🔢 Token threshold reached (${this.tokenCount}/${this.config.triggers.tokenThreshold}). Consider updating docs?`,
|
|
95
|
+
priority: 'low',
|
|
96
|
+
actionSuggested: '/update-agent-docs'
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
// Check git commits
|
|
100
|
+
if (this.config.triggers.gitCommits) {
|
|
101
|
+
const recentCommits = await this.checkRecentCommits();
|
|
102
|
+
if (recentCommits) {
|
|
103
|
+
triggers.push({
|
|
104
|
+
type: 'gitCommits',
|
|
105
|
+
message: '📝 Recent commits detected. Update documentation to stay current?',
|
|
106
|
+
priority: 'medium',
|
|
107
|
+
actionSuggested: '/update-agent-docs'
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return this.filterTriggersByFrequency(triggers);
|
|
112
|
+
}
|
|
113
|
+
async checkKeyFileChanges() {
|
|
114
|
+
try {
|
|
115
|
+
const fiveMinutesAgo = Date.now() - (5 * 60 * 1000);
|
|
116
|
+
for (const pattern of this.config.keyFiles) {
|
|
117
|
+
const files = await this.expandGlobPattern(pattern);
|
|
118
|
+
for (const file of files) {
|
|
119
|
+
const fullPath = path.join(this.rootPath, file);
|
|
120
|
+
if (existsSync(fullPath)) {
|
|
121
|
+
const stats = await fs.stat(fullPath);
|
|
122
|
+
if (stats.mtime.getTime() > fiveMinutesAgo && stats.mtime.getTime() > this.lastUpdateTime) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async expandGlobPattern(pattern) {
|
|
135
|
+
// Simple glob expansion - could be enhanced with a proper glob library
|
|
136
|
+
if (pattern.includes('**')) {
|
|
137
|
+
return await this.findFilesRecursively(pattern);
|
|
138
|
+
}
|
|
139
|
+
else if (pattern.includes('*')) {
|
|
140
|
+
return await this.findFilesWithWildcard(pattern);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return [pattern];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async findFilesRecursively(pattern) {
|
|
147
|
+
const files = [];
|
|
148
|
+
const basePath = pattern.split('**')[0];
|
|
149
|
+
const extension = pattern.includes('.') ? pattern.split('.').pop() : '';
|
|
150
|
+
const scanDir = async (dirPath) => {
|
|
151
|
+
try {
|
|
152
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
153
|
+
for (const entry of entries) {
|
|
154
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
155
|
+
const relativePath = path.relative(this.rootPath, fullPath);
|
|
156
|
+
if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
|
|
157
|
+
await scanDir(fullPath);
|
|
158
|
+
}
|
|
159
|
+
else if (entry.isFile() && (!extension || entry.name.endsWith(`.${extension}`))) {
|
|
160
|
+
files.push(relativePath);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
// Skip directories we can't read
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const searchPath = path.join(this.rootPath, basePath);
|
|
169
|
+
if (existsSync(searchPath)) {
|
|
170
|
+
await scanDir(searchPath);
|
|
171
|
+
}
|
|
172
|
+
return files;
|
|
173
|
+
}
|
|
174
|
+
async findFilesWithWildcard(pattern) {
|
|
175
|
+
// Simple wildcard matching - just check if file exists for exact patterns
|
|
176
|
+
if (existsSync(path.join(this.rootPath, pattern.replace('*', '')))) {
|
|
177
|
+
return [pattern.replace('*', '')];
|
|
178
|
+
}
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
async checkRecentCommits() {
|
|
182
|
+
try {
|
|
183
|
+
const { execSync } = require('child_process');
|
|
184
|
+
const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000).toISOString();
|
|
185
|
+
const commits = execSync(`git log --since="${oneHourAgo}" --oneline`, {
|
|
186
|
+
cwd: this.rootPath,
|
|
187
|
+
encoding: 'utf-8'
|
|
188
|
+
});
|
|
189
|
+
return commits.trim().length > 0;
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
filterTriggersByFrequency(triggers) {
|
|
196
|
+
switch (this.config.updateFrequency) {
|
|
197
|
+
case 'manual':
|
|
198
|
+
return []; // No automatic triggers
|
|
199
|
+
case 'aggressive':
|
|
200
|
+
return triggers; // All triggers
|
|
201
|
+
case 'smart':
|
|
202
|
+
default:
|
|
203
|
+
// Filter to only medium/high priority or if multiple low priority
|
|
204
|
+
const highPriority = triggers.filter(t => t.priority === 'high' || t.priority === 'medium');
|
|
205
|
+
const lowPriority = triggers.filter(t => t.priority === 'low');
|
|
206
|
+
if (highPriority.length > 0) {
|
|
207
|
+
return highPriority;
|
|
208
|
+
}
|
|
209
|
+
else if (lowPriority.length >= 2) {
|
|
210
|
+
return [lowPriority[0]]; // Show one low priority if multiple
|
|
211
|
+
}
|
|
212
|
+
return [];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
formatTriggerMessage(trigger) {
|
|
216
|
+
switch (this.config.reminderStyle) {
|
|
217
|
+
case 'persistent':
|
|
218
|
+
return `🔔 **${trigger.message}**\n\n💡 Run: \`${trigger.actionSuggested}\``;
|
|
219
|
+
case 'gentle':
|
|
220
|
+
return `${trigger.message}\n\n*Suggestion: \`${trigger.actionSuggested}\`*`;
|
|
221
|
+
case 'off':
|
|
222
|
+
default:
|
|
223
|
+
return '';
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
async markUpdateCompleted() {
|
|
227
|
+
this.lastUpdateTime = Date.now();
|
|
228
|
+
this.tokenCount = 0; // Reset token count after update
|
|
229
|
+
}
|
|
230
|
+
// Configuration methods
|
|
231
|
+
setEnabled(enabled) {
|
|
232
|
+
this.config.enabled = enabled;
|
|
233
|
+
}
|
|
234
|
+
setTrigger(trigger, enabled) {
|
|
235
|
+
if (trigger === 'tokenThreshold' && typeof enabled === 'number') {
|
|
236
|
+
this.config.triggers[trigger] = enabled;
|
|
237
|
+
}
|
|
238
|
+
else if (typeof enabled === 'boolean') {
|
|
239
|
+
this.config.triggers[trigger] = enabled;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
setTokenThreshold(threshold) {
|
|
243
|
+
this.config.triggers.tokenThreshold = threshold;
|
|
244
|
+
}
|
|
245
|
+
setReminderStyle(style) {
|
|
246
|
+
this.config.reminderStyle = style;
|
|
247
|
+
}
|
|
248
|
+
setUpdateFrequency(frequency) {
|
|
249
|
+
this.config.updateFrequency = frequency;
|
|
250
|
+
}
|
|
251
|
+
addKeyFile(pattern) {
|
|
252
|
+
if (!this.config.keyFiles.includes(pattern)) {
|
|
253
|
+
this.config.keyFiles.push(pattern);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
removeKeyFile(pattern) {
|
|
257
|
+
this.config.keyFiles = this.config.keyFiles.filter(f => f !== pattern);
|
|
258
|
+
}
|
|
259
|
+
getConfig() {
|
|
260
|
+
return { ...this.config };
|
|
261
|
+
}
|
|
262
|
+
getConfigSummary() {
|
|
263
|
+
return `📊 **Auto-Update Configuration:**
|
|
264
|
+
|
|
265
|
+
**Status:** ${this.config.enabled ? '✅ Enabled' : '❌ Disabled'}
|
|
266
|
+
**Style:** ${this.config.reminderStyle}
|
|
267
|
+
**Frequency:** ${this.config.updateFrequency}
|
|
268
|
+
|
|
269
|
+
**Triggers:**
|
|
270
|
+
- Key files: ${this.config.triggers.keyFiles ? '✅' : '❌'}
|
|
271
|
+
- Token threshold: ${this.config.triggers.tokenThreshold} tokens
|
|
272
|
+
- Session end: ${this.config.triggers.sessionEnd ? '✅' : '❌'}
|
|
273
|
+
- Git commits: ${this.config.triggers.gitCommits ? '✅' : '❌'}
|
|
274
|
+
|
|
275
|
+
**Monitored files:** ${this.config.keyFiles.length} patterns`;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=auto-update-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-update-system.js","sourceRoot":"","sources":["../../../src/tools/documentation/auto-update-system.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAuBhC,MAAM,OAAO,gBAAgB;IAM3B,YAAY,QAAgB,EAAE,MAAkC;QAHxD,eAAU,GAAW,CAAC,CAAC;QACvB,mBAAc,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;QAG1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG;YACZ,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE;gBACR,QAAQ,EAAE,IAAI;gBACd,cAAc,EAAE,IAAI;gBACpB,UAAU,EAAE,IAAI;gBAChB,UAAU,EAAE,IAAI;aACjB;YACD,QAAQ,EAAE;gBACR,cAAc;gBACd,eAAe;gBACf,aAAa;gBACb,WAAW;gBACX,YAAY;gBACZ,UAAU;aACX;YACD,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,OAAO;YACxB,GAAG,MAAM;SACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,eAAe,CAAC,C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CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,aAAa,CAAC,OAAe;QAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC;IACzE,CAAC;IAED,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED,gBAAgB;QACd,OAAO;;cAEG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY;aACjD,IAAI,CAAC,MAAM,CAAC,aAAa;iBACrB,IAAI,CAAC,MAAM,CAAC,eAAe;;;eAG7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;qBACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc;iBACvC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;iBAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;;uBAErC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,WAAW,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface ChangelogConfig {
|
|
2
|
+
rootPath: string;
|
|
3
|
+
sinceVersion?: string;
|
|
4
|
+
commitCount?: number;
|
|
5
|
+
format: 'conventional' | 'simple';
|
|
6
|
+
includeBreaking: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CommitInfo {
|
|
9
|
+
hash: string;
|
|
10
|
+
date: string;
|
|
11
|
+
author: string;
|
|
12
|
+
message: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
scope?: string;
|
|
15
|
+
breaking: boolean;
|
|
16
|
+
body?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ChangelogSection {
|
|
19
|
+
title: string;
|
|
20
|
+
commits: CommitInfo[];
|
|
21
|
+
}
|
|
22
|
+
export declare class ChangelogGenerator {
|
|
23
|
+
private config;
|
|
24
|
+
constructor(config: ChangelogConfig);
|
|
25
|
+
generateChangelog(): Promise<{
|
|
26
|
+
success: boolean;
|
|
27
|
+
message: string;
|
|
28
|
+
content?: string;
|
|
29
|
+
}>;
|
|
30
|
+
private getGitCommits;
|
|
31
|
+
private parseCommit;
|
|
32
|
+
private organizeCommits;
|
|
33
|
+
private organizeConventionalCommits;
|
|
34
|
+
private organizeSimpleCommits;
|
|
35
|
+
private generateChangelogHeader;
|
|
36
|
+
private generateChangelogContent;
|
|
37
|
+
private generateVersionNumber;
|
|
38
|
+
private extractBreakingChangeDetails;
|
|
39
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import { existsSync } from 'fs';
|
|
4
|
+
export class ChangelogGenerator {
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.config = config;
|
|
7
|
+
}
|
|
8
|
+
async generateChangelog() {
|
|
9
|
+
try {
|
|
10
|
+
// Check if we're in a git repository
|
|
11
|
+
const gitPath = path.join(this.config.rootPath, '.git');
|
|
12
|
+
if (!existsSync(gitPath)) {
|
|
13
|
+
return {
|
|
14
|
+
success: false,
|
|
15
|
+
message: 'Not a git repository. Changelog generation requires git history.'
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
// Get git commits
|
|
19
|
+
const commits = await this.getGitCommits();
|
|
20
|
+
if (commits.length === 0) {
|
|
21
|
+
return {
|
|
22
|
+
success: false,
|
|
23
|
+
message: 'No git commits found.'
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
// Parse commits and organize by type
|
|
27
|
+
const sections = this.organizeCommits(commits);
|
|
28
|
+
// Generate changelog content
|
|
29
|
+
const content = this.generateChangelogContent(sections);
|
|
30
|
+
// Write to CHANGELOG.md
|
|
31
|
+
const changelogPath = path.join(this.config.rootPath, 'CHANGELOG.md');
|
|
32
|
+
const exists = existsSync(changelogPath);
|
|
33
|
+
if (exists) {
|
|
34
|
+
// Prepend to existing changelog
|
|
35
|
+
const existingContent = await fs.readFile(changelogPath, 'utf-8');
|
|
36
|
+
const newContent = content + '\n\n' + existingContent;
|
|
37
|
+
await fs.writeFile(changelogPath, newContent);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Create new changelog
|
|
41
|
+
const fullContent = this.generateChangelogHeader() + content;
|
|
42
|
+
await fs.writeFile(changelogPath, fullContent);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
message: exists
|
|
47
|
+
? `✅ Updated CHANGELOG.md with ${commits.length} new entries`
|
|
48
|
+
: `✅ Created CHANGELOG.md with ${commits.length} entries`,
|
|
49
|
+
content
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
message: `Failed to generate changelog: ${error.message}`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async getGitCommits() {
|
|
60
|
+
const { execSync } = require('child_process');
|
|
61
|
+
try {
|
|
62
|
+
let gitCommand = 'git log --pretty=format:"%H|%ad|%an|%s|%b" --date=short';
|
|
63
|
+
if (this.config.sinceVersion) {
|
|
64
|
+
gitCommand += ` ${this.config.sinceVersion}..HEAD`;
|
|
65
|
+
}
|
|
66
|
+
else if (this.config.commitCount) {
|
|
67
|
+
gitCommand += ` -n ${this.config.commitCount}`;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
gitCommand += ' -n 50'; // Default to last 50 commits
|
|
71
|
+
}
|
|
72
|
+
const output = execSync(gitCommand, {
|
|
73
|
+
cwd: this.config.rootPath,
|
|
74
|
+
encoding: 'utf-8'
|
|
75
|
+
});
|
|
76
|
+
const lines = output.trim().split('\n').filter((line) => line.trim());
|
|
77
|
+
return lines.map((line) => {
|
|
78
|
+
const [hash, date, author, message, ...bodyParts] = line.split('|');
|
|
79
|
+
const body = bodyParts.join('|').trim();
|
|
80
|
+
return this.parseCommit({
|
|
81
|
+
hash: hash.substring(0, 7), // Short hash
|
|
82
|
+
date,
|
|
83
|
+
author,
|
|
84
|
+
message,
|
|
85
|
+
body: body || undefined,
|
|
86
|
+
breaking: false,
|
|
87
|
+
type: undefined,
|
|
88
|
+
scope: undefined
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
parseCommit(commit) {
|
|
97
|
+
if (this.config.format !== 'conventional') {
|
|
98
|
+
return commit;
|
|
99
|
+
}
|
|
100
|
+
// Parse conventional commit format: type(scope): description
|
|
101
|
+
const conventionalMatch = commit.message.match(/^(\w+)(?:\(([^)]+)\))?: (.+)/);
|
|
102
|
+
if (conventionalMatch) {
|
|
103
|
+
const [, type, scope, description] = conventionalMatch;
|
|
104
|
+
commit.type = type;
|
|
105
|
+
commit.scope = scope;
|
|
106
|
+
commit.message = description;
|
|
107
|
+
}
|
|
108
|
+
// Check for breaking changes
|
|
109
|
+
commit.breaking = commit.message.includes('BREAKING CHANGE') ||
|
|
110
|
+
commit.message.includes('!:') ||
|
|
111
|
+
Boolean(commit.body && commit.body.includes('BREAKING CHANGE'));
|
|
112
|
+
return commit;
|
|
113
|
+
}
|
|
114
|
+
organizeCommits(commits) {
|
|
115
|
+
if (this.config.format === 'conventional') {
|
|
116
|
+
return this.organizeConventionalCommits(commits);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
return this.organizeSimpleCommits(commits);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
organizeConventionalCommits(commits) {
|
|
123
|
+
const sections = [];
|
|
124
|
+
// Breaking changes (always first)
|
|
125
|
+
const breaking = commits.filter(c => c.breaking);
|
|
126
|
+
if (breaking.length > 0) {
|
|
127
|
+
sections.push({
|
|
128
|
+
title: '⚠️ BREAKING CHANGES',
|
|
129
|
+
commits: breaking
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// Features
|
|
133
|
+
const features = commits.filter(c => c.type === 'feat' && !c.breaking);
|
|
134
|
+
if (features.length > 0) {
|
|
135
|
+
sections.push({
|
|
136
|
+
title: '✨ Features',
|
|
137
|
+
commits: features
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Bug fixes
|
|
141
|
+
const fixes = commits.filter(c => c.type === 'fix' && !c.breaking);
|
|
142
|
+
if (fixes.length > 0) {
|
|
143
|
+
sections.push({
|
|
144
|
+
title: '🐛 Bug Fixes',
|
|
145
|
+
commits: fixes
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Documentation
|
|
149
|
+
const docs = commits.filter(c => c.type === 'docs');
|
|
150
|
+
if (docs.length > 0) {
|
|
151
|
+
sections.push({
|
|
152
|
+
title: '📚 Documentation',
|
|
153
|
+
commits: docs
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
// Performance improvements
|
|
157
|
+
const perf = commits.filter(c => c.type === 'perf');
|
|
158
|
+
if (perf.length > 0) {
|
|
159
|
+
sections.push({
|
|
160
|
+
title: '⚡ Performance',
|
|
161
|
+
commits: perf
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// Refactoring
|
|
165
|
+
const refactor = commits.filter(c => c.type === 'refactor');
|
|
166
|
+
if (refactor.length > 0) {
|
|
167
|
+
sections.push({
|
|
168
|
+
title: '♻️ Code Refactoring',
|
|
169
|
+
commits: refactor
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
// Tests
|
|
173
|
+
const tests = commits.filter(c => c.type === 'test');
|
|
174
|
+
if (tests.length > 0) {
|
|
175
|
+
sections.push({
|
|
176
|
+
title: '✅ Tests',
|
|
177
|
+
commits: tests
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
// Build/CI
|
|
181
|
+
const build = commits.filter(c => ['build', 'ci', 'chore'].includes(c.type || ''));
|
|
182
|
+
if (build.length > 0) {
|
|
183
|
+
sections.push({
|
|
184
|
+
title: '🔧 Build & CI',
|
|
185
|
+
commits: build
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Other changes
|
|
189
|
+
const other = commits.filter(c => !c.breaking &&
|
|
190
|
+
!['feat', 'fix', 'docs', 'perf', 'refactor', 'test', 'build', 'ci', 'chore'].includes(c.type || ''));
|
|
191
|
+
if (other.length > 0) {
|
|
192
|
+
sections.push({
|
|
193
|
+
title: '📝 Other Changes',
|
|
194
|
+
commits: other
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return sections;
|
|
198
|
+
}
|
|
199
|
+
organizeSimpleCommits(commits) {
|
|
200
|
+
return [{
|
|
201
|
+
title: '📝 Changes',
|
|
202
|
+
commits
|
|
203
|
+
}];
|
|
204
|
+
}
|
|
205
|
+
generateChangelogHeader() {
|
|
206
|
+
return `# Changelog
|
|
207
|
+
|
|
208
|
+
All notable changes to this project will be documented in this file.
|
|
209
|
+
|
|
210
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
211
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
212
|
+
|
|
213
|
+
`;
|
|
214
|
+
}
|
|
215
|
+
generateChangelogContent(sections) {
|
|
216
|
+
const version = this.generateVersionNumber();
|
|
217
|
+
const date = new Date().toISOString().split('T')[0];
|
|
218
|
+
let content = `## [${version}] - ${date}\n\n`;
|
|
219
|
+
sections.forEach(section => {
|
|
220
|
+
if (section.commits.length > 0) {
|
|
221
|
+
content += `### ${section.title}\n\n`;
|
|
222
|
+
section.commits.forEach(commit => {
|
|
223
|
+
const scope = commit.scope ? `**${commit.scope}**: ` : '';
|
|
224
|
+
const hash = `([${commit.hash}])`;
|
|
225
|
+
if (this.config.format === 'conventional') {
|
|
226
|
+
content += `- ${scope}${commit.message} ${hash}\n`;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
content += `- ${commit.message} - ${commit.author} ${hash}\n`;
|
|
230
|
+
}
|
|
231
|
+
// Add breaking change details
|
|
232
|
+
if (commit.breaking && commit.body) {
|
|
233
|
+
const breakingDetails = this.extractBreakingChangeDetails(commit.body);
|
|
234
|
+
if (breakingDetails) {
|
|
235
|
+
content += ` - ⚠️ ${breakingDetails}\n`;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
content += '\n';
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
return content;
|
|
243
|
+
}
|
|
244
|
+
generateVersionNumber() {
|
|
245
|
+
// Simple version generation - could be enhanced to read from package.json
|
|
246
|
+
// and increment based on commit types
|
|
247
|
+
const now = new Date();
|
|
248
|
+
return `${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}`;
|
|
249
|
+
}
|
|
250
|
+
extractBreakingChangeDetails(body) {
|
|
251
|
+
const match = body.match(/BREAKING CHANGE:\s*(.+)/);
|
|
252
|
+
return match ? match[1].trim() : null;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=changelog-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changelog-generator.js","sourceRoot":"","sources":["../../../src/tools/documentation/changelog-generator.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AA0BhC,MAAM,OAAO,kBAAkB;IAG7B,YA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,IAAI,CAAC;wBAC3C,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,CAAC;gBAEH,OAAO,IAAI,IAAI,CAAC;YAClB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,qBAAqB;QAC3B,0EAA0E;QAC1E,sCAAsC;QACtC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;IACvE,CAAC;IAEO,4BAA4B,CAAC,IAAY;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACpD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ClaudeMdParser {
|
|
2
|
+
parseClaude(rootPath: string): Promise<{
|
|
3
|
+
exists: boolean;
|
|
4
|
+
content: string;
|
|
5
|
+
hasDocumentationSection: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
updateClaude(rootPath: string, documentationSection: string): Promise<{
|
|
8
|
+
success: boolean;
|
|
9
|
+
message: string;
|
|
10
|
+
}>;
|
|
11
|
+
generateDocumentationSection(): string;
|
|
12
|
+
}
|
|
13
|
+
export declare class ClaudeMdParserImpl implements ClaudeMdParser {
|
|
14
|
+
parseClaude(rootPath: string): Promise<{
|
|
15
|
+
exists: boolean;
|
|
16
|
+
content: string;
|
|
17
|
+
hasDocumentationSection: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
updateClaude(rootPath: string, documentationSection: string): Promise<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
message: string;
|
|
22
|
+
}>;
|
|
23
|
+
generateDocumentationSection(): string;
|
|
24
|
+
}
|
|
25
|
+
export declare const claudeMdParser: ClaudeMdParserImpl;
|