@eldrforge/kodrdriv 0.0.13 → 0.0.15
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/.kodrdriv/context/content.md +7 -1
- package/RELEASE_NOTES.md +14 -0
- package/dist/arguments.js +332 -9
- package/dist/arguments.js.map +1 -1
- package/dist/commands/audio-commit.js +666 -0
- package/dist/commands/audio-commit.js.map +1 -0
- package/dist/commands/audio-review.js +677 -0
- package/dist/commands/audio-review.js.map +1 -0
- package/dist/commands/clean.js +36 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/commit.js +32 -7
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/publish.js +15 -7
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.js +31 -3
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/review.js +152 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/constants.js +90 -59
- package/dist/constants.js.map +1 -1
- package/dist/content/diff.js +155 -1
- package/dist/content/diff.js.map +1 -1
- package/dist/content/issues.js +240 -0
- package/dist/content/issues.js.map +1 -0
- package/dist/content/releaseNotes.js +90 -0
- package/dist/content/releaseNotes.js.map +1 -0
- package/dist/main.js +23 -10
- package/dist/main.js.map +1 -1
- package/dist/prompt/instructions/commit.md +18 -15
- package/dist/prompt/instructions/release.md +6 -5
- package/dist/prompt/instructions/review.md +108 -0
- package/dist/prompt/personas/reviewer.md +29 -0
- package/dist/prompt/prompts.js +110 -13
- package/dist/prompt/prompts.js.map +1 -1
- package/dist/types.js +36 -1
- package/dist/types.js.map +1 -1
- package/dist/util/general.js +35 -2
- package/dist/util/general.js.map +1 -1
- package/dist/util/github.js +54 -1
- package/dist/util/github.js.map +1 -1
- package/dist/util/openai.js +68 -4
- package/dist/util/openai.js.map +1 -1
- package/dist/util/stdin.js +61 -0
- package/dist/util/stdin.js.map +1 -0
- package/dist/util/storage.js +20 -1
- package/dist/util/storage.js.map +1 -1
- package/docs/public/commands.md +20 -0
- package/output/kodrdriv/250702-0552-release-notes.md +3 -0
- package/package.json +7 -6
- package/pnpm-workspace.yaml +2 -0
- package/vitest.config.ts +4 -4
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { getLogger } from '../logging.js';
|
|
2
|
+
import { getOpenIssues, createIssue } from '../util/github.js';
|
|
3
|
+
|
|
4
|
+
// Get GitHub issues content
|
|
5
|
+
const get = async (options = {})=>{
|
|
6
|
+
const logger = getLogger();
|
|
7
|
+
const { limit = 20 } = options;
|
|
8
|
+
try {
|
|
9
|
+
logger.debug('Fetching open GitHub issues...');
|
|
10
|
+
const issuesLimit = Math.min(limit, 20); // Cap at 20
|
|
11
|
+
const githubIssues = await getOpenIssues(issuesLimit);
|
|
12
|
+
if (githubIssues.trim()) {
|
|
13
|
+
logger.debug('Added GitHub issues to context (%d characters)', githubIssues.length);
|
|
14
|
+
return githubIssues;
|
|
15
|
+
} else {
|
|
16
|
+
logger.debug('No open GitHub issues found');
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
} catch (error) {
|
|
20
|
+
logger.warn('Failed to fetch GitHub issues: %s', error.message);
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
// Helper function to get user choice interactively
|
|
25
|
+
async function getUserChoice(prompt, choices) {
|
|
26
|
+
const logger = getLogger();
|
|
27
|
+
logger.info(prompt);
|
|
28
|
+
choices.forEach((choice)=>{
|
|
29
|
+
logger.info(` [${choice.key}] ${choice.label}`);
|
|
30
|
+
});
|
|
31
|
+
logger.info('');
|
|
32
|
+
return new Promise((resolve)=>{
|
|
33
|
+
process.stdin.setRawMode(true);
|
|
34
|
+
process.stdin.resume();
|
|
35
|
+
process.stdin.on('data', (key)=>{
|
|
36
|
+
const keyStr = key.toString().toLowerCase();
|
|
37
|
+
const choice = choices.find((c)=>c.key === keyStr);
|
|
38
|
+
if (choice) {
|
|
39
|
+
process.stdin.setRawMode(false);
|
|
40
|
+
process.stdin.pause();
|
|
41
|
+
logger.info(`Selected: ${choice.label}\n`);
|
|
42
|
+
resolve(choice.key);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// Helper function to edit issue interactively
|
|
48
|
+
async function editIssueInteractively(issue) {
|
|
49
|
+
const logger = getLogger();
|
|
50
|
+
const readline = await import('readline');
|
|
51
|
+
const rl = readline.createInterface({
|
|
52
|
+
input: process.stdin,
|
|
53
|
+
output: process.stdout
|
|
54
|
+
});
|
|
55
|
+
const question = (prompt)=>{
|
|
56
|
+
return new Promise((resolve)=>{
|
|
57
|
+
rl.question(prompt, resolve);
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
logger.info('📝 Edit issue details (press Enter to keep current value):');
|
|
62
|
+
const newTitle = await question(`Title [${issue.title}]: `);
|
|
63
|
+
const newDescription = await question(`Description [${issue.description}]: `);
|
|
64
|
+
const newPriority = await question(`Priority (low/medium/high) [${issue.priority}]: `);
|
|
65
|
+
const newCategory = await question(`Category (ui/content/functionality/accessibility/performance/other) [${issue.category}]: `);
|
|
66
|
+
const updatedIssue = {
|
|
67
|
+
title: newTitle.trim() || issue.title,
|
|
68
|
+
description: newDescription.trim() || issue.description,
|
|
69
|
+
priority: newPriority.trim() || issue.priority,
|
|
70
|
+
category: newCategory.trim() || issue.category,
|
|
71
|
+
suggestions: issue.suggestions
|
|
72
|
+
};
|
|
73
|
+
logger.info('✅ Issue updated successfully');
|
|
74
|
+
return updatedIssue;
|
|
75
|
+
} finally{
|
|
76
|
+
rl.close();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Helper function to format issue body for GitHub
|
|
80
|
+
function formatIssueBody(issue) {
|
|
81
|
+
let body = `## Description\n\n${issue.description}\n\n`;
|
|
82
|
+
body += `## Details\n\n`;
|
|
83
|
+
body += `- **Priority:** ${issue.priority}\n`;
|
|
84
|
+
body += `- **Category:** ${issue.category}\n`;
|
|
85
|
+
body += `- **Source:** Review\n\n`;
|
|
86
|
+
if (issue.suggestions && issue.suggestions.length > 0) {
|
|
87
|
+
body += `## Suggestions\n\n`;
|
|
88
|
+
issue.suggestions.forEach((suggestion)=>{
|
|
89
|
+
body += `- ${suggestion}\n`;
|
|
90
|
+
});
|
|
91
|
+
body += '\n';
|
|
92
|
+
}
|
|
93
|
+
body += `---\n\n`;
|
|
94
|
+
body += `*This issue was automatically created from a review session.*`;
|
|
95
|
+
return body;
|
|
96
|
+
}
|
|
97
|
+
// Helper function to format results with created GitHub issues
|
|
98
|
+
function formatReviewResultsWithIssues(result, createdIssues) {
|
|
99
|
+
let output = `📝 Review Results\n\n`;
|
|
100
|
+
output += `📋 Summary: ${result.summary}\n`;
|
|
101
|
+
output += `📊 Total Issues Found: ${result.totalIssues}\n`;
|
|
102
|
+
output += `🚀 GitHub Issues Created: ${createdIssues.length}\n\n`;
|
|
103
|
+
if (result.issues && result.issues.length > 0) {
|
|
104
|
+
output += `📝 Issues Identified:\n\n`;
|
|
105
|
+
result.issues.forEach((issue, index)=>{
|
|
106
|
+
const priorityEmoji = issue.priority === 'high' ? '🔴' : issue.priority === 'medium' ? '🟡' : '🟢';
|
|
107
|
+
const categoryEmoji = issue.category === 'ui' ? '🎨' : issue.category === 'content' ? '📝' : issue.category === 'functionality' ? '⚙️' : issue.category === 'accessibility' ? '♿' : issue.category === 'performance' ? '⚡' : '🔧';
|
|
108
|
+
output += `${index + 1}. ${priorityEmoji} ${issue.title}\n`;
|
|
109
|
+
output += ` ${categoryEmoji} Category: ${issue.category} | Priority: ${issue.priority}\n`;
|
|
110
|
+
output += ` 📖 Description: ${issue.description}\n`;
|
|
111
|
+
// Check if this issue was created as a GitHub issue
|
|
112
|
+
const createdIssue = createdIssues.find((ci)=>ci.issue === issue);
|
|
113
|
+
if (createdIssue) {
|
|
114
|
+
output += ` 🔗 GitHub Issue: #${createdIssue.number} - ${createdIssue.githubUrl}\n`;
|
|
115
|
+
}
|
|
116
|
+
if (issue.suggestions && issue.suggestions.length > 0) {
|
|
117
|
+
output += ` 💡 Suggestions:\n`;
|
|
118
|
+
issue.suggestions.forEach((suggestion)=>{
|
|
119
|
+
output += ` • ${suggestion}\n`;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
output += `\n`;
|
|
123
|
+
});
|
|
124
|
+
} else {
|
|
125
|
+
output += `✅ No specific issues identified from the review.\n\n`;
|
|
126
|
+
}
|
|
127
|
+
if (createdIssues.length > 0) {
|
|
128
|
+
output += `\n🎯 Created GitHub Issues:\n`;
|
|
129
|
+
createdIssues.forEach((createdIssue)=>{
|
|
130
|
+
output += `• #${createdIssue.number}: ${createdIssue.issue.title} - ${createdIssue.githubUrl}\n`;
|
|
131
|
+
});
|
|
132
|
+
output += `\n`;
|
|
133
|
+
}
|
|
134
|
+
output += `🚀 Next Steps: Review the created GitHub issues and prioritize them in your development workflow.`;
|
|
135
|
+
return output;
|
|
136
|
+
}
|
|
137
|
+
function formatReviewResults(result) {
|
|
138
|
+
let output = `📝 Review Results\n\n`;
|
|
139
|
+
output += `📋 Summary: ${result.summary}\n`;
|
|
140
|
+
output += `📊 Total Issues Found: ${result.totalIssues}\n\n`;
|
|
141
|
+
if (result.issues && result.issues.length > 0) {
|
|
142
|
+
output += `📝 Issues Identified:\n\n`;
|
|
143
|
+
result.issues.forEach((issue, index)=>{
|
|
144
|
+
const priorityEmoji = issue.priority === 'high' ? '🔴' : issue.priority === 'medium' ? '🟡' : '🟢';
|
|
145
|
+
const categoryEmoji = issue.category === 'ui' ? '🎨' : issue.category === 'content' ? '📝' : issue.category === 'functionality' ? '⚙️' : issue.category === 'accessibility' ? '♿' : issue.category === 'performance' ? '⚡' : '🔧';
|
|
146
|
+
output += `${index + 1}. ${priorityEmoji} ${issue.title}\n`;
|
|
147
|
+
output += ` ${categoryEmoji} Category: ${issue.category} | Priority: ${issue.priority}\n`;
|
|
148
|
+
output += ` 📖 Description: ${issue.description}\n`;
|
|
149
|
+
if (issue.suggestions && issue.suggestions.length > 0) {
|
|
150
|
+
output += ` 💡 Suggestions:\n`;
|
|
151
|
+
issue.suggestions.forEach((suggestion)=>{
|
|
152
|
+
output += ` • ${suggestion}\n`;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
output += `\n`;
|
|
156
|
+
});
|
|
157
|
+
} else {
|
|
158
|
+
output += `✅ No specific issues identified from the review.\n\n`;
|
|
159
|
+
}
|
|
160
|
+
output += `🚀 Next Steps: Review the identified issues and prioritize them for your development workflow.`;
|
|
161
|
+
return output;
|
|
162
|
+
}
|
|
163
|
+
// Handle GitHub issue creation workflow
|
|
164
|
+
const handleIssueCreation = async (result, senditMode = false)=>{
|
|
165
|
+
const logger = getLogger();
|
|
166
|
+
const createdIssues = [];
|
|
167
|
+
if (!result.issues || result.issues.length === 0) {
|
|
168
|
+
return formatReviewResults(result);
|
|
169
|
+
}
|
|
170
|
+
logger.info(`🔍 Found ${result.issues.length} issues to potentially create as GitHub issues`);
|
|
171
|
+
for(let i = 0; i < result.issues.length; i++){
|
|
172
|
+
const issue = result.issues[i];
|
|
173
|
+
let shouldCreateIssue = senditMode;
|
|
174
|
+
if (!senditMode) {
|
|
175
|
+
// Interactive confirmation for each issue
|
|
176
|
+
logger.info(`\n📋 Issue ${i + 1} of ${result.issues.length}:`);
|
|
177
|
+
logger.info(` Title: ${issue.title}`);
|
|
178
|
+
logger.info(` Priority: ${issue.priority} | Category: ${issue.category}`);
|
|
179
|
+
logger.info(` Description: ${issue.description}`);
|
|
180
|
+
if (issue.suggestions && issue.suggestions.length > 0) {
|
|
181
|
+
logger.info(` Suggestions: ${issue.suggestions.join(', ')}`);
|
|
182
|
+
}
|
|
183
|
+
// Get user choice
|
|
184
|
+
const choice = await getUserChoice('\nWhat would you like to do with this issue?', [
|
|
185
|
+
{
|
|
186
|
+
key: 'c',
|
|
187
|
+
label: 'Create GitHub issue'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: 's',
|
|
191
|
+
label: 'Skip this issue'
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
key: 'e',
|
|
195
|
+
label: 'Edit issue details'
|
|
196
|
+
}
|
|
197
|
+
]);
|
|
198
|
+
if (choice === 'c') {
|
|
199
|
+
shouldCreateIssue = true;
|
|
200
|
+
} else if (choice === 'e') {
|
|
201
|
+
// Allow user to edit the issue
|
|
202
|
+
const editedIssue = await editIssueInteractively(issue);
|
|
203
|
+
result.issues[i] = editedIssue;
|
|
204
|
+
shouldCreateIssue = true;
|
|
205
|
+
}
|
|
206
|
+
// If choice is 's', shouldCreateIssue remains false
|
|
207
|
+
}
|
|
208
|
+
if (shouldCreateIssue) {
|
|
209
|
+
try {
|
|
210
|
+
logger.info(`🚀 Creating GitHub issue: "${issue.title}"`);
|
|
211
|
+
// Format issue body with additional details
|
|
212
|
+
const issueBody = formatIssueBody(issue);
|
|
213
|
+
// Create labels based on priority and category
|
|
214
|
+
const labels = [
|
|
215
|
+
`priority-${issue.priority}`,
|
|
216
|
+
`category-${issue.category}`,
|
|
217
|
+
'review'
|
|
218
|
+
];
|
|
219
|
+
const createdIssue = await createIssue(issue.title, issueBody, labels);
|
|
220
|
+
createdIssues.push({
|
|
221
|
+
issue,
|
|
222
|
+
githubUrl: createdIssue.html_url,
|
|
223
|
+
number: createdIssue.number
|
|
224
|
+
});
|
|
225
|
+
logger.info(`✅ Created GitHub issue #${createdIssue.number}: ${createdIssue.html_url}`);
|
|
226
|
+
} catch (error) {
|
|
227
|
+
logger.error(`❌ Failed to create GitHub issue for "${issue.title}": ${error.message}`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// Return formatted results
|
|
232
|
+
if (createdIssues.length > 0) {
|
|
233
|
+
return formatReviewResultsWithIssues(result, createdIssues);
|
|
234
|
+
} else {
|
|
235
|
+
return formatReviewResults(result);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export { get, handleIssueCreation };
|
|
240
|
+
//# sourceMappingURL=issues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issues.js","sources":["../../src/content/issues.ts"],"sourcesContent":["import { getLogger } from '../logging';\nimport { getOpenIssues, createIssue } from '../util/github';\n\nexport interface Issue {\n title: string;\n description: string;\n priority: 'low' | 'medium' | 'high';\n category: 'ui' | 'content' | 'functionality' | 'accessibility' | 'performance' | 'other';\n suggestions?: string[];\n}\n\nexport interface ReviewResult {\n summary: string;\n totalIssues: number;\n issues: Issue[];\n}\n\n// Get GitHub issues content\nexport const get = async (options: { limit?: number } = {}): Promise<string> => {\n const logger = getLogger();\n const { limit = 20 } = options;\n\n try {\n logger.debug('Fetching open GitHub issues...');\n const issuesLimit = Math.min(limit, 20); // Cap at 20\n const githubIssues = await getOpenIssues(issuesLimit);\n\n if (githubIssues.trim()) {\n logger.debug('Added GitHub issues to context (%d characters)', githubIssues.length);\n return githubIssues;\n } else {\n logger.debug('No open GitHub issues found');\n return '';\n }\n } catch (error: any) {\n logger.warn('Failed to fetch GitHub issues: %s', error.message);\n return '';\n }\n};\n\n// Helper function to get user choice interactively\nasync function getUserChoice(prompt: string, choices: Array<{ key: string, label: string }>): Promise<string> {\n const logger = getLogger();\n\n logger.info(prompt);\n choices.forEach(choice => {\n logger.info(` [${choice.key}] ${choice.label}`);\n });\n logger.info('');\n\n return new Promise(resolve => {\n process.stdin.setRawMode(true);\n process.stdin.resume();\n process.stdin.on('data', (key) => {\n const keyStr = key.toString().toLowerCase();\n const choice = choices.find(c => c.key === keyStr);\n if (choice) {\n process.stdin.setRawMode(false);\n process.stdin.pause();\n logger.info(`Selected: ${choice.label}\\n`);\n resolve(choice.key);\n }\n });\n });\n}\n\n// Helper function to edit issue interactively\nasync function editIssueInteractively(issue: Issue): Promise<Issue> {\n const logger = getLogger();\n const readline = await import('readline');\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n const question = (prompt: string): Promise<string> => {\n return new Promise(resolve => {\n rl.question(prompt, resolve);\n });\n };\n\n try {\n logger.info('📝 Edit issue details (press Enter to keep current value):');\n\n const newTitle = await question(`Title [${issue.title}]: `);\n const newDescription = await question(`Description [${issue.description}]: `);\n const newPriority = await question(`Priority (low/medium/high) [${issue.priority}]: `);\n const newCategory = await question(`Category (ui/content/functionality/accessibility/performance/other) [${issue.category}]: `);\n\n const updatedIssue: Issue = {\n title: newTitle.trim() || issue.title,\n description: newDescription.trim() || issue.description,\n priority: (newPriority.trim() as any) || issue.priority,\n category: (newCategory.trim() as any) || issue.category,\n suggestions: issue.suggestions\n };\n\n logger.info('✅ Issue updated successfully');\n return updatedIssue;\n } finally {\n rl.close();\n }\n}\n\n// Helper function to format issue body for GitHub\nfunction formatIssueBody(issue: Issue): string {\n let body = `## Description\\n\\n${issue.description}\\n\\n`;\n\n body += `## Details\\n\\n`;\n body += `- **Priority:** ${issue.priority}\\n`;\n body += `- **Category:** ${issue.category}\\n`;\n body += `- **Source:** Review\\n\\n`;\n\n if (issue.suggestions && issue.suggestions.length > 0) {\n body += `## Suggestions\\n\\n`;\n issue.suggestions.forEach(suggestion => {\n body += `- ${suggestion}\\n`;\n });\n body += '\\n';\n }\n\n body += `---\\n\\n`;\n body += `*This issue was automatically created from a review session.*`;\n\n return body;\n}\n\n// Helper function to format results with created GitHub issues\nfunction formatReviewResultsWithIssues(\n result: ReviewResult,\n createdIssues: Array<{ issue: Issue, githubUrl: string, number: number }>\n): string {\n let output = `📝 Review Results\\n\\n`;\n output += `📋 Summary: ${result.summary}\\n`;\n output += `📊 Total Issues Found: ${result.totalIssues}\\n`;\n output += `🚀 GitHub Issues Created: ${createdIssues.length}\\n\\n`;\n\n if (result.issues && result.issues.length > 0) {\n output += `📝 Issues Identified:\\n\\n`;\n\n result.issues.forEach((issue, index) => {\n const priorityEmoji = issue.priority === 'high' ? '🔴' :\n issue.priority === 'medium' ? '🟡' : '🟢';\n const categoryEmoji = issue.category === 'ui' ? '🎨' :\n issue.category === 'content' ? '📝' :\n issue.category === 'functionality' ? '⚙️' :\n issue.category === 'accessibility' ? '♿' :\n issue.category === 'performance' ? '⚡' : '🔧';\n\n output += `${index + 1}. ${priorityEmoji} ${issue.title}\\n`;\n output += ` ${categoryEmoji} Category: ${issue.category} | Priority: ${issue.priority}\\n`;\n output += ` 📖 Description: ${issue.description}\\n`;\n\n // Check if this issue was created as a GitHub issue\n const createdIssue = createdIssues.find(ci => ci.issue === issue);\n if (createdIssue) {\n output += ` 🔗 GitHub Issue: #${createdIssue.number} - ${createdIssue.githubUrl}\\n`;\n }\n\n if (issue.suggestions && issue.suggestions.length > 0) {\n output += ` 💡 Suggestions:\\n`;\n issue.suggestions.forEach(suggestion => {\n output += ` • ${suggestion}\\n`;\n });\n }\n output += `\\n`;\n });\n } else {\n output += `✅ No specific issues identified from the review.\\n\\n`;\n }\n\n if (createdIssues.length > 0) {\n output += `\\n🎯 Created GitHub Issues:\\n`;\n createdIssues.forEach(createdIssue => {\n output += `• #${createdIssue.number}: ${createdIssue.issue.title} - ${createdIssue.githubUrl}\\n`;\n });\n output += `\\n`;\n }\n\n output += `🚀 Next Steps: Review the created GitHub issues and prioritize them in your development workflow.`;\n\n return output;\n}\n\nfunction formatReviewResults(result: ReviewResult): string {\n let output = `📝 Review Results\\n\\n`;\n output += `📋 Summary: ${result.summary}\\n`;\n output += `📊 Total Issues Found: ${result.totalIssues}\\n\\n`;\n\n if (result.issues && result.issues.length > 0) {\n output += `📝 Issues Identified:\\n\\n`;\n\n result.issues.forEach((issue, index) => {\n const priorityEmoji = issue.priority === 'high' ? '🔴' :\n issue.priority === 'medium' ? '🟡' : '🟢';\n const categoryEmoji = issue.category === 'ui' ? '🎨' :\n issue.category === 'content' ? '📝' :\n issue.category === 'functionality' ? '⚙️' :\n issue.category === 'accessibility' ? '♿' :\n issue.category === 'performance' ? '⚡' : '🔧';\n\n output += `${index + 1}. ${priorityEmoji} ${issue.title}\\n`;\n output += ` ${categoryEmoji} Category: ${issue.category} | Priority: ${issue.priority}\\n`;\n output += ` 📖 Description: ${issue.description}\\n`;\n\n if (issue.suggestions && issue.suggestions.length > 0) {\n output += ` 💡 Suggestions:\\n`;\n issue.suggestions.forEach(suggestion => {\n output += ` • ${suggestion}\\n`;\n });\n }\n output += `\\n`;\n });\n } else {\n output += `✅ No specific issues identified from the review.\\n\\n`;\n }\n\n output += `🚀 Next Steps: Review the identified issues and prioritize them for your development workflow.`;\n\n return output;\n}\n\n// Handle GitHub issue creation workflow\nexport const handleIssueCreation = async (\n result: ReviewResult,\n senditMode: boolean = false\n): Promise<string> => {\n const logger = getLogger();\n const createdIssues: Array<{ issue: Issue, githubUrl: string, number: number }> = [];\n\n if (!result.issues || result.issues.length === 0) {\n return formatReviewResults(result);\n }\n\n logger.info(`🔍 Found ${result.issues.length} issues to potentially create as GitHub issues`);\n\n for (let i = 0; i < result.issues.length; i++) {\n const issue = result.issues[i];\n let shouldCreateIssue = senditMode;\n\n if (!senditMode) {\n // Interactive confirmation for each issue\n logger.info(`\\n📋 Issue ${i + 1} of ${result.issues.length}:`);\n logger.info(` Title: ${issue.title}`);\n logger.info(` Priority: ${issue.priority} | Category: ${issue.category}`);\n logger.info(` Description: ${issue.description}`);\n if (issue.suggestions && issue.suggestions.length > 0) {\n logger.info(` Suggestions: ${issue.suggestions.join(', ')}`);\n }\n\n // Get user choice\n const choice = await getUserChoice('\\nWhat would you like to do with this issue?', [\n { key: 'c', label: 'Create GitHub issue' },\n { key: 's', label: 'Skip this issue' },\n { key: 'e', label: 'Edit issue details' }\n ]);\n\n if (choice === 'c') {\n shouldCreateIssue = true;\n } else if (choice === 'e') {\n // Allow user to edit the issue\n const editedIssue = await editIssueInteractively(issue);\n result.issues[i] = editedIssue;\n shouldCreateIssue = true;\n }\n // If choice is 's', shouldCreateIssue remains false\n }\n\n if (shouldCreateIssue) {\n try {\n logger.info(`🚀 Creating GitHub issue: \"${issue.title}\"`);\n\n // Format issue body with additional details\n const issueBody = formatIssueBody(issue);\n\n // Create labels based on priority and category\n const labels = [\n `priority-${issue.priority}`,\n `category-${issue.category}`,\n 'review'\n ];\n\n const createdIssue = await createIssue(issue.title, issueBody, labels);\n createdIssues.push({\n issue,\n githubUrl: createdIssue.html_url,\n number: createdIssue.number\n });\n\n logger.info(`✅ Created GitHub issue #${createdIssue.number}: ${createdIssue.html_url}`);\n } catch (error: any) {\n logger.error(`❌ Failed to create GitHub issue for \"${issue.title}\": ${error.message}`);\n }\n }\n }\n\n // Return formatted results\n if (createdIssues.length > 0) {\n return formatReviewResultsWithIssues(result, createdIssues);\n } else {\n return formatReviewResults(result);\n }\n}; "],"names":["get","options","logger","getLogger","limit","debug","issuesLimit","Math","min","githubIssues","getOpenIssues","trim","length","error","warn","message","getUserChoice","prompt","choices","info","forEach","choice","key","label","Promise","resolve","process","stdin","setRawMode","resume","on","keyStr","toString","toLowerCase","find","c","pause","editIssueInteractively","issue","readline","rl","createInterface","input","output","stdout","question","newTitle","title","newDescription","description","newPriority","priority","newCategory","category","updatedIssue","suggestions","close","formatIssueBody","body","suggestion","formatReviewResultsWithIssues","result","createdIssues","summary","totalIssues","issues","index","priorityEmoji","categoryEmoji","createdIssue","ci","number","githubUrl","formatReviewResults","handleIssueCreation","senditMode","i","shouldCreateIssue","join","editedIssue","issueBody","labels","createIssue","push","html_url"],"mappings":";;;AAiBA;AACO,MAAMA,GAAAA,GAAM,OAAOC,OAAAA,GAA8B,EAAE,GAAA;AACtD,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;AACf,IAAA,MAAM,EAAEC,KAAAA,GAAQ,EAAE,EAAE,GAAGH,OAAAA;IAEvB,IAAI;AACAC,QAAAA,MAAAA,CAAOG,KAAK,CAAC,gCAAA,CAAA;AACb,QAAA,MAAMC,cAAcC,IAAAA,CAAKC,GAAG,CAACJ,KAAAA,EAAO;QACpC,MAAMK,YAAAA,GAAe,MAAMC,aAAAA,CAAcJ,WAAAA,CAAAA;QAEzC,IAAIG,YAAAA,CAAaE,IAAI,EAAA,EAAI;AACrBT,YAAAA,MAAAA,CAAO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,MAAM,CAAC,EAAE,EAAEF,YAAAA,CAAae,QAAQ,CAAA,CAAE,CAAA;AAC1F,aAAA,CAAE,OAAOvE,KAAAA,EAAY;AACjBX,gBAAAA,MAAAA,CAAOW,KAAK,CAAC,CAAC,qCAAqC,EAAEyB,KAAAA,CAAMS,KAAK,CAAC,GAAG,EAAElC,KAAAA,CAAME,OAAO,CAAA,CAAE,CAAA;AACzF;AACJ;AACJ;;IAGA,IAAI+C,aAAAA,CAAclD,MAAM,GAAG,CAAA,EAAG;AAC1B,QAAA,OAAOgD,8BAA8BC,MAAAA,EAAQC,aAAAA,CAAAA;KACjD,MAAO;AACH,QAAA,OAAOW,mBAAAA,CAAoBZ,MAAAA,CAAAA;AAC/B;AACJ;;;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { getLogger } from '../logging.js';
|
|
2
|
+
import { getOctokit, getRepoDetails } from '../util/github.js';
|
|
3
|
+
|
|
4
|
+
// Function to truncate overly large content while preserving structure
|
|
5
|
+
const truncateContent = (content, maxLength = 3000)=>{
|
|
6
|
+
if (content.length <= maxLength) {
|
|
7
|
+
return content;
|
|
8
|
+
}
|
|
9
|
+
const lines = content.split('\n');
|
|
10
|
+
const truncatedLines = [];
|
|
11
|
+
let currentLength = 0;
|
|
12
|
+
for (const line of lines){
|
|
13
|
+
if (currentLength + line.length + 1 > maxLength) {
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
truncatedLines.push(line);
|
|
17
|
+
currentLength += line.length + 1; // +1 for newline
|
|
18
|
+
}
|
|
19
|
+
truncatedLines.push('');
|
|
20
|
+
truncatedLines.push(`... [TRUNCATED: Original content was ${content.length} characters, showing first ${currentLength}] ...`);
|
|
21
|
+
return truncatedLines.join('\n');
|
|
22
|
+
};
|
|
23
|
+
// Function to fetch recent releases from GitHub API
|
|
24
|
+
const findRecentReleaseNotes = async (limit)=>{
|
|
25
|
+
const logger = getLogger();
|
|
26
|
+
const releaseNotes = [];
|
|
27
|
+
if (limit <= 0) {
|
|
28
|
+
return releaseNotes;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const octokit = getOctokit();
|
|
32
|
+
const { owner, repo } = await getRepoDetails();
|
|
33
|
+
logger.debug(`Fetching up to ${limit} recent releases from GitHub...`);
|
|
34
|
+
const response = await octokit.repos.listReleases({
|
|
35
|
+
owner,
|
|
36
|
+
repo,
|
|
37
|
+
per_page: Math.min(limit, 100)
|
|
38
|
+
});
|
|
39
|
+
const releases = response.data;
|
|
40
|
+
if (releases.length === 0) {
|
|
41
|
+
logger.debug('No releases found in GitHub repository');
|
|
42
|
+
return releaseNotes;
|
|
43
|
+
}
|
|
44
|
+
for (const release of releases.slice(0, limit)){
|
|
45
|
+
const releaseContent = [
|
|
46
|
+
`# ${release.name || release.tag_name}`,
|
|
47
|
+
`**Tag:** ${release.tag_name}`,
|
|
48
|
+
`**Published:** ${release.published_at}`,
|
|
49
|
+
release.prerelease ? '**Type:** Pre-release' : '**Type:** Release',
|
|
50
|
+
release.draft ? '**Status:** Draft' : '**Status:** Published',
|
|
51
|
+
'',
|
|
52
|
+
release.body || 'No release notes provided'
|
|
53
|
+
].join('\n');
|
|
54
|
+
const truncatedContent = truncateContent(releaseContent);
|
|
55
|
+
releaseNotes.push(`=== GitHub Release: ${release.tag_name} ===\n${truncatedContent}`);
|
|
56
|
+
if (truncatedContent.length < releaseContent.length) {
|
|
57
|
+
logger.debug(`Found release ${release.tag_name} (%d characters, truncated from %d)`, truncatedContent.length, releaseContent.length);
|
|
58
|
+
} else {
|
|
59
|
+
logger.debug(`Found release ${release.tag_name} (%d characters)`, releaseContent.length);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
logger.debug(`Fetched ${releaseNotes.length} releases from GitHub`);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
logger.warn('Error fetching releases from GitHub API: %s', error.message);
|
|
65
|
+
// If we have a GitHub API error, we could fall back to checking for local release notes
|
|
66
|
+
// This maintains some backward compatibility
|
|
67
|
+
logger.debug('Falling back to local RELEASE_NOTES.md file...');
|
|
68
|
+
try {
|
|
69
|
+
const fs = await import('fs/promises');
|
|
70
|
+
const content = await fs.readFile('RELEASE_NOTES.md', 'utf-8');
|
|
71
|
+
if (content.trim()) {
|
|
72
|
+
const truncatedContent = truncateContent(content);
|
|
73
|
+
releaseNotes.push(`=== Local RELEASE_NOTES.md ===\n${truncatedContent}`);
|
|
74
|
+
logger.debug(`Found local release notes (%d characters)`, content.length);
|
|
75
|
+
}
|
|
76
|
+
} catch {
|
|
77
|
+
// No local file either, return empty array
|
|
78
|
+
logger.debug('No local RELEASE_NOTES.md file found either');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return releaseNotes.slice(0, limit);
|
|
82
|
+
};
|
|
83
|
+
const get = async (options = {})=>{
|
|
84
|
+
const { limit = 3 } = options;
|
|
85
|
+
const releaseNotes = await findRecentReleaseNotes(limit);
|
|
86
|
+
return releaseNotes.join('\n\n');
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { findRecentReleaseNotes, get };
|
|
90
|
+
//# sourceMappingURL=releaseNotes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"releaseNotes.js","sources":["../../src/content/releaseNotes.ts"],"sourcesContent":["import { getLogger } from '../logging';\nimport { getOctokit, getRepoDetails } from '../util/github';\n\n// Function to truncate overly large content while preserving structure\nconst truncateContent = (content: string, maxLength: number = 3000): string => {\n if (content.length <= maxLength) {\n return content;\n }\n\n const lines = content.split('\\n');\n const truncatedLines: string[] = [];\n let currentLength = 0;\n\n for (const line of lines) {\n if (currentLength + line.length + 1 > maxLength) {\n break;\n }\n truncatedLines.push(line);\n currentLength += line.length + 1; // +1 for newline\n }\n\n truncatedLines.push('');\n truncatedLines.push(`... [TRUNCATED: Original content was ${content.length} characters, showing first ${currentLength}] ...`);\n\n return truncatedLines.join('\\n');\n};\n\n// Function to fetch recent releases from GitHub API\nexport const findRecentReleaseNotes = async (limit: number): Promise<string[]> => {\n const logger = getLogger();\n const releaseNotes: string[] = [];\n\n if (limit <= 0) {\n return releaseNotes;\n }\n\n try {\n const octokit = getOctokit();\n const { owner, repo } = await getRepoDetails();\n\n logger.debug(`Fetching up to ${limit} recent releases from GitHub...`);\n\n const response = await octokit.repos.listReleases({\n owner,\n repo,\n per_page: Math.min(limit, 100), // GitHub API limit\n });\n\n const releases = response.data;\n\n if (releases.length === 0) {\n logger.debug('No releases found in GitHub repository');\n return releaseNotes;\n }\n\n for (const release of releases.slice(0, limit)) {\n const releaseContent = [\n `# ${release.name || release.tag_name}`,\n `**Tag:** ${release.tag_name}`,\n `**Published:** ${release.published_at}`,\n release.prerelease ? '**Type:** Pre-release' : '**Type:** Release',\n release.draft ? '**Status:** Draft' : '**Status:** Published',\n '',\n release.body || 'No release notes provided'\n ].join('\\n');\n\n const truncatedContent = truncateContent(releaseContent);\n releaseNotes.push(`=== GitHub Release: ${release.tag_name} ===\\n${truncatedContent}`);\n\n if (truncatedContent.length < releaseContent.length) {\n logger.debug(`Found release ${release.tag_name} (%d characters, truncated from %d)`,\n truncatedContent.length, releaseContent.length);\n } else {\n logger.debug(`Found release ${release.tag_name} (%d characters)`, releaseContent.length);\n }\n }\n\n logger.debug(`Fetched ${releaseNotes.length} releases from GitHub`);\n\n } catch (error: any) {\n logger.warn('Error fetching releases from GitHub API: %s', error.message);\n\n // If we have a GitHub API error, we could fall back to checking for local release notes\n // This maintains some backward compatibility\n logger.debug('Falling back to local RELEASE_NOTES.md file...');\n try {\n const fs = await import('fs/promises');\n const content = await fs.readFile('RELEASE_NOTES.md', 'utf-8');\n if (content.trim()) {\n const truncatedContent = truncateContent(content);\n releaseNotes.push(`=== Local RELEASE_NOTES.md ===\\n${truncatedContent}`);\n logger.debug(`Found local release notes (%d characters)`, content.length);\n }\n } catch {\n // No local file either, return empty array\n logger.debug('No local RELEASE_NOTES.md file found either');\n }\n }\n\n return releaseNotes.slice(0, limit);\n};\n\nexport const get = async (options: { limit?: number } = {}): Promise<string> => {\n const { limit = 3 } = options;\n const releaseNotes = await findRecentReleaseNotes(limit);\n return releaseNotes.join('\\n\\n');\n}; "],"names":["truncateContent","content","maxLength","length","lines","split","truncatedLines","currentLength","line","push","join","findRecentReleaseNotes","limit","logger","getLogger","releaseNotes","octokit","getOctokit","owner","repo","getRepoDetails","debug","response","repos","listReleases","per_page","Math","min","releases","data","release","slice","releaseContent","name","tag_name","published_at","prerelease","draft","body","truncatedContent","error","warn","message","fs","readFile","trim","get","options"],"mappings":";;;AAGA;AACA,MAAMA,eAAAA,GAAkB,CAACC,OAAAA,EAAiBC,SAAAA,GAAoB,IAAI,GAAA;IAC9D,IAAID,OAAAA,CAAQE,MAAM,IAAID,SAAAA,EAAW;QAC7B,OAAOD,OAAAA;AACX;IAEA,MAAMG,KAAAA,GAAQH,OAAAA,CAAQI,KAAK,CAAC,IAAA,CAAA;AAC5B,IAAA,MAAMC,iBAA2B,EAAE;AACnC,IAAA,IAAIC,aAAAA,GAAgB,CAAA;IAEpB,KAAK,MAAMC,QAAQJ,KAAAA,CAAO;AACtB,QAAA,IAAIG,aAAAA,GAAgBC,IAAAA,CAAKL,MAAM,GAAG,IAAID,SAAAA,EAAW;AAC7C,YAAA;AACJ;AACAI,QAAAA,cAAAA,CAAeG,IAAI,CAACD,IAAAA,CAAAA;AACpBD,QAAAA,aAAAA,IAAiBC,IAAAA,CAAKL,MAAM,GAAG,CAAA,CAAA;AACnC;AAEAG,IAAAA,cAAAA,CAAeG,IAAI,CAAC,EAAA,CAAA;AACpBH,IAAAA,cAAAA,CAAeG,IAAI,CAAC,CAAC,qCAAqC,EAAER,OAAAA,CAAQE,MAAM,CAAC,2BAA2B,EAAEI,aAAAA,CAAc,KAAK,CAAC,CAAA;IAE5H,OAAOD,cAAAA,CAAeI,IAAI,CAAC,IAAA,CAAA;AAC/B,CAAA;AAEA;AACO,MAAMC,yBAAyB,OAAOC,KAAAA,GAAAA;AACzC,IAAA,MAAMC,MAAAA,GAASC,SA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aN,IAAI,CAAC,CAAC,gCAAgC,EAAE8B,gBAAAA,CAAAA,CAAkB,CAAA;AACvE1B,gBAAAA,MAAAA,CAAOQ,KAAK,CAAC,CAAC,yCAAyC,CAAC,EAAEpB,QAAQE,MAAM,CAAA;AAC5E;AACJ,SAAA,CAAE,OAAM;;AAEJU,YAAAA,MAAAA,CAAOQ,KAAK,CAAC,6CAAA,CAAA;AACjB;AACJ;IAEA,OAAON,YAAAA,CAAagB,KAAK,CAAC,CAAA,EAAGnB,KAAAA,CAAAA;AACjC;AAEO,MAAMkC,GAAAA,GAAM,OAAOC,OAAAA,GAA8B,EAAE,GAAA;AACtD,IAAA,MAAM,EAAEnC,KAAAA,GAAQ,CAAC,EAAE,GAAGmC,OAAAA;IACtB,MAAMhC,YAAAA,GAAe,MAAMJ,sBAAAA,CAAuBC,KAAAA,CAAAA;IAClD,OAAOG,YAAAA,CAAaL,IAAI,CAAC,MAAA,CAAA;AAC7B;;;;"}
|
package/dist/main.js
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
import * as Cardigantime from '@theunwalked/cardigantime';
|
|
3
3
|
import 'dotenv/config';
|
|
4
4
|
import { configure } from './arguments.js';
|
|
5
|
+
import { execute as execute$1 } from './commands/audio-commit.js';
|
|
6
|
+
import { execute as execute$6 } from './commands/audio-review.js';
|
|
7
|
+
import { execute as execute$7 } from './commands/clean.js';
|
|
5
8
|
import { execute } from './commands/commit.js';
|
|
6
|
-
import { execute as execute$
|
|
7
|
-
import { execute as execute$
|
|
8
|
-
import { execute as execute$
|
|
9
|
-
import { execute as execute$
|
|
10
|
-
import {
|
|
9
|
+
import { execute as execute$4 } from './commands/link.js';
|
|
10
|
+
import { execute as execute$3 } from './commands/publish.js';
|
|
11
|
+
import { execute as execute$2 } from './commands/release.js';
|
|
12
|
+
import { execute as execute$8 } from './commands/review.js';
|
|
13
|
+
import { execute as execute$5 } from './commands/unlink.js';
|
|
14
|
+
import { DEFAULT_CONFIG_DIR, COMMAND_CHECK_CONFIG, COMMAND_INIT_CONFIG, COMMAND_COMMIT, COMMAND_AUDIO_COMMIT, COMMAND_RELEASE, COMMAND_PUBLISH, COMMAND_LINK, COMMAND_UNLINK, COMMAND_AUDIO_REVIEW, COMMAND_CLEAN, COMMAND_REVIEW } from './constants.js';
|
|
11
15
|
import { getLogger, setLogLevel } from './logging.js';
|
|
12
16
|
import { ConfigSchema } from './types.js';
|
|
13
17
|
|
|
@@ -80,21 +84,30 @@ async function main() {
|
|
|
80
84
|
const command = process.argv[2];
|
|
81
85
|
let commandName = commandConfig.commandName;
|
|
82
86
|
// If we have a specific command argument, use that
|
|
83
|
-
if (command === 'commit' || command === 'release' || command === 'publish' || command === 'link' || command === 'unlink') {
|
|
87
|
+
if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review') {
|
|
84
88
|
commandName = command;
|
|
85
89
|
}
|
|
86
90
|
let summary = '';
|
|
87
91
|
if (commandName === COMMAND_COMMIT) {
|
|
88
92
|
summary = await execute(runConfig);
|
|
93
|
+
} else if (commandName === COMMAND_AUDIO_COMMIT) {
|
|
94
|
+
summary = await execute$1(runConfig);
|
|
89
95
|
} else if (commandName === COMMAND_RELEASE) {
|
|
90
|
-
const releaseSummary = await execute$
|
|
96
|
+
const releaseSummary = await execute$2(runConfig);
|
|
91
97
|
summary = `${releaseSummary.title}\n\n${releaseSummary.body}`;
|
|
92
98
|
} else if (commandName === COMMAND_PUBLISH) {
|
|
93
|
-
await execute$
|
|
99
|
+
await execute$3(runConfig);
|
|
94
100
|
} else if (commandName === COMMAND_LINK) {
|
|
95
|
-
summary = await execute$3(runConfig);
|
|
96
|
-
} else if (commandName === COMMAND_UNLINK) {
|
|
97
101
|
summary = await execute$4(runConfig);
|
|
102
|
+
} else if (commandName === COMMAND_UNLINK) {
|
|
103
|
+
summary = await execute$5(runConfig);
|
|
104
|
+
} else if (commandName === COMMAND_AUDIO_REVIEW) {
|
|
105
|
+
summary = await execute$6(runConfig);
|
|
106
|
+
} else if (commandName === COMMAND_CLEAN) {
|
|
107
|
+
await execute$7(runConfig);
|
|
108
|
+
summary = 'Output directory cleaned successfully.';
|
|
109
|
+
} else if (commandName === COMMAND_REVIEW) {
|
|
110
|
+
summary = await execute$8(runConfig);
|
|
98
111
|
}
|
|
99
112
|
// eslint-disable-next-line no-console
|
|
100
113
|
console.log(`\n\n${summary}\n\n`);
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env node\nimport * as Cardigantime from '@theunwalked/cardigantime';\nimport 'dotenv/config';\nimport * as Arguments from './arguments';\nimport * as Commit from './commands/commit';\nimport * as Link from './commands/link';\nimport * as Publish from './commands/publish';\nimport * as Release from './commands/release';\nimport * as Unlink from './commands/unlink';\nimport { COMMAND_CHECK_CONFIG, COMMAND_COMMIT, COMMAND_INIT_CONFIG, COMMAND_LINK, COMMAND_PUBLISH, COMMAND_RELEASE, COMMAND_UNLINK, DEFAULT_CONFIG_DIR } from './constants';\nimport { getLogger, setLogLevel } from './logging';\nimport { CommandConfig } from 'types';\nimport { Config, ConfigSchema, SecureConfig } from './types';\n\n/**\n * Configure early logging based on command line flags.\n * \n * Hey we need this because we need to be able to debug CardiganTime.\n * This method checks for --verbose and --debug flags early in the process\n * before CardiganTime is configured, allowing us to capture debug output\n * from the CardiganTime initialization itself.\n */\nfunction configureEarlyLogging(): void {\n const hasVerbose = process.argv.includes('--verbose');\n const hasDebug = process.argv.includes('--debug');\n\n // Set log level based on early flag detection\n if (hasDebug) {\n setLogLevel('debug');\n } else if (hasVerbose) {\n setLogLevel('verbose');\n }\n}\n\nexport async function main() {\n // Configure logging early, before CardiganTime initialization\n configureEarlyLogging();\n\n const cardigantime = Cardigantime.create({\n defaults: {\n configDirectory: DEFAULT_CONFIG_DIR,\n // Move pathResolution INSIDE defaults\n pathResolution: {\n resolvePathArray: ['contextDirectories'], // Resolve contextDirectories array elements as paths\n },\n // Use fieldOverlaps instead of mergeStrategy, INSIDE defaults\n fieldOverlaps: {\n 'contextDirectories': 'prepend', // Use prepend strategy for contextDirectories array\n // Add other field overlap configurations as needed\n },\n },\n features: ['config', 'hierarchical'],\n configShape: ConfigSchema.shape, // No need for 'as any' now\n logger: getLogger(),\n }); // No need for 'as any' at the end\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [runConfig, secureConfig, commandConfig]: [Config, SecureConfig, CommandConfig] = await Arguments.configure(cardigantime); // Pass cardigantime instance\n\n // Set log level based on verbose flag\n if (runConfig.verbose) {\n setLogLevel('verbose');\n }\n if (runConfig.debug) {\n setLogLevel('debug');\n }\n\n const logger = getLogger();\n cardigantime.setLogger(logger);\n\n try {\n // Handle check-config command first\n if (commandConfig.commandName === COMMAND_CHECK_CONFIG) {\n // CardiganTime's checkConfig has already been called in Arguments.configure()\n // No additional processing needed here\n return;\n }\n\n // Handle init-config command\n if (commandConfig.commandName === COMMAND_INIT_CONFIG) {\n // CardiganTime's initConfig has already been called in Arguments.configure()\n // No additional processing needed here\n return;\n }\n\n // Get the command from Commander\n const command = process.argv[2];\n let commandName = commandConfig.commandName;\n\n // If we have a specific command argument, use that\n if (command === 'commit' || command === 'release' || command === 'publish' || command === 'link' || command === 'unlink') {\n commandName = command;\n }\n\n let summary: string = '';\n\n if (commandName === COMMAND_COMMIT) {\n summary = await Commit.execute(runConfig);\n } else if (commandName === COMMAND_RELEASE) {\n const releaseSummary = await Release.execute(runConfig);\n summary = `${releaseSummary.title}\\n\\n${releaseSummary.body}`;\n } else if (commandName === COMMAND_PUBLISH) {\n await Publish.execute(runConfig);\n } else if (commandName === COMMAND_LINK) {\n summary = await Link.execute(runConfig);\n } else if (commandName === COMMAND_UNLINK) {\n summary = await Unlink.execute(runConfig);\n }\n\n // eslint-disable-next-line no-console\n console.log(`\\n\\n${summary}\\n\\n`);\n\n } catch (error: any) {\n logger.error('Exiting due to Error: %s, %s', error.message, error.stack);\n process.exit(1);\n }\n}\n\nmain();"],"names":["configureEarlyLogging","hasVerbose","process","argv","includes","hasDebug","setLogLevel","main","cardigantime","Cardigantime","create","defaults","configDirectory","DEFAULT_CONFIG_DIR","pathResolution","resolvePathArray","fieldOverlaps","features","configShape","ConfigSchema","shape","logger","getLogger","runConfig","secureConfig","commandConfig","Arguments","verbose","debug","setLogger","commandName","COMMAND_CHECK_CONFIG","COMMAND_INIT_CONFIG","command","summary","COMMAND_COMMIT","Commit","COMMAND_RELEASE","releaseSummary","Release","title","body","COMMAND_PUBLISH","Publish","COMMAND_LINK","Link","COMMAND_UNLINK","Unlink","console","log","error","message","stack","exit"],"mappings":";;;;;;;;;;;;;AAcA,CAAA,CAAA,CAAA;;;;;;;AAOC,CAAA,CAAA,CAAA,CACD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAASA,qBAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AACL,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAaC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAQC,IAAI,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAQ,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACzC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAWH,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAQC,IAAI,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,C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CAAA;AAEA9C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;;"}
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env node\nimport * as Cardigantime from '@theunwalked/cardigantime';\nimport 'dotenv/config';\nimport { CommandConfig } from 'types';\nimport * as Arguments from './arguments';\nimport * as AudioCommit from './commands/audio-commit';\nimport * as AudioReview from './commands/audio-review';\nimport * as Clean from './commands/clean';\nimport * as Commit from './commands/commit';\nimport * as Link from './commands/link';\nimport * as Publish from './commands/publish';\nimport * as Release from './commands/release';\nimport * as Review from './commands/review';\nimport * as Unlink from './commands/unlink';\nimport { COMMAND_AUDIO_COMMIT, COMMAND_AUDIO_REVIEW, COMMAND_CHECK_CONFIG, COMMAND_CLEAN, COMMAND_COMMIT, COMMAND_INIT_CONFIG, COMMAND_LINK, COMMAND_PUBLISH, COMMAND_RELEASE, COMMAND_REVIEW, COMMAND_UNLINK, DEFAULT_CONFIG_DIR } from './constants';\nimport { getLogger, setLogLevel } from './logging';\nimport { Config, ConfigSchema, SecureConfig } from './types';\n\n/**\n * Configure early logging based on command line flags.\n * \n * Hey we need this because we need to be able to debug CardiganTime.\n * This method checks for --verbose and --debug flags early in the process\n * before CardiganTime is configured, allowing us to capture debug output\n * from the CardiganTime initialization itself.\n */\nfunction configureEarlyLogging(): void {\n const hasVerbose = process.argv.includes('--verbose');\n const hasDebug = process.argv.includes('--debug');\n\n // Set log level based on early flag detection\n if (hasDebug) {\n setLogLevel('debug');\n } else if (hasVerbose) {\n setLogLevel('verbose');\n }\n}\n\nexport async function main() {\n // Configure logging early, before CardiganTime initialization\n configureEarlyLogging();\n\n const cardigantime = Cardigantime.create({\n defaults: {\n configDirectory: DEFAULT_CONFIG_DIR,\n // Move pathResolution INSIDE defaults\n pathResolution: {\n resolvePathArray: ['contextDirectories'], // Resolve contextDirectories array elements as paths\n },\n // Use fieldOverlaps instead of mergeStrategy, INSIDE defaults\n fieldOverlaps: {\n 'contextDirectories': 'prepend', // Use prepend strategy for contextDirectories array\n // Add other field overlap configurations as needed\n },\n },\n features: ['config', 'hierarchical'],\n configShape: ConfigSchema.shape, // No need for 'as any' now\n logger: getLogger(),\n }); // No need for 'as any' at the end\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [runConfig, secureConfig, commandConfig]: [Config, SecureConfig, CommandConfig] = await Arguments.configure(cardigantime); // Pass cardigantime instance\n\n // Set log level based on verbose flag\n if (runConfig.verbose) {\n setLogLevel('verbose');\n }\n if (runConfig.debug) {\n setLogLevel('debug');\n }\n\n const logger = getLogger();\n cardigantime.setLogger(logger);\n\n try {\n // Handle check-config command first\n if (commandConfig.commandName === COMMAND_CHECK_CONFIG) {\n // CardiganTime's checkConfig has already been called in Arguments.configure()\n // No additional processing needed here\n return;\n }\n\n // Handle init-config command\n if (commandConfig.commandName === COMMAND_INIT_CONFIG) {\n // CardiganTime's initConfig has already been called in Arguments.configure()\n // No additional processing needed here\n return;\n }\n\n // Get the command from Commander\n const command = process.argv[2];\n let commandName = commandConfig.commandName;\n\n // If we have a specific command argument, use that\n if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review') {\n commandName = command;\n }\n\n let summary: string = '';\n\n if (commandName === COMMAND_COMMIT) {\n summary = await Commit.execute(runConfig);\n } else if (commandName === COMMAND_AUDIO_COMMIT) {\n summary = await AudioCommit.execute(runConfig);\n } else if (commandName === COMMAND_RELEASE) {\n const releaseSummary = await Release.execute(runConfig);\n summary = `${releaseSummary.title}\\n\\n${releaseSummary.body}`;\n } else if (commandName === COMMAND_PUBLISH) {\n await Publish.execute(runConfig);\n } else if (commandName === COMMAND_LINK) {\n summary = await Link.execute(runConfig);\n } else if (commandName === COMMAND_UNLINK) {\n summary = await Unlink.execute(runConfig);\n } else if (commandName === COMMAND_AUDIO_REVIEW) {\n summary = await AudioReview.execute(runConfig);\n } else if (commandName === COMMAND_CLEAN) {\n await Clean.execute(runConfig);\n summary = 'Output directory cleaned successfully.';\n } else if (commandName === COMMAND_REVIEW) {\n summary = await Review.execute(runConfig);\n }\n\n // eslint-disable-next-line no-console\n console.log(`\\n\\n${summary}\\n\\n`);\n\n } catch (error: any) {\n logger.error('Exiting due to Error: %s, %s', error.message, error.stack);\n process.exit(1);\n }\n}\n\nmain();"],"names":["configureEarlyLogging","hasVerbose","process","argv","includes","hasDebug","setLogLevel","main","cardigantime","Cardigantime","create","defaults","configDirectory","DEFAULT_CONFIG_DIR","pathResolution","resolvePathArray","fieldOverlaps","features","configShape","ConfigSchema","shape","logger","getLogger","runConfig","secureConfig","commandConfig","Arguments","verbose","debug","setLogger","commandName","COMMAND_CHECK_CONFIG","COMMAND_INIT_CONFIG","command","summary","COMMAND_COMMIT","Commit","COMMAND_AUDIO_COMMIT","AudioCommit","COMMAND_RELEASE","releaseSummary","Release","title","body","COMMAND_PUBLISH","Publish","COMMAND_LINK","Link","COMMAND_UNLINK","Unlink","COMMAND_AUDIO_REVIEW","AudioReview","COMMAND_CLEAN","Clean","COMMAND_REVIEW","Review","console","log","error","message","stack","exit"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,CAAA,CAAA,CAAA;;;;;;;AAOC,CAAA,CAAA,CAAA,CACD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAASA,qBAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AACL,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAaC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAQC,IAAI,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAQ,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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CAAAA,CAAAA,CAAAA,CAAAA,CAAQ2D,CAAAA,CAAAA,CAAAA,CAAI,CAAC,CAAA,CAAA,CAAA;AACjB,CAAA,CAAA,CAAA,CAAA,CAAA;AACJ,CAAA;AAEAtD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;;"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
Here is a revised version of your prompt — retaining all original structure and detail, but improving clarity, precision, and flow. It avoids redundancy, tightens the language, and better emphasizes key steps:
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
**🔧 Task Definition**
|
|
6
2
|
|
|
7
|
-
You are generating a Git commit message based on the content provided below. The content contains
|
|
3
|
+
You are generating a Git commit message based on the content provided below. The content contains several critical sections:
|
|
8
4
|
|
|
9
|
-
* **\[User
|
|
10
|
-
* **\[
|
|
11
|
-
* **\[
|
|
5
|
+
* **\[User Direction]** — When present, this is the PRIMARY guidance for your commit message focus. This describes the motivation, goals, or intent behind the change from the user's perspective. This should be the starting point and main theme of your commit message.
|
|
6
|
+
* **\[User Context]** — When present, this provides IMPORTANT additional context about the user's situation, environment, or background that should inform your commit message understanding and approach.
|
|
7
|
+
* **\[Diff]** — A code diff representing the actual modifications. Analyze this to understand *what* was changed. **THIS IS THE CURRENT CHANGE YOU ARE DESCRIBING** — focus your commit message on explaining these specific modifications.
|
|
8
|
+
* **\[Log Context]** — A short history of recent commit messages. **IMPORTANT: This is provided ONLY for background context and temporal continuity. DO NOT use this to drive your commit message focus or content. DO NOT describe previous commits or reference past changes. Your commit message should describe ONLY the current diff/change.**
|
|
12
9
|
|
|
13
10
|
---
|
|
14
11
|
|
|
@@ -16,19 +13,25 @@ You are generating a Git commit message based on the content provided below. The
|
|
|
16
13
|
|
|
17
14
|
### ✅ DO:
|
|
18
15
|
|
|
19
|
-
*
|
|
16
|
+
* **PRIORITIZE User Direction**: If `[User Direction]` is provided, make it the central theme and starting point of your commit message. Let it guide the narrative and focus.
|
|
17
|
+
* **CONSIDER User Context**: If `[User Context]` is provided, use it to inform your understanding and tailor your commit message appropriately to the user's situation.
|
|
18
|
+
* **FOCUS ON THE CURRENT CHANGE**: Your commit message should describe only what is happening in the current diff — not previous work or future plans.
|
|
19
|
+
* Start with a **clear, concise summary** of what was changed and why — grounded in the `User Direction` when present and informed by any `User Context`.
|
|
20
20
|
* **Group changes logically** by purpose or domain (e.g., "error handling cleanup", "refactored tests", "adjusted CI config").
|
|
21
|
-
* **Refer to specific changes** seen in the `Diff`, and explain why those changes matter when it
|
|
21
|
+
* **Refer to specific changes** seen in the `Diff`, and explain why those changes matter when it's non-obvious.
|
|
22
22
|
* If the change is large, **add one or two paragraphs** expanding on the most important elements.
|
|
23
23
|
* Keep the tone technical and direct — written for a fellow developer who will read this in six months.
|
|
24
24
|
|
|
25
25
|
### ❌ DO NOT:
|
|
26
26
|
|
|
27
|
-
* ❌ Don
|
|
28
|
-
* ❌ Don
|
|
29
|
-
* ❌ Don
|
|
30
|
-
* ❌ Don
|
|
31
|
-
* ❌ Don
|
|
27
|
+
* ❌ Don't describe the project or its general purpose.
|
|
28
|
+
* ❌ Don't begin with boilerplate like "This commit includes..." or "The following changes..."
|
|
29
|
+
* ❌ Don't use fluffy or celebratory language ("awesome update", "great enhancement").
|
|
30
|
+
* ❌ Don't end with vague statements like "improves experience" unless clearly supported by the change.
|
|
31
|
+
* ❌ Don't use markdown formatting — the output should be plain text only.
|
|
32
|
+
* ❌ **Don't reference or describe previous commits from the log context** — focus only on the current change.
|
|
33
|
+
* ❌ **Don't let the log context influence your commit message content** — it's background information only.
|
|
34
|
+
* ❌ **Don't continue themes or patterns from previous commits** unless they're directly relevant to the current diff.
|
|
32
35
|
|
|
33
36
|
---
|
|
34
37
|
|