@eldrforge/kodrdriv 0.0.15 ā 0.0.17
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/README.md +1 -9
- package/dist/arguments.js +38 -63
- package/dist/arguments.js.map +1 -1
- package/dist/audio/devices.js +284 -0
- package/dist/audio/devices.js.map +1 -0
- package/dist/audio/index.js +31 -0
- package/dist/audio/index.js.map +1 -0
- package/dist/audio/processor.js +766 -0
- package/dist/audio/processor.js.map +1 -0
- package/dist/audio/types.js +16 -0
- package/dist/audio/types.js.map +1 -0
- package/dist/audio/validation.js +35 -0
- package/dist/audio/validation.js.map +1 -0
- package/dist/commands/audio-commit.js +59 -634
- package/dist/commands/audio-commit.js.map +1 -1
- package/dist/commands/audio-review.js +68 -632
- package/dist/commands/audio-review.js.map +1 -1
- package/dist/commands/select-audio.js +265 -0
- package/dist/commands/select-audio.js.map +1 -0
- package/dist/constants.js +15 -6
- package/dist/constants.js.map +1 -1
- package/dist/content/issues.js +16 -0
- package/dist/content/issues.js.map +1 -1
- package/dist/main.js +6 -2
- package/dist/main.js.map +1 -1
- package/dist/types.js +5 -3
- package/dist/types.js.map +1 -1
- package/dist/util/openai.js +34 -3
- package/dist/util/openai.js.map +1 -1
- package/package.json +2 -2
- package/.kodrdriv/config.yaml +0 -20
- package/.kodrdriv/context/content.md +0 -7
- package/RELEASE_NOTES.md +0 -14
- package/docs/index.html +0 -17
- package/docs/package.json +0 -36
- package/docs/pnpm-lock.yaml +0 -3441
- package/docs/public/README.md +0 -132
- package/docs/public/advanced-usage.md +0 -188
- package/docs/public/code-icon.svg +0 -4
- package/docs/public/commands.md +0 -136
- package/docs/public/configuration.md +0 -274
- package/docs/public/examples.md +0 -352
- package/docs/public/kodrdriv-logo.svg +0 -62
- package/docs/src/App.css +0 -387
- package/docs/src/App.tsx +0 -60
- package/docs/src/components/DocumentPage.tsx +0 -56
- package/docs/src/components/ErrorMessage.tsx +0 -15
- package/docs/src/components/LoadingSpinner.tsx +0 -14
- package/docs/src/components/MarkdownRenderer.tsx +0 -56
- package/docs/src/components/Navigation.css +0 -73
- package/docs/src/components/Navigation.tsx +0 -36
- package/docs/src/index.css +0 -61
- package/docs/src/main.tsx +0 -10
- package/docs/src/test/setup.ts +0 -1
- package/docs/src/vite-env.d.ts +0 -10
- package/docs/tsconfig.node.json +0 -13
- package/docs/vite.config.ts +0 -15
- package/docs/vitest.config.ts +0 -15
- package/eslint.config.mjs +0 -83
- package/nodemon.json +0 -14
- package/output/kodrdriv/250702-0552-release-notes.md +0 -3
- package/pnpm-workspace.yaml +0 -5
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.ts +0 -90
- package/vitest.config.ts +0 -24
|
@@ -1 +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,GAA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Q,CAAA,CAAE;AAC5B,oBAAA;AACH,iBAAA;AAED,gBAAA,MAAMgB,eAAe,MAAMa,WAAAA,CAAY5C,KAAAA,CAAMS,KAAK,EAAEiC,SAAAA,EAAWC,MAAAA,CAAAA;AAC/DnB,gBAAAA,aAAAA,CAAcqB,IAAI,CAAC;AACf7C,oBAAAA,KAAAA;AACAkC,oBAAAA,SAAAA,EAAWH,aAAae,QAAQ;AAChCb,oBAAAA,MAAAA,EAAQF,aAAaE;AACzB,iBAAA,CAAA;AAEArE,gBAAAA,MAAAA,CAAOiB,IAAI,CAAC,CAAC,wBAAwB,EAAEkD,YAAAA,CAAaE,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;;;;"}
|
|
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 // Ensure stdin is referenced so the process doesn't exit while waiting for input\n if (typeof process.stdin.ref === 'function') {\n process.stdin.ref();\n }\n\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 // Detach stdin again now that we're done\n if (typeof process.stdin.unref === 'function') {\n process.stdin.unref();\n }\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 // Ensure stdin is referenced during readline interaction\n if (typeof process.stdin.ref === 'function') {\n process.stdin.ref();\n }\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 // Detach stdin after interactive edit completes\n if (typeof process.stdin.unref === 'function') {\n process.stdin.unref();\n }\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","ref","setRawMode","resume","on","keyStr","toString","toLowerCase","find","c","pause","unref","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,CAAOG,KAAK,CAAC,gDAAA,EAAkDI,YAAAA,CAAaG,MAAM,CAAA;YAClF,OAAOH,YAAAA;SACX,MAAO;AACHP,YAAAA,MAAAA,CAAOG,KAAK,CAAC,6BAAA,CAAA;YACb,OAAO,EAAA;AACX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;AACH,iBAAA;AAED,gBAAA,MAAMgB,eAAe,MAAMa,WAAAA,CAAY5C,KAAAA,CAAMS,KAAK,EAAEiC,SAAAA,EAAWC,MAAAA,CAAAA;AAC/DnB,gBAAAA,aAAAA,CAAcqB,IAAI,CAAC;AACf7C,oBAAAA,KAAAA;AACAkC,oBAAAA,SAAAA,EAAWH,aAAae,QAAQ;AAChCb,oBAAAA,MAAAA,EAAQF,aAAaE;AACzB,iBAAA,CAAA;AAEAvE,gBAAAA,MAAAA,CAAOiB,IAAI,CAAC,CAAC,wBAAwB,EAAEoD,YAAAA,CAAaE,MAAM,CAAC,EAAE,EAAEF,YAAAA,CAAae,QAAQ,CAAA,CAAE,CAAA;AAC1F,aAAA,CAAE,OAAOzE,KAAAA,EAAY;AACjBX,gBAAAA,MAAAA,CAAOW,KAAK,CAAC,CAAC,qCAAqC,EAAE2B,KAAAA,CAAMS,KAAK,CAAC,GAAG,EAAEpC,KAAAA,CAAME,OAAO,CAAA,CAAE,CAAA;AACzF;AACJ;AACJ;;IAGA,IAAIiD,aAAAA,CAAcpD,MAAM,GAAG,CAAA,EAAG;AAC1B,QAAA,OAAOkD,8BAA8BC,MAAAA,EAAQC,aAAAA,CAAAA;KACjD,MAAO;AACH,QAAA,OAAOW,mBAAAA,CAAoBZ,MAAAA,CAAAA;AAC/B;AACJ;;;;"}
|
package/dist/main.js
CHANGED
|
@@ -10,8 +10,9 @@ import { execute as execute$4 } from './commands/link.js';
|
|
|
10
10
|
import { execute as execute$3 } from './commands/publish.js';
|
|
11
11
|
import { execute as execute$2 } from './commands/release.js';
|
|
12
12
|
import { execute as execute$8 } from './commands/review.js';
|
|
13
|
+
import { execute as execute$9 } from './commands/select-audio.js';
|
|
13
14
|
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';
|
|
15
|
+
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, COMMAND_SELECT_AUDIO } from './constants.js';
|
|
15
16
|
import { getLogger, setLogLevel } from './logging.js';
|
|
16
17
|
import { ConfigSchema } from './types.js';
|
|
17
18
|
|
|
@@ -84,7 +85,7 @@ async function main() {
|
|
|
84
85
|
const command = process.argv[2];
|
|
85
86
|
let commandName = commandConfig.commandName;
|
|
86
87
|
// If we have a specific command argument, use that
|
|
87
|
-
if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review') {
|
|
88
|
+
if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review' || command === 'select-audio') {
|
|
88
89
|
commandName = command;
|
|
89
90
|
}
|
|
90
91
|
let summary = '';
|
|
@@ -108,6 +109,9 @@ async function main() {
|
|
|
108
109
|
summary = 'Output directory cleaned successfully.';
|
|
109
110
|
} else if (commandName === COMMAND_REVIEW) {
|
|
110
111
|
summary = await execute$8(runConfig);
|
|
112
|
+
} else if (commandName === COMMAND_SELECT_AUDIO) {
|
|
113
|
+
await execute$9(runConfig);
|
|
114
|
+
summary = 'Audio selection completed successfully.';
|
|
111
115
|
}
|
|
112
116
|
// eslint-disable-next-line no-console
|
|
113
117
|
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 { 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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACzC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,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CAAA,CAAA;AACJ,CAAA;AAEAtD,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 SelectAudio from './commands/select-audio';\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_SELECT_AUDIO, 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' || command === 'select-audio') {\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 } else if (commandName === COMMAND_SELECT_AUDIO) {\n await SelectAudio.execute(runConfig);\n summary = 'Audio selection completed successfully.';\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","COMMAND_SELECT_AUDIO","SelectAudio","console","log","error","message","stack","exit"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,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,C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
|
-
instructions: z.string().optional(),
|
|
9
8
|
model: z.string().optional(),
|
|
10
9
|
contextDirectories: z.array(z.string()).optional(),
|
|
11
10
|
outputDirectory: z.string().optional(),
|
|
11
|
+
preferencesDirectory: z.string().optional(),
|
|
12
12
|
commit: z.object({
|
|
13
13
|
add: z.boolean().optional(),
|
|
14
14
|
cached: z.boolean().optional(),
|
|
@@ -20,7 +20,8 @@ const ConfigSchema = z.object({
|
|
|
20
20
|
audioCommit: z.object({
|
|
21
21
|
maxRecordingTime: z.number().optional(),
|
|
22
22
|
audioDevice: z.string().optional(),
|
|
23
|
-
|
|
23
|
+
file: z.string().optional(),
|
|
24
|
+
keepTemp: z.boolean().optional()
|
|
24
25
|
}).optional(),
|
|
25
26
|
release: z.object({
|
|
26
27
|
from: z.string().optional(),
|
|
@@ -54,7 +55,8 @@ const ConfigSchema = z.object({
|
|
|
54
55
|
sendit: z.boolean().optional(),
|
|
55
56
|
maxRecordingTime: z.number().optional(),
|
|
56
57
|
audioDevice: z.string().optional(),
|
|
57
|
-
|
|
58
|
+
file: z.string().optional(),
|
|
59
|
+
keepTemp: z.boolean().optional()
|
|
58
60
|
}).optional(),
|
|
59
61
|
publish: z.object({
|
|
60
62
|
mergeMethod: z.enum([
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n instructions: z.string().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n outputDirectory: z.string().optional(),\n commit: z.object({\n add: z.boolean().optional(),\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n direction: z.string().optional(),\n }).optional(),\n audioCommit: z.object({\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n selectAudioDevice: z.boolean().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n }).optional(),\n review: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n note: z.string().optional(),\n }).optional(),\n audioReview: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n selectAudioDevice: z.boolean().optional(),\n }).optional(),\n publish: z.object({\n mergeMethod: z.enum(['merge', 'squash', 'rebase']).optional(),\n dependencyUpdatePatterns: z.array(z.string()).optional(),\n requiredEnvVars: z.array(z.string()).optional(),\n linkWorkspacePackages: z.boolean().optional(),\n unlinkWorkspacePackages: z.boolean().optional(),\n }).optional(),\n link: z.object({\n scopeRoots: z.record(z.string(), z.string()).optional(),\n workspaceFile: z.string().optional(),\n dryRun: z.boolean().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n\nexport type MergeMethod = 'merge' | 'squash' | 'rebase';\n\nexport interface PullRequest {\n html_url: string;\n number: number;\n labels: {\n name: string;\n }[];\n}\n\nexport type ReleaseSummary = {\n title: string;\n body: string;\n}\n\nexport type ReleaseConfig = {\n from?: string;\n to?: string;\n context?: string;\n}\n\nexport type ReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n note?: string;\n}\n\nexport type AudioReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n maxRecordingTime?: number;\n audioDevice?: string;\n selectAudioDevice?: boolean;\n}\n\nexport type AudioCommitConfig = {\n maxRecordingTime?: number;\n audioDevice?: string;\n selectAudioDevice?: boolean;\n}\n\nexport type PublishConfig = {\n from?: string;\n to?: string;\n}\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","instructions","string","model","contextDirectories","array","outputDirectory","commit","add","cached","sendit","messageLimit","number","context","direction","audioCommit","maxRecordingTime","audioDevice","selectAudioDevice","release","from","to","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","note","audioReview","publish","mergeMethod","enum","dependencyUpdatePatterns","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","link","scopeRoots","record","workspaceFile","excludedPatterns","openaiApiKey","commandName"],"mappings":";;AAGO,MAAMA,YAAAA,GAAeC,CAAAA,CAAEC,MAAM,CAAC;IACjCC,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"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n outputDirectory: z.string().optional(),\n preferencesDirectory: z.string().optional(),\n commit: z.object({\n add: z.boolean().optional(),\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n direction: z.string().optional(),\n }).optional(),\n audioCommit: z.object({\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n }).optional(),\n review: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n note: z.string().optional(),\n }).optional(),\n audioReview: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n publish: z.object({\n mergeMethod: z.enum(['merge', 'squash', 'rebase']).optional(),\n dependencyUpdatePatterns: z.array(z.string()).optional(),\n requiredEnvVars: z.array(z.string()).optional(),\n linkWorkspacePackages: z.boolean().optional(),\n unlinkWorkspacePackages: z.boolean().optional(),\n }).optional(),\n link: z.object({\n scopeRoots: z.record(z.string(), z.string()).optional(),\n workspaceFile: z.string().optional(),\n dryRun: z.boolean().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n\nexport type MergeMethod = 'merge' | 'squash' | 'rebase';\n\nexport interface PullRequest {\n html_url: string;\n number: number;\n labels: {\n name: string;\n }[];\n}\n\nexport type ReleaseSummary = {\n title: string;\n body: string;\n}\n\nexport type ReleaseConfig = {\n from?: string;\n to?: string;\n context?: string;\n}\n\nexport type ReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n note?: string;\n}\n\nexport type AudioReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n keepTemp?: boolean;\n}\n\nexport type AudioCommitConfig = {\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n keepTemp?: boolean;\n}\n\nexport type PublishConfig = {\n from?: string;\n to?: string;\n}\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","model","string","contextDirectories","array","outputDirectory","preferencesDirectory","commit","add","cached","sendit","messageLimit","number","context","direction","audioCommit","maxRecordingTime","audioDevice","file","keepTemp","release","from","to","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","note","audioReview","publish","mergeMethod","enum","dependencyUpdatePatterns","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","link","scopeRoots","record","workspaceFile","excludedPatterns","openaiApiKey","commandName"],"mappings":";;AAGO,MAAMA,YAAAA,GAAeC,CAAAA,CAAEC,MAAM,CAAC;IACjCC,MAAAA,EAAQF,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC5BC,OAAAA,EAASL,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC7BE,KAAAA,EAAON,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC3BG,SAAAA,EAAWP,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC/BI,KAAAA,EAAOR,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;AAC1BM,IAAAA,kBAAAA,EAAoBV,EAAEW,KAAK,CAACX,CAAAA,CAAES,MAAM,IAAIL,QAAQ,EAAA;IAChDQ,eAAAA,EAAiBZ,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;IACpCS,oBAAAA,EAAsBb,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;IACzCU,MAAAA,EAAQd,CAAAA,CAAEC,MAAM,CAAC;QACbc,GAAAA,EAAKf,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;QACzBY,MAAAA,EAAQhB,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;QAC5Ba,MAAAA,EAAQjB,CAAAA,CAAEG,OAAO,EAAA,CAAGC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,QAAQ,EAAA;QACrD+C,aAAAA,EAAenD,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;QAClCF,MAAAA,EAAQF,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ;AAChC,KAAA,CAAA,CAAGA,QAAQ,EAAA;AACXgD,IAAAA,gBAAAA,EAAkBpD,EAAEW,KAAK,CAACX,CAAAA,CAAES,MAAM,IAAIL,QAAQ;AAClD,CAAA;AAEkCJ,CAAAA,CAAEC,MAAM,CAAC;IACvCoD,YAAAA,EAAcrD,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACrC,CAAA;AAEmCJ,CAAAA,CAAEC,MAAM,CAAC;IACxCqD,WAAAA,EAAatD,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACpC,CAAA;;;;"}
|
package/dist/util/openai.js
CHANGED
|
@@ -15,13 +15,15 @@ async function createCompletion(messages, options = {
|
|
|
15
15
|
const storage = create({
|
|
16
16
|
log: logger.debug
|
|
17
17
|
});
|
|
18
|
+
let openai = null;
|
|
18
19
|
try {
|
|
19
20
|
var _completion_choices__message_content, _completion_choices__message, _completion_choices_;
|
|
20
21
|
const apiKey = process.env.OPENAI_API_KEY;
|
|
21
22
|
if (!apiKey) {
|
|
22
23
|
throw new OpenAIError('OPENAI_API_KEY environment variable is not set');
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
// Create the client which we'll close in the finally block.
|
|
26
|
+
openai = new OpenAI({
|
|
25
27
|
apiKey: apiKey
|
|
26
28
|
});
|
|
27
29
|
logger.debug('Sending prompt to OpenAI: %j', messages);
|
|
@@ -62,6 +64,17 @@ async function createCompletion(messages, options = {
|
|
|
62
64
|
} catch (error) {
|
|
63
65
|
logger.error('Error calling OpenAI API: %s %s', error.message, error.stack);
|
|
64
66
|
throw new OpenAIError(`Failed to create completion: ${error.message}`);
|
|
67
|
+
} finally{
|
|
68
|
+
// Ensure we close the OpenAI client to release underlying keep-alive sockets
|
|
69
|
+
try {
|
|
70
|
+
// openai.close() returns a promise; awaiting ensures proper cleanup
|
|
71
|
+
// but if it throws we silently ignore as it's best-effort.
|
|
72
|
+
if (openai && typeof openai.close === 'function') {
|
|
73
|
+
await openai.close();
|
|
74
|
+
}
|
|
75
|
+
} catch (closeErr) {
|
|
76
|
+
logger.debug('Failed to close OpenAI client: %s', closeErr.message);
|
|
77
|
+
}
|
|
65
78
|
}
|
|
66
79
|
}
|
|
67
80
|
async function transcribeAudio(filePath, options = {
|
|
@@ -71,12 +84,14 @@ async function transcribeAudio(filePath, options = {
|
|
|
71
84
|
const storage = create({
|
|
72
85
|
log: logger.debug
|
|
73
86
|
});
|
|
87
|
+
let openai = null;
|
|
88
|
+
let audioStream = null;
|
|
74
89
|
try {
|
|
75
90
|
const apiKey = process.env.OPENAI_API_KEY;
|
|
76
91
|
if (!apiKey) {
|
|
77
92
|
throw new OpenAIError('OPENAI_API_KEY environment variable is not set');
|
|
78
93
|
}
|
|
79
|
-
|
|
94
|
+
openai = new OpenAI({
|
|
80
95
|
apiKey: apiKey
|
|
81
96
|
});
|
|
82
97
|
logger.debug('Transcribing audio file: %s', filePath);
|
|
@@ -91,7 +106,7 @@ async function transcribeAudio(filePath, options = {
|
|
|
91
106
|
await storage.writeFile(debugFile, JSON.stringify(requestData, null, 2), 'utf8');
|
|
92
107
|
logger.debug('Wrote request debug file to %s', debugFile);
|
|
93
108
|
}
|
|
94
|
-
|
|
109
|
+
audioStream = await storage.readStream(filePath);
|
|
95
110
|
const transcription = await openai.audio.transcriptions.create({
|
|
96
111
|
model: options.model || "whisper-1",
|
|
97
112
|
file: audioStream,
|
|
@@ -112,6 +127,22 @@ async function transcribeAudio(filePath, options = {
|
|
|
112
127
|
} catch (error) {
|
|
113
128
|
logger.error('Error transcribing audio file: %s %s', error.message, error.stack);
|
|
114
129
|
throw new OpenAIError(`Failed to transcribe audio: ${error.message}`);
|
|
130
|
+
} finally{
|
|
131
|
+
// Ensure the audio stream is properly closed to release file handles
|
|
132
|
+
try {
|
|
133
|
+
if (audioStream) {
|
|
134
|
+
audioStream.close();
|
|
135
|
+
}
|
|
136
|
+
} catch (streamErr) {
|
|
137
|
+
logger.debug('Failed to close audio read stream: %s', streamErr.message);
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
if (openai && typeof openai.close === 'function') {
|
|
141
|
+
await openai.close();
|
|
142
|
+
}
|
|
143
|
+
} catch (closeErr) {
|
|
144
|
+
logger.debug('Failed to close OpenAI client: %s', closeErr.message);
|
|
145
|
+
}
|
|
115
146
|
}
|
|
116
147
|
}
|
|
117
148
|
|
package/dist/util/openai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sources":["../../src/util/openai.ts"],"sourcesContent":["import { OpenAI } from 'openai';\nimport { ChatCompletionMessageParam } from 'openai/resources';\nimport * as Storage from './storage';\nimport { getLogger } from '../logging';\nexport interface Transcription {\n text: string;\n}\n\nexport class OpenAIError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'OpenAIError';\n }\n}\n\nexport async function createCompletion(messages: ChatCompletionMessageParam[], options: { responseFormat?: any, model?: string, debug?: boolean, debugFile?: string, debugRequestFile?: string, debugResponseFile?: string } = { model: \"gpt-4o-mini\" }): Promise<string | any> {\n const logger = getLogger();\n const storage = Storage.create({ log: logger.debug });\n try {\n const apiKey = process.env.OPENAI_API_KEY;\n if (!apiKey) {\n throw new OpenAIError('OPENAI_API_KEY environment variable is not set');\n }\n\n const openai = new OpenAI({\n apiKey: apiKey,\n });\n\n logger.debug('Sending prompt to OpenAI: %j', messages);\n\n // Save request debug file if enabled\n if (options.debug && (options.debugRequestFile || options.debugFile)) {\n const requestData = {\n model: options.model || \"gpt-4o-mini\",\n messages,\n max_completion_tokens: 10000,\n response_format: options.responseFormat,\n };\n const debugFile = options.debugRequestFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(requestData, null, 2), 'utf8');\n logger.debug('Wrote request debug file to %s', debugFile);\n }\n\n const completion = await openai.chat.completions.create({\n model: options.model || \"gpt-4o-mini\",\n messages,\n max_completion_tokens: 10000,\n response_format: options.responseFormat,\n });\n\n // Save response debug file if enabled\n if (options.debug && (options.debugResponseFile || options.debugFile)) {\n const debugFile = options.debugResponseFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(completion, null, 2), 'utf8');\n logger.debug('Wrote response debug file to %s', debugFile);\n }\n\n const response = completion.choices[0]?.message?.content?.trim();\n if (!response) {\n throw new OpenAIError('No response received from OpenAI');\n }\n\n logger.debug('Received response from OpenAI: %s...', response.substring(0, 30));\n if (options.responseFormat) {\n return JSON.parse(response);\n } else {\n return response;\n }\n\n } catch (error: any) {\n logger.error('Error calling OpenAI API: %s %s', error.message, error.stack);\n throw new OpenAIError(`Failed to create completion: ${error.message}`);\n }\n}\n\nexport async function transcribeAudio(filePath: string, options: { model?: string, debug?: boolean, debugFile?: string, debugRequestFile?: string, debugResponseFile?: string } = { model: \"whisper-1\" }): Promise<Transcription> {\n const logger = getLogger();\n const storage = Storage.create({ log: logger.debug });\n try {\n const apiKey = process.env.OPENAI_API_KEY;\n if (!apiKey) {\n throw new OpenAIError('OPENAI_API_KEY environment variable is not set');\n }\n\n const openai = new OpenAI({\n apiKey: apiKey,\n });\n\n logger.debug('Transcribing audio file: %s', filePath);\n\n // Save request debug file if enabled\n if (options.debug && (options.debugRequestFile || options.debugFile)) {\n const requestData = {\n model: options.model || \"whisper-1\",\n file: filePath, // Can't serialize the stream, so just save the file path\n response_format: \"json\",\n };\n const debugFile = options.debugRequestFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(requestData, null, 2), 'utf8');\n logger.debug('Wrote request debug file to %s', debugFile);\n }\n\n const audioStream = await storage.readStream(filePath);\n const transcription = await openai.audio.transcriptions.create({\n model: options.model || \"whisper-1\",\n file: audioStream,\n response_format: \"json\",\n });\n\n // Save response debug file if enabled\n if (options.debug && (options.debugResponseFile || options.debugFile)) {\n const debugFile = options.debugResponseFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(transcription, null, 2), 'utf8');\n logger.debug('Wrote response debug file to %s', debugFile);\n }\n\n const response = transcription;\n if (!response) {\n throw new OpenAIError('No transcription received from OpenAI');\n }\n\n logger.debug('Received transcription from OpenAI: %s', response);\n return response;\n\n } catch (error: any) {\n logger.error('Error transcribing audio file: %s %s', error.message, error.stack);\n throw new OpenAIError(`Failed to transcribe audio: ${error.message}`);\n }\n}\n"],"names":["OpenAIError","Error","message","name","createCompletion","messages","options","model","logger","getLogger","storage","Storage","log","debug","completion","apiKey","process","env","OPENAI_API_KEY","openai","OpenAI","debugRequestFile","debugFile","requestData","max_completion_tokens","response_format","responseFormat","writeFile","JSON","stringify","chat","completions","create","debugResponseFile","response","choices","content","trim","substring","parse","error","stack","transcribeAudio","filePath","file","audioStream","readStream","transcription","audio","transcriptions"],"mappings":";;;;AAQO,MAAMA,WAAAA,SAAoBC,KAAAA,CAAAA;AAC7B,IAAA,WAAA,CAAYC,OAAe,CAAE;AACzB,QAAA,KAAK,CAACA,OAAAA,CAAAA;QACN,IAAI,CAACC,IAAI,GAAG,aAAA;AAChB;AACJ;AAEO,eAAeC,gBAAAA,CAAiBC,QAAsC,EAAEC,OAAAA,GAAgJ;IAAEC,KAAAA,EAAO;AAAc,CAAC,EAAA;AACnP,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;IACf,MAAMC,OAAAA,GAAUC,MAAc,CAAC;AAAEC,QAAAA,GAAAA,EAAKJ,OAAOK;AAAM,KAAA,CAAA;IACnD,IAAI;AAuCiBC,QAAAA,IAAAA,oCAAAA,EAAAA,4BAAAA,EAAAA,oBAAAA;AAtCjB,QAAA,MAAMC,MAAAA,GAASC,OAAAA,CAAQC,GAAG,CAACC,cAAc;AACzC,QAAA,IAAI,CAACH,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIf,WAAAA,CAAY,gDAAA,CAAA;AAC1B;QAEA,MAAMmB,MAAAA,GAAS,IAAIC,MA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AAiB;AACrB,SAAA,CAAA;;QAGA,IAAInB,OAAAA,CAAQO,KAAK,KAAKP,OAAAA,CAAQ2B,iBAAiB,IAAI3B,OAAAA,CAAQgB,SAAQ,CAAA,EAAI;AACnE,YAAA,MAAMA,SAAAA,GAAYhB,OAAAA,CAAQ2B,iBAAiB,IAAI3B,QAAQgB,SAAS;YAChE,MAAMZ,OAAAA,CAAQiB,SAAS,CAACL,SAAAA,EAAYM,KAAKC,SAAS,CAACkB,aAAAA,EAAe,IAAA,EAAM,CAAA,CAAA,EAAI,MAAA,CAAA;YAC5EvC,MAAAA,CAAOK,KAAK,CAAC,iCAAA,EAAmCS,SAAAA,CAAAA;AACpD;AAEA,QAAA,MAAMY,QAAAA,GAAWa,aAAAA;AACjB,QAAA,IAAI,CAACb,QAAAA,EAAU;AACX,YAAA,MAAM,IAAIlC,WAAAA,CAAY,uCAAA,CAAA;AAC1B;QAEAQ,MAAAA,CAAOK,KAAK,CAAC,wCAAA,EAA0CqB,QAAAA,CAAAA;QACvD,OAAOA,QAAAA;AAEX,KAAA,CAAE,OAAOM,KAAAA,EAAY;AACjBhC,QAAAA,MAAAA,CAAOgC,KAAK,CAAC,sCAAA,EAAwCA,MAAMtC,OAAO,EAAEsC,MAAMC,KAAK,CAAA;AAC/E,QAAA,MAAM,IAAIzC,WAAAA,CAAY,CAAC,4BAA4B,EAAEwC,KAAAA,CAAMtC,OAAO,CAAA,CAAE,CAAA;AACxE;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"openai.js","sources":["../../src/util/openai.ts"],"sourcesContent":["import { OpenAI } from 'openai';\nimport { ChatCompletionMessageParam } from 'openai/resources';\nimport * as Storage from './storage';\nimport { getLogger } from '../logging';\n// eslint-disable-next-line no-restricted-imports\nimport fs from 'fs';\n\nexport interface Transcription {\n text: string;\n}\n\nexport class OpenAIError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'OpenAIError';\n }\n}\n\nexport async function createCompletion(messages: ChatCompletionMessageParam[], options: { responseFormat?: any, model?: string, debug?: boolean, debugFile?: string, debugRequestFile?: string, debugResponseFile?: string } = { model: \"gpt-4o-mini\" }): Promise<string | any> {\n const logger = getLogger();\n const storage = Storage.create({ log: logger.debug });\n let openai: OpenAI | null = null;\n try {\n const apiKey = process.env.OPENAI_API_KEY;\n if (!apiKey) {\n throw new OpenAIError('OPENAI_API_KEY environment variable is not set');\n }\n\n // Create the client which we'll close in the finally block.\n openai = new OpenAI({\n apiKey: apiKey,\n });\n\n logger.debug('Sending prompt to OpenAI: %j', messages);\n\n // Save request debug file if enabled\n if (options.debug && (options.debugRequestFile || options.debugFile)) {\n const requestData = {\n model: options.model || \"gpt-4o-mini\",\n messages,\n max_completion_tokens: 10000,\n response_format: options.responseFormat,\n };\n const debugFile = options.debugRequestFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(requestData, null, 2), 'utf8');\n logger.debug('Wrote request debug file to %s', debugFile);\n }\n\n const completion = await openai.chat.completions.create({\n model: options.model || \"gpt-4o-mini\",\n messages,\n max_completion_tokens: 10000,\n response_format: options.responseFormat,\n });\n\n // Save response debug file if enabled\n if (options.debug && (options.debugResponseFile || options.debugFile)) {\n const debugFile = options.debugResponseFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(completion, null, 2), 'utf8');\n logger.debug('Wrote response debug file to %s', debugFile);\n }\n\n const response = completion.choices[0]?.message?.content?.trim();\n if (!response) {\n throw new OpenAIError('No response received from OpenAI');\n }\n\n logger.debug('Received response from OpenAI: %s...', response.substring(0, 30));\n if (options.responseFormat) {\n return JSON.parse(response);\n } else {\n return response;\n }\n\n } catch (error: any) {\n logger.error('Error calling OpenAI API: %s %s', error.message, error.stack);\n throw new OpenAIError(`Failed to create completion: ${error.message}`);\n } finally {\n // Ensure we close the OpenAI client to release underlying keep-alive sockets\n try {\n // openai.close() returns a promise; awaiting ensures proper cleanup\n // but if it throws we silently ignore as it's best-effort.\n\n if (openai && typeof (openai as any).close === 'function') {\n await (openai as any).close();\n }\n } catch (closeErr) {\n logger.debug('Failed to close OpenAI client: %s', (closeErr as Error).message);\n }\n }\n}\n\nexport async function transcribeAudio(filePath: string, options: { model?: string, debug?: boolean, debugFile?: string, debugRequestFile?: string, debugResponseFile?: string } = { model: \"whisper-1\" }): Promise<Transcription> {\n const logger = getLogger();\n const storage = Storage.create({ log: logger.debug });\n let openai: OpenAI | null = null;\n let audioStream: fs.ReadStream | null = null;\n try {\n const apiKey = process.env.OPENAI_API_KEY;\n if (!apiKey) {\n throw new OpenAIError('OPENAI_API_KEY environment variable is not set');\n }\n\n openai = new OpenAI({\n apiKey: apiKey,\n });\n\n logger.debug('Transcribing audio file: %s', filePath);\n\n // Save request debug file if enabled\n if (options.debug && (options.debugRequestFile || options.debugFile)) {\n const requestData = {\n model: options.model || \"whisper-1\",\n file: filePath, // Can't serialize the stream, so just save the file path\n response_format: \"json\",\n };\n const debugFile = options.debugRequestFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(requestData, null, 2), 'utf8');\n logger.debug('Wrote request debug file to %s', debugFile);\n }\n\n audioStream = await storage.readStream(filePath);\n const transcription = await openai.audio.transcriptions.create({\n model: options.model || \"whisper-1\",\n file: audioStream,\n response_format: \"json\",\n });\n\n // Save response debug file if enabled\n if (options.debug && (options.debugResponseFile || options.debugFile)) {\n const debugFile = options.debugResponseFile || options.debugFile;\n await storage.writeFile(debugFile!, JSON.stringify(transcription, null, 2), 'utf8');\n logger.debug('Wrote response debug file to %s', debugFile);\n }\n\n const response = transcription;\n if (!response) {\n throw new OpenAIError('No transcription received from OpenAI');\n }\n\n logger.debug('Received transcription from OpenAI: %s', response);\n return response;\n\n } catch (error: any) {\n logger.error('Error transcribing audio file: %s %s', error.message, error.stack);\n throw new OpenAIError(`Failed to transcribe audio: ${error.message}`);\n } finally {\n // Ensure the audio stream is properly closed to release file handles\n try {\n if (audioStream) {\n audioStream.close();\n }\n } catch (streamErr) {\n logger.debug('Failed to close audio read stream: %s', (streamErr as Error).message);\n }\n try {\n if (openai && typeof (openai as any).close === 'function') {\n await (openai as any).close();\n }\n } catch (closeErr) {\n logger.debug('Failed to close OpenAI client: %s', (closeErr as Error).message);\n }\n }\n}\n"],"names":["OpenAIError","Error","message","name","createCompletion","messages","options","model","logger","getLogger","storage","Storage","log","debug","openai","completion","apiKey","process","env","OPENAI_API_KEY","OpenAI","debugRequestFile","debugFile","requestData","max_completion_tokens","response_format","responseFormat","writeFile","JSON","stringify","chat","completions","create","debugResponseFile","response","choices","content","trim","substring","parse","error","stack","close","closeErr","transcribeAudio","filePath","audioStream","file","readStream","transcription","audio","transcriptions","streamErr"],"mappings":";;;;AAWO,MAAMA,WAAAA,SAAoBC,KAAAA,CAAAA;AAC7B,IAAA,WAAA,CAAYC,OAAe,CAAE;AACzB,QAAA,KAAK,CAACA,OAAAA,CAAAA;QACN,IAAI,CAACC,IAAI,GAAG,aAAA;AAChB;AACJ;AAEO,eAAeC,gBAAAA,CAAiBC,QAAsC,EAAEC,OAAAA,GAAgJ;IAAEC,KAAAA,EAAO;AAAc,CAAC,EAAA;AACnP,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;IACf,MAAMC,OAAAA,GAAUC,MAAc,CAAC;AAAEC,QAAAA,GAAAA,EAAKJ,OAAOK;AAAM,KAAA,CAAA;AACnD,IAAA,IAAIC,MAAAA,GAAwB,IAAA;IAC5B,IAAI;AAwCiBC,QAAAA,IAAAA,oCAAAA,EAAAA,4BAAAA,EAAAA,oBAAAA;AAvCjB,QAAA,MAAMC,MAAAA,GAASC,OAAAA,CAAQC,GAAG,CAACC,cAAc;AACzC,QAAA,IAAI,CAACH,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIhB,WAAAA,CAAY,gDAAA,CAAA;AAC1B;;AAGAc,QAAAA,MAAAA,GAAS,IAAIM,MAAAA,CAAO;YAChBJ,MAAAA,EAAQA;AACZ,SAAA,CAAA;QAEAR,MAAAA,CAAOK,KAAK,CAAC,8BAAA,EAAgCR,QAAAA,CAAA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,SAAA,CAAE,OAAOU,SAAAA,EAAW;AAChB5C,YAAAA,MAAAA,CAAOK,KAAK,CAAC,uCAAA,EAA0CuC,UAAoBlD,OAAO,CAAA;AACtF;QACA,IAAI;AACA,YAAA,IAAIY,UAAU,OAAQA,MAAAA,CAAe4B,KAAK,KAAK,UAAA,EAAY;gBACvD,MAAO5B,OAAe4B,KAAK,EAAA;AAC/B;AACJ,SAAA,CAAE,OAAOC,QAAAA,EAAU;AACfnC,YAAAA,MAAAA,CAAOK,KAAK,CAAC,mCAAA,EAAsC8B,SAAmBzC,OAAO,CAAA;AACjF;AACJ;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrforge/kodrdriv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "Create Intelligent Release Notes or Change Logs from Git",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"openai": "^5.8.2",
|
|
36
36
|
"shell-escape": "^0.2.0",
|
|
37
37
|
"winston": "^3.17.0",
|
|
38
|
-
"zod": "^3.25.
|
|
38
|
+
"zod": "^3.25.69"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/eslintrc": "^3.3.1",
|
package/.kodrdriv/config.yaml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
verbose: false
|
|
2
|
-
model: gpt-4.1
|
|
3
|
-
contextDirectories:
|
|
4
|
-
- .kodrdriv/context
|
|
5
|
-
commit:
|
|
6
|
-
add: true
|
|
7
|
-
cached: true
|
|
8
|
-
sendit: true
|
|
9
|
-
release:
|
|
10
|
-
from: main
|
|
11
|
-
to: HEAD
|
|
12
|
-
publish:
|
|
13
|
-
mergeMethod: squash
|
|
14
|
-
dependencyUpdatePatterns: ["@theunwalked/*", "@riotprompt/*"]
|
|
15
|
-
requiredEnvVars: ["NODE_AUTH_TOKEN"]
|
|
16
|
-
link:
|
|
17
|
-
scopeRoots:
|
|
18
|
-
"@theunwalked": "../../SemicolonAmbulance"
|
|
19
|
-
"@riotprompt": "../../StJustReckoning"
|
|
20
|
-
workspaceFile: "pnpm-workspace.yaml"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
KodrDriv is a tool that is designed to help automate the creation of commit messages and release notes. It is also a tool that has been designed to support an opinionated approach to organizing related projects and conducting structured releases with Git. This initial version focuses on pnpm and GitHub, but there are plans to expand coverage over time.
|
|
2
|
-
|
|
3
|
-
KodrDriv is available as an module on npmjs.org under @eldrforge/kodrdriv
|
|
4
|
-
|
|
5
|
-
The name sometimes sounds like "Coder Driv" or "Coder Riv" but that should be corrected to "KodrDriv"
|
|
6
|
-
|
|
7
|
-
Same with the name of the scope "Elder Forge" or "Elderforth" should be corrected to "Edlrforge"
|
package/RELEASE_NOTES.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
This release updates workspace management and CI deployment for projects using pnpm with an opinionated structure. The changes restore explicit workspace scoping and local package link overrides, improving multi-package development while streamlining documentation deployment.
|
|
2
|
-
|
|
3
|
-
**Improvements**
|
|
4
|
-
|
|
5
|
-
* Restored exclusions for the `docs` directory and local dependency overrides in `pnpm-workspace.yaml` to clarify project boundaries and enable local development workflows for core packages.
|
|
6
|
-
* Simplified the `deploy-docs.yml` workflow by removing temporary renaming of the workspace file; documentation builds and deployments now work directly with the refined workspace configuration.
|
|
7
|
-
|
|
8
|
-
**Why these changes matter:**
|
|
9
|
-
|
|
10
|
-
* Empower clearer separation between core packages and documentation in the monorepo setup.
|
|
11
|
-
* Align local development processes and CI deployment behavior.
|
|
12
|
-
* Reduce special-casing and ad-hoc workarounds in documentation workflows.
|
|
13
|
-
|
|
14
|
-
_No breaking changes or new features are introduced for end users._
|
package/docs/index.html
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8" />
|
|
6
|
-
<link rel="icon" type="image/svg+xml" href="/code-icon.svg" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<title>š KodrDriv - Intelligent Git Release Notes</title>
|
|
9
|
-
<meta name="description" content="Create Intelligent Release Notes and Change Logs from Git using AI">
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
<div id="root"></div>
|
|
14
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
15
|
-
</body>
|
|
16
|
-
|
|
17
|
-
</html>
|
package/docs/package.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "kodrdriv-docs",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "tsc && vite build",
|
|
9
|
-
"preview": "vite preview",
|
|
10
|
-
"test": "vitest run --coverage",
|
|
11
|
-
"test:watch": "vitest --watch"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"react": "^19.1.0",
|
|
15
|
-
"react-dom": "^19.1.0",
|
|
16
|
-
"react-markdown": "^10.1.0",
|
|
17
|
-
"react-router-dom": "^7.6.3",
|
|
18
|
-
"react-syntax-highlighter": "^15.6.1",
|
|
19
|
-
"remark-gfm": "^4.0.1"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
23
|
-
"@testing-library/react": "^16.3.0",
|
|
24
|
-
"@testing-library/user-event": "^14.6.1",
|
|
25
|
-
"@types/react": "^19.1.8",
|
|
26
|
-
"@types/react-dom": "^19.1.6",
|
|
27
|
-
"@types/react-syntax-highlighter": "^15.5.13",
|
|
28
|
-
"@vitejs/plugin-react": "^4.6.0",
|
|
29
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
30
|
-
"@vitest/ui": "^3.2.4",
|
|
31
|
-
"jsdom": "^26.1.0",
|
|
32
|
-
"typescript": "^5.8.3",
|
|
33
|
-
"vite": "^7.0.0",
|
|
34
|
-
"vitest": "^3.2.4"
|
|
35
|
-
}
|
|
36
|
-
}
|