@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.
Files changed (51) hide show
  1. package/.kodrdriv/context/content.md +7 -1
  2. package/RELEASE_NOTES.md +14 -0
  3. package/dist/arguments.js +332 -9
  4. package/dist/arguments.js.map +1 -1
  5. package/dist/commands/audio-commit.js +666 -0
  6. package/dist/commands/audio-commit.js.map +1 -0
  7. package/dist/commands/audio-review.js +677 -0
  8. package/dist/commands/audio-review.js.map +1 -0
  9. package/dist/commands/clean.js +36 -0
  10. package/dist/commands/clean.js.map +1 -0
  11. package/dist/commands/commit.js +32 -7
  12. package/dist/commands/commit.js.map +1 -1
  13. package/dist/commands/publish.js +15 -7
  14. package/dist/commands/publish.js.map +1 -1
  15. package/dist/commands/release.js +31 -3
  16. package/dist/commands/release.js.map +1 -1
  17. package/dist/commands/review.js +152 -0
  18. package/dist/commands/review.js.map +1 -0
  19. package/dist/constants.js +90 -59
  20. package/dist/constants.js.map +1 -1
  21. package/dist/content/diff.js +155 -1
  22. package/dist/content/diff.js.map +1 -1
  23. package/dist/content/issues.js +240 -0
  24. package/dist/content/issues.js.map +1 -0
  25. package/dist/content/releaseNotes.js +90 -0
  26. package/dist/content/releaseNotes.js.map +1 -0
  27. package/dist/main.js +23 -10
  28. package/dist/main.js.map +1 -1
  29. package/dist/prompt/instructions/commit.md +18 -15
  30. package/dist/prompt/instructions/release.md +6 -5
  31. package/dist/prompt/instructions/review.md +108 -0
  32. package/dist/prompt/personas/reviewer.md +29 -0
  33. package/dist/prompt/prompts.js +110 -13
  34. package/dist/prompt/prompts.js.map +1 -1
  35. package/dist/types.js +36 -1
  36. package/dist/types.js.map +1 -1
  37. package/dist/util/general.js +35 -2
  38. package/dist/util/general.js.map +1 -1
  39. package/dist/util/github.js +54 -1
  40. package/dist/util/github.js.map +1 -1
  41. package/dist/util/openai.js +68 -4
  42. package/dist/util/openai.js.map +1 -1
  43. package/dist/util/stdin.js +61 -0
  44. package/dist/util/stdin.js.map +1 -0
  45. package/dist/util/storage.js +20 -1
  46. package/dist/util/storage.js.map +1 -1
  47. package/docs/public/commands.md +20 -0
  48. package/output/kodrdriv/250702-0552-release-notes.md +3 -0
  49. package/package.json +7 -6
  50. package/pnpm-workspace.yaml +2 -0
  51. package/vitest.config.ts +4 -4
@@ -2,7 +2,7 @@ Task #1: Write release notes by reading all of the log messages from this releas
2
2
 
3
3
  Task #2: Provide a detailed list of changes involved in this release, and make sure that the release notes are directly related to the content in the log messages.
4
4
 
5
- Task #3: Use the content in the <context> section to help you write the release notes and to help make connections with people, projects, issues, features, and other information.
5
+ Task #3: Use the content in the Release Focus section as the PRIMARY GUIDE for writing the release notes and to help make connections with people, projects, issues, features, and other information. The Release Focus should heavily influence the tone, emphasis, and structure of your release notes.
6
6
 
7
7
  ### Output Format
8
8
 
@@ -41,13 +41,14 @@ Create release notes that:
41
41
 
42
42
  ## 🧭 Instructions
43
43
 
44
- 1. **Use the "User Context" section at the top** of the input as your guide to the **focus and framing** of this release. This context may include:
44
+ 1. **Use the "Release Focus" section as your PRIMARY GUIDE** to the **focus and framing** of this release. This is the MOST IMPORTANT input for determining how to write the release notes. The Release Focus may include:
45
45
 
46
46
  * The theme or reason behind the release (e.g., "we're cleaning up configuration files", "this is about improving test stability")
47
47
  * Key goals or constraints
48
48
  * Target audiences or known issues being addressed
49
+ * Strategic direction or priorities for this release
49
50
 
50
- ⚠️ The User Context should shape the **opening paragraph** and influence which changes are emphasized.
51
+ 🎯 **CRITICAL**: The Release Focus should shape the **opening paragraph**, determine which changes are emphasized most prominently, and guide the overall narrative of the release notes. If Release Focus is provided, it takes precedence over all other considerations in structuring your response.
51
52
 
52
53
  2. **Structure the release notes as follows:**
53
54
 
@@ -84,7 +85,7 @@ Create release notes that:
84
85
 
85
86
  ```json
86
87
  {
87
- "title": "New Generation Types, and Updates to API",
88
- "body": "This release focuses on simplifying the configuration system and removing deprecated environment-specific files. Based on internal feedback, the team prioritized changes that reduce friction for new developers and standardize build behavior across local and CI environments.\\n\\n**Improvements**\\n\\n* Unified `vite.config.ts` and `webpack.config.js` into a single environment-aware module\\n* Reduced config nesting depth in `tsconfig.json` to improve readability\\n* Updated CI scripts to use `.env.defaults` instead of `.env.local`\\n\\n**Bug Fixes**\\n\\n* Fixed crash in config loader when optional fields were undefined\\n* Resolved issue with `yarn build` failing on Windows due to missing path escape\\n\\n**Documentation Updates**\\n\\n* Rewrote setup instructions in `README.md` to reflect unified config process\\n* Removed legacy instructions for `env.local.js`"
88
+ "title": "Configuration System Simplification and Developer Experience Improvements",
89
+ "body": "This release focuses on simplifying the configuration system and removing deprecated environment-specific files. Based on the Release Focus of improving developer onboarding and standardizing build behavior, the team prioritized changes that reduce friction for new developers and standardize build behavior across local and CI environments.\\n\\n**Improvements**\\n\\n* Unified `vite.config.ts` and `webpack.config.js` into a single environment-aware module\\n* Reduced config nesting depth in `tsconfig.json` to improve readability\\n* Updated CI scripts to use `.env.defaults` instead of `.env.local`\\n\\n**Bug Fixes**\\n\\n* Fixed crash in config loader when optional fields were undefined\\n* Resolved issue with `yarn build` failing on Windows due to missing path escape\\n\\n**Documentation Updates**\\n\\n* Rewrote setup instructions in `README.md` to reflect unified config process\\n* Removed legacy instructions for `env.local.js`"
89
90
  }
90
91
  ```
@@ -0,0 +1,108 @@
1
+ **🔧 Task Definition**
2
+
3
+ You are analyzing review notes about a software project. Your task is to extract specific, actionable issues that can be addressed by the development team.
4
+
5
+ The content contains:
6
+
7
+ * **\[Review Notes]** — Feedback that may include observations, criticisms, suggestions, or general commentary about the project.
8
+ * **\[User Context]** — **IMPORTANT**: Critical background information about the project including recent commits, diffs, release notes, and open GitHub issues. This context is essential for understanding the current state of the project and providing informed analysis.
9
+
10
+ ---
11
+
12
+ ## 🎯 OUTPUT REQUIREMENTS
13
+
14
+ ### ✅ CRITICAL: JSON Format Required
15
+
16
+ You **MUST** respond with valid JSON in this exact format:
17
+
18
+ ```json
19
+ {
20
+ "summary": "Brief overview of the review session",
21
+ "totalIssues": number,
22
+ "issues": [
23
+ {
24
+ "title": "Short descriptive title",
25
+ "description": "Detailed description of the issue",
26
+ "priority": "low|medium|high",
27
+ "category": "ui|content|functionality|accessibility|performance|other",
28
+ "suggestions": ["actionable suggestion 1", "actionable suggestion 2"]
29
+ }
30
+ ]
31
+ }
32
+ ```
33
+
34
+ ---
35
+
36
+ ## 📋 CATEGORIZATION GUIDE
37
+
38
+ ### Categories:
39
+ * **ui** — Visual design, layout, styling issues
40
+ * **content** — Text, copy, documentation issues
41
+ * **functionality** — Features, behavior, logic issues
42
+ * **accessibility** — Usability, accessibility concerns
43
+ * **performance** — Speed, optimization issues
44
+ * **other** — Any other type of issue
45
+
46
+ ### Priorities:
47
+ * **high** — Critical issues that significantly impact user experience
48
+ * **medium** — Important issues that should be addressed soon
49
+ * **low** — Minor issues or improvements
50
+
51
+ ---
52
+
53
+ ## ⚠️ IMPORTANT: Using Review Notes and User Context
54
+
55
+ **CRITICAL APPROACH:**
56
+
57
+ * **Review Notes** — This is the PRIMARY source you should use to extract issues. The feedback provided here should generate actionable items.
58
+ * **User Context** — **ESSENTIAL for informed analysis**: This provides crucial background information that you MUST consider when analyzing the review notes. Use this context to:
59
+ - Understand the current state of the project
60
+ - Avoid duplicating existing known issues
61
+ - Provide more accurate prioritization
62
+ - Suggest solutions that align with recent development work
63
+ - Understand the broader project goals and constraints
64
+
65
+ **If the review notes are empty, blank, or contain no actionable feedback:**
66
+ * Return `"totalIssues": 0` and `"issues": []`
67
+ * Do NOT generate issues from context alone when no review feedback is provided
68
+
69
+ **Avoiding Duplicate Issues:**
70
+ * **CRITICALLY IMPORTANT**: If the User Context includes open GitHub issues, review them carefully
71
+ * Do NOT create new issues for problems that are already documented in existing issues
72
+ * Only create issues for NEW problems mentioned in the review notes that are not already covered
73
+ * If a review issue is similar to an existing one but has new details, you may create it but note the relationship
74
+ * Use the User Context to understand what work is already planned or in progress
75
+
76
+ ---
77
+
78
+ ## ✅ DO:
79
+
80
+ * **Extract specific, actionable issues** mentioned in the review notes
81
+ * **Leverage User Context** to provide informed analysis and avoid duplicates
82
+ * **Provide clear, implementable suggestions** for fixes that consider the current project state
83
+ * **Use appropriate categories and priorities** based on impact and context
84
+ * **Focus on concrete problems** that can be addressed by developers
85
+ * **Include enough detail** in descriptions for developers to understand the issue
86
+
87
+ ## ❌ DO NOT:
88
+
89
+ * ❌ Include vague or non-actionable feedback
90
+ * ❌ Create issues for purely subjective preferences without clear rationale
91
+ * ❌ Ignore the User Context when analyzing review notes
92
+ * ❌ Include commentary that doesn't translate to specific improvements
93
+ * ❌ Use any format other than the required JSON structure
94
+
95
+ ---
96
+
97
+ ## 🎯 Focus Areas
98
+
99
+ Prioritize feedback that relates to:
100
+
101
+ * User experience problems
102
+ * Functional issues or bugs
103
+ * Accessibility concerns
104
+ * Performance problems
105
+ * Content clarity or accuracy
106
+ * Visual design issues that affect usability
107
+
108
+ Remember: Your goal is to help the development team understand what specific actions they can take to improve the project based on the review feedback, informed by the current project context.
@@ -0,0 +1,29 @@
1
+ You are an expert software project reviewer who specializes in analyzing spoken feedback to identify actionable issues and improvements.
2
+
3
+ ---
4
+
5
+ ### 🔑 Responsibilities
6
+
7
+ * **Extract Actionable Issues**
8
+ Listen to feedback and identify specific, implementable issues that can be addressed in a software project.
9
+
10
+ * **Categorize and Prioritize**
11
+ Organize issues by type (UI, content, functionality, etc.) and assign appropriate priority levels based on impact.
12
+
13
+ * **Provide Clear Suggestions**
14
+ Translate vague feedback into concrete, actionable suggestions that developers can implement.
15
+
16
+ * **Maintain Focus**
17
+ Filter out non-actionable commentary and focus on issues that can meaningfully improve the project.
18
+
19
+ ---
20
+
21
+ ### 🧠 Analysis Approach
22
+
23
+ * ✅ Convert spoken observations into structured, implementable tasks
24
+ * ✅ Distinguish between critical issues and minor improvements
25
+ * ✅ Provide context and reasoning for priority assignments
26
+ * ✅ Focus on user experience and practical functionality
27
+ * ❌ Don't include vague or non-specific feedback
28
+ * ❌ Don't assume context not provided in the transcription
29
+ * ❌ Don't create issues for comments that are purely subjective preferences without clear rationale
@@ -1,14 +1,14 @@
1
1
  import { Formatter, Builder } from '@riotprompt/riotprompt';
2
2
  import path from 'path';
3
3
  import { fileURLToPath } from 'url';
4
- import { DEFAULT_PERSONA_RELEASER_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_PERSONA_COMMITTER_FILE, DEFAULT_INSTRUCTIONS_COMMIT_FILE } from '../constants.js';
4
+ import { DEFAULT_PERSONA_REVIEWER_FILE, DEFAULT_INSTRUCTIONS_AUDIO_REVIEW_FILE, DEFAULT_PERSONA_RELEASER_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_PERSONA_COMMITTER_FILE, DEFAULT_INSTRUCTIONS_COMMIT_FILE } from '../constants.js';
5
5
  import { getLogger } from '../logging.js';
6
6
 
7
7
  const __filename = fileURLToPath(import.meta.url);
8
8
  const __dirname = path.dirname(__filename);
9
9
  const create = (model, runConfig)=>{
10
10
  const logger = getLogger();
11
- const createCommitPrompt = async (content, logContent, context)=>{
11
+ const createCommitPrompt = async ({ diffContent }, { logContext, userDirection, context })=>{
12
12
  let builder = Builder.create({
13
13
  logger,
14
14
  basePath: __dirname,
@@ -17,18 +17,37 @@ const create = (model, runConfig)=>{
17
17
  });
18
18
  builder = await builder.addPersonaPath(DEFAULT_PERSONA_COMMITTER_FILE);
19
19
  builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_COMMIT_FILE);
20
- if (context) {
21
- builder = await builder.addContent(`\n\n[User Context]\n${context}`);
20
+ if (userDirection) {
21
+ builder = await builder.addContent(userDirection, {
22
+ title: 'User Direction',
23
+ weight: 1.0
24
+ });
22
25
  }
23
- builder = await builder.addContent(`\n\n[Diff]\n${content}`);
24
- builder = await builder.addContent(`\n\n[Log]\n${logContent}`);
26
+ builder = await builder.addContent(diffContent, {
27
+ title: 'Diff',
28
+ weight: 0.5
29
+ });
25
30
  if (runConfig.contextDirectories) {
26
- builder = await builder.loadContext(runConfig.contextDirectories);
31
+ builder = await builder.loadContext(runConfig.contextDirectories, {
32
+ weight: 0.5
33
+ });
34
+ }
35
+ if (context) {
36
+ builder = await builder.addContext(context, {
37
+ title: 'User Context',
38
+ weight: 1.0
39
+ });
40
+ }
41
+ if (logContext) {
42
+ builder = await builder.addContext(logContext, {
43
+ title: 'Log Context',
44
+ weight: 0.5
45
+ });
27
46
  }
28
47
  const prompt = await builder.build();
29
48
  return prompt;
30
49
  };
31
- const createReleasePrompt = async (content, diffContent, context)=>{
50
+ const createReleasePrompt = async ({ logContent, diffContent }, { releaseFocus, context })=>{
32
51
  let builder = Builder.create({
33
52
  logger,
34
53
  basePath: __dirname,
@@ -37,24 +56,102 @@ const create = (model, runConfig)=>{
37
56
  });
38
57
  builder = await builder.addPersonaPath(DEFAULT_PERSONA_RELEASER_FILE);
39
58
  builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_RELEASE_FILE);
59
+ if (releaseFocus) {
60
+ builder = await builder.addContent(releaseFocus, {
61
+ title: 'Release Focus',
62
+ weight: 1.0
63
+ });
64
+ }
65
+ builder = await builder.addContent(logContent, {
66
+ title: 'Log',
67
+ weight: 0.5
68
+ });
69
+ builder = await builder.addContent(diffContent, {
70
+ title: 'Diff',
71
+ weight: 0.5
72
+ });
73
+ if (runConfig.contextDirectories) {
74
+ builder = await builder.loadContext(runConfig.contextDirectories, {
75
+ weight: 0.5
76
+ });
77
+ }
40
78
  if (context) {
41
- builder = await builder.addContent(`\n\n[User Context]\n${context}`);
79
+ builder = await builder.addContext(context, {
80
+ title: 'User Context',
81
+ weight: 1.0
82
+ });
42
83
  }
43
- builder = await builder.addContent(`\n\n[Log]\n${content}`);
44
- builder = await builder.addContent(`\n\n[Diff]\n${diffContent}`);
84
+ const prompt = await builder.build();
85
+ return prompt;
86
+ };
87
+ const createReviewPrompt = async ({ notes }, { logContext, diffContext, releaseNotesContext, issuesContext, context })=>{
88
+ let builder = Builder.create({
89
+ logger,
90
+ basePath: __dirname,
91
+ overridePath: runConfig === null || runConfig === void 0 ? void 0 : runConfig.configDirectory,
92
+ overrides: (runConfig === null || runConfig === void 0 ? void 0 : runConfig.overrides) || false
93
+ });
94
+ builder = await builder.addPersonaPath(DEFAULT_PERSONA_REVIEWER_FILE);
95
+ builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_AUDIO_REVIEW_FILE);
96
+ builder = await builder.addContent(notes, {
97
+ title: 'Review Notes',
98
+ weight: 1.0
99
+ });
45
100
  if (runConfig.contextDirectories) {
46
- builder = await builder.loadContext(runConfig.contextDirectories);
101
+ builder = await builder.loadContext(runConfig.contextDirectories, {
102
+ weight: 0.5
103
+ });
104
+ }
105
+ if (logContext) {
106
+ builder = await builder.addContext(logContext, {
107
+ title: 'Log Context',
108
+ weight: 0.5
109
+ });
110
+ }
111
+ if (diffContext) {
112
+ builder = await builder.addContext(diffContext, {
113
+ title: 'Diff Context',
114
+ weight: 0.5
115
+ });
116
+ }
117
+ if (releaseNotesContext) {
118
+ builder = await builder.addContext(releaseNotesContext, {
119
+ title: 'Release Notes Context',
120
+ weight: 0.5
121
+ });
122
+ }
123
+ if (issuesContext) {
124
+ builder = await builder.addContext(issuesContext, {
125
+ title: 'Issues Context',
126
+ weight: 0.5
127
+ });
128
+ }
129
+ if (context) {
130
+ builder = await builder.addContext(context, {
131
+ title: 'User Context',
132
+ weight: 1.0
133
+ });
47
134
  }
48
135
  const prompt = await builder.build();
49
136
  return prompt;
50
137
  };
51
138
  const format = (prompt)=>{
52
139
  const formatter = Formatter.create();
53
- return formatter.formatPrompt(model, prompt);
140
+ const request = formatter.formatPrompt(model, prompt);
141
+ // Debug log the final formatted prompt
142
+ if (runConfig.debug) {
143
+ logger.debug('Final formatted prompt for AI:');
144
+ logger.debug('Messages count: %d', request.messages.length);
145
+ request.messages.forEach((message, index)=>{
146
+ logger.debug('Message %d (%s): %s', index + 1, message.role || 'unknown', typeof message.content === 'string' ? message.content.substring(0, 500) + (message.content.length > 500 ? '...' : '') : JSON.stringify(message.content).substring(0, 500));
147
+ });
148
+ }
149
+ return request;
54
150
  };
55
151
  return {
56
152
  createCommitPrompt,
57
153
  createReleasePrompt,
154
+ createReviewPrompt,
58
155
  format
59
156
  };
60
157
  };
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sources":["../../src/prompt/prompts.ts"],"sourcesContent":["import { Builder, Formatter, Model, Prompt, Request } from '@riotprompt/riotprompt';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { DEFAULT_INSTRUCTIONS_COMMIT_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_PERSONA_COMMITTER_FILE, DEFAULT_PERSONA_RELEASER_FILE } from '../constants';\nimport { getLogger } from '../logging';\nimport { Config as RunConfig } from '../types';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nexport interface Factory {\n createCommitPrompt: (content: string, logContent: string, context?: string) => Promise<Prompt>;\n createReleasePrompt: (content: string, diffContent: string, context?: string) => Promise<Prompt>;\n format: (prompt: Prompt) => Request;\n}\n\nexport const create = (model: Model, runConfig: RunConfig): Factory => {\n\n const logger = getLogger();\n\n const createCommitPrompt = async (content: string, logContent: string, context?: string): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_COMMITTER_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_COMMIT_FILE);\n if (context) {\n builder = await builder.addContent(`\\n\\n[User Context]\\n${context}`);\n }\n builder = await builder.addContent(`\\n\\n[Diff]\\n${content}`);\n builder = await builder.addContent(`\\n\\n[Log]\\n${logContent}`);\n\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories);\n }\n\n const prompt = await builder.build();\n return prompt;\n };\n\n const createReleasePrompt = async (content: string, diffContent: string, context?: string): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_RELEASER_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_RELEASE_FILE);\n if (context) {\n builder = await builder.addContent(`\\n\\n[User Context]\\n${context}`);\n }\n builder = await builder.addContent(`\\n\\n[Log]\\n${content}`);\n builder = await builder.addContent(`\\n\\n[Diff]\\n${diffContent}`);\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories);\n }\n\n const prompt = await builder.build();\n return prompt;\n }\n\n const format = (prompt: Prompt): Request => {\n const formatter = Formatter.create();\n return formatter.formatPrompt(model, prompt);\n };\n\n return {\n createCommitPrompt,\n createReleasePrompt,\n format,\n };\n}\n\n"],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","create","model","runConfig","logger","getLogger","createCommitPrompt","content","logContent","context","builder","Builder","basePath","overridePath","configDirectory","overrides","addPersonaPath","DEFAULT_PERSONA_COMMITTER_FILE","addInstructionPath","DEFAULT_INSTRUCTIONS_COMMIT_FILE","addContent","contextDirectories","loadContext","prompt","build","createReleasePrompt","diffContent","DEFAULT_PERSONA_RELEASER_FILE","DEFAULT_INSTRUCTIONS_RELEASE_FILE","format","formatter","Formatter","formatPrompt"],"mappings":";;;;;;AAOA,MAAMA,UAAAA,GAAaC,aAAAA,CAAc,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,IAAAA,CAAKC,OAAO,CAACL,UAAAA,CAAAA;AAQxB,MAAMM,MAAAA,GAAS,CAACC,KAAAA,EAAcC,SAAAA,GAAAA;AAEjC,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;IAEf,MAAMC,kBAAAA,GAAqB,OAAOC,OAAAA,EAAiBC,UAAAA,EAAoBC,OAAAA,GAAAA;QACnE,IAAIC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CAAAA;AACzC,KAAA;IAEA,OAAO;AACHjB,QAAAA,kBAAAA;AACAmB,QAAAA,mBAAAA;AACAI,QAAAA;AACJ,KAAA;AACJ;;;;"}
1
+ {"version":3,"file":"prompts.js","sources":["../../src/prompt/prompts.ts"],"sourcesContent":["import { Builder, Formatter, Model, Prompt, Request } from '@riotprompt/riotprompt';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { DEFAULT_INSTRUCTIONS_COMMIT_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_INSTRUCTIONS_AUDIO_REVIEW_FILE, DEFAULT_PERSONA_COMMITTER_FILE, DEFAULT_PERSONA_RELEASER_FILE, DEFAULT_PERSONA_REVIEWER_FILE } from '../constants';\nimport { getLogger } from '../logging';\nimport { Config as RunConfig } from '../types';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nexport interface Factory {\n createCommitPrompt: ({ diffContent }: { diffContent: string }, { logContext, userDirection, context }: { logContext?: string, userDirection?: string, context?: string }) => Promise<Prompt>;\n createReleasePrompt: ({ logContent, diffContent }: { logContent: string, diffContent: string }, { releaseFocus, context }: { releaseFocus?: string, context?: string }) => Promise<Prompt>;\n createReviewPrompt: ({ notes }: { notes: string }, { logContext, diffContext, releaseNotesContext, issuesContext, context }: { logContext?: string, diffContext?: string, releaseNotesContext?: string, issuesContext?: string, context?: string }) => Promise<Prompt>;\n format: (prompt: Prompt) => Request;\n}\n\nexport const create = (model: Model, runConfig: RunConfig): Factory => {\n\n const logger = getLogger();\n\n const createCommitPrompt = async ({ diffContent }: { diffContent: string }, { logContext, userDirection, context }: { logContext?: string, userDirection?: string, context?: string }): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_COMMITTER_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_COMMIT_FILE);\n if (userDirection) {\n builder = await builder.addContent(userDirection, { title: 'User Direction', weight: 1.0 });\n }\n builder = await builder.addContent(diffContent, { title: 'Diff', weight: 0.5 });\n\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories, { weight: 0.5 });\n }\n if (context) {\n builder = await builder.addContext(context, { title: 'User Context', weight: 1.0 });\n }\n if (logContext) {\n builder = await builder.addContext(logContext, { title: 'Log Context', weight: 0.5 });\n }\n\n const prompt = await builder.build();\n return prompt;\n };\n\n const createReleasePrompt = async ({ logContent, diffContent }: { logContent: string, diffContent: string }, { releaseFocus, context }: { releaseFocus?: string, context?: string }): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_RELEASER_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_RELEASE_FILE);\n if (releaseFocus) {\n builder = await builder.addContent(releaseFocus, { title: 'Release Focus', weight: 1.0 });\n }\n builder = await builder.addContent(logContent, { title: 'Log', weight: 0.5 });\n builder = await builder.addContent(diffContent, { title: 'Diff', weight: 0.5 });\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories, { weight: 0.5 });\n }\n if (context) {\n builder = await builder.addContext(context, { title: 'User Context', weight: 1.0 });\n }\n\n const prompt = await builder.build();\n return prompt;\n }\n\n const createReviewPrompt = async ({ notes }: { notes: string }, { logContext, diffContext, releaseNotesContext, issuesContext, context }: { logContext?: string, diffContext?: string, releaseNotesContext?: string, issuesContext?: string, context?: string }): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_REVIEWER_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_AUDIO_REVIEW_FILE);\n\n builder = await builder.addContent(notes, { title: 'Review Notes', weight: 1.0 });\n\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories, { weight: 0.5 });\n }\n if (logContext) {\n builder = await builder.addContext(logContext, { title: 'Log Context', weight: 0.5 });\n }\n if (diffContext) {\n builder = await builder.addContext(diffContext, { title: 'Diff Context', weight: 0.5 });\n }\n if (releaseNotesContext) {\n builder = await builder.addContext(releaseNotesContext, { title: 'Release Notes Context', weight: 0.5 });\n }\n if (issuesContext) {\n builder = await builder.addContext(issuesContext, { title: 'Issues Context', weight: 0.5 });\n }\n if (context) {\n builder = await builder.addContext(context, { title: 'User Context', weight: 1.0 });\n }\n\n const prompt = await builder.build();\n return prompt;\n };\n\n const format = (prompt: Prompt): Request => {\n const formatter = Formatter.create();\n const request = formatter.formatPrompt(model, prompt);\n\n // Debug log the final formatted prompt\n if (runConfig.debug) {\n logger.debug('Final formatted prompt for AI:');\n logger.debug('Messages count: %d', request.messages.length);\n request.messages.forEach((message, index) => {\n logger.debug('Message %d (%s): %s',\n index + 1,\n (message as any).role || 'unknown',\n typeof (message as any).content === 'string'\n ? (message as any).content.substring(0, 500) + (((message as any).content.length > 500) ? '...' : '')\n : JSON.stringify((message as any).content).substring(0, 500)\n );\n });\n }\n\n return request;\n };\n\n return {\n createCommitPrompt,\n createReleasePrompt,\n createReviewPrompt,\n format,\n };\n}\n\n"],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","create","model","runConfig","logger","getLogger","createCommitPrompt","diffContent","logContext","userDirection","context","builder","Builder","basePath","overridePath","configDirectory","overrides","addPersonaPath","DEFAULT_PERSONA_COMMITTER_FILE","addInstructionPath","DEFAULT_INSTRUCTIONS_COMMIT_FILE","addContent","title","weight","contextDirectories","loadContext","addContext","prompt","build","createReleasePrompt","logContent","releaseFocus","DEFAULT_PERSONA_RELEASER_FILE","DEFAULT_INSTRUCTIONS_RELEASE_FILE","createReviewPrompt","notes","diffContext","releaseNotesContext","issuesContext","DEFAULT_PERSONA_REVIEWER_FILE","DEFAULT_INSTRUCTIONS_AUDIO_REVIEW_FILE","format","formatter","Formatter","request","formatPrompt","debug","messages","length","forEach","message","index","role","content","substring","JSON","stringify"],"mappings":";;;;;;AAOA,MAAMA,UAAAA,GAAaC,aAAAA,CAAc,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,IAAAA,CAAKC,OAAO,CAACL,UAAAA,CAAAA;AASxB,MAAMM,MAAAA,GAAS,CAACC,KAAAA,EAAcC,SAAAA,GAAAA;AAEjC,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;AAEf,IAAA,MAAMC,kBAAAA,GAAqB,OAAO,EAAEC,WAAW,EAA2B,EAAE,EAAEC,UAAU,EAAEC,aAAa,EAAEC,OAAO,EAAqE,GAAA;QACjL,IAAIC,OAAAA,GAA4BC,OAAAA,CAAQX,MAAM,CAAC;AAAEG,YAAAA,MAAAA;YAAQS,QAAAA,EAAUf,SAAAA;AAAWgB,YAAAA,YAAY,EAAEX,SAAAA,KAAAA,IAAAA,IAAAA,SAAAA,KAAAA,MAAAA,GAAAA,MAAAA,GAAAA,SAAAA,CAAWY,eAAe;AAAEC,YAAAA,SAAAA,EAAWb,CAAAA,SAAAA,KAAAA,IAAAA,IAAAA,SAAAA,KAAAA,MAAAA,GAAAA,MAAAA,GAAAA,SAAAA,CAAWa,SAAS,KAAI;AAAM,SAAA,CAAA;QACjKL,OAAAA,GAAU,MAAMA,OAAAA,CAAQM,cAAc,CAACC,8BAAAA,CAAAA;QACvCP,OAAAA,GAAU,MAAMA,OAAAA,CAAQQ,kBAAkB,CAACC,gCAAAA,CAAAA;AAC3C,QAAA,IAAIX,aAAAA,EAAe;AACfE,YAAAA,OAAAA,GAAU,MAAMA,OAAAA,CAAQU,UAAU,CAACZ,aAAAA,EAAe;gBAAEa,KAAAA,EAAO,gBAAA;gBAAkBC,MAAAA,EAAQ;AAAI,aAAA,CAAA;AAC7F;AACAZ,QAAAA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AI,IAAI,SAAA,EACzB,OAAO,OAACF,CAAgBG,OAAO,KAAK,QAAA,GAC9B,OAACH,CAAgBG,OAAO,CAACC,SAAS,CAAC,GAAG,GAAA,CAAA,IAAQ,OAAEJ,CAAgBG,OAAO,CAACL,MAAM,GAAG,GAAA,GAAO,KAAA,GAAQ,EAAC,CAAA,GACjGO,IAAAA,CAAKC,SAAS,CAAEN,QAAgBG,OAAO,CAAA,CAAEC,SAAS,CAAC,CAAA,EAAG,GAAA,CAAA,CAAA;AAEpE,aAAA,CAAA;AACJ;QAEA,OAAOV,OAAAA;AACX,KAAA;IAEA,OAAO;AACHtC,QAAAA,kBAAAA;AACAuB,QAAAA,mBAAAA;AACAK,QAAAA,kBAAAA;AACAO,QAAAA;AACJ,KAAA;AACJ;;;;"}
package/dist/types.js CHANGED
@@ -8,12 +8,19 @@ const ConfigSchema = z.object({
8
8
  instructions: z.string().optional(),
9
9
  model: z.string().optional(),
10
10
  contextDirectories: z.array(z.string()).optional(),
11
+ outputDirectory: z.string().optional(),
11
12
  commit: z.object({
12
13
  add: z.boolean().optional(),
13
14
  cached: z.boolean().optional(),
14
15
  sendit: z.boolean().optional(),
15
16
  messageLimit: z.number().optional(),
16
- context: z.string().optional()
17
+ context: z.string().optional(),
18
+ direction: z.string().optional()
19
+ }).optional(),
20
+ audioCommit: z.object({
21
+ maxRecordingTime: z.number().optional(),
22
+ audioDevice: z.string().optional(),
23
+ selectAudioDevice: z.boolean().optional()
17
24
  }).optional(),
18
25
  release: z.object({
19
26
  from: z.string().optional(),
@@ -21,6 +28,34 @@ const ConfigSchema = z.object({
21
28
  messageLimit: z.number().optional(),
22
29
  context: z.string().optional()
23
30
  }).optional(),
31
+ review: z.object({
32
+ includeCommitHistory: z.boolean().optional(),
33
+ includeRecentDiffs: z.boolean().optional(),
34
+ includeReleaseNotes: z.boolean().optional(),
35
+ includeGithubIssues: z.boolean().optional(),
36
+ commitHistoryLimit: z.number().optional(),
37
+ diffHistoryLimit: z.number().optional(),
38
+ releaseNotesLimit: z.number().optional(),
39
+ githubIssuesLimit: z.number().optional(),
40
+ context: z.string().optional(),
41
+ sendit: z.boolean().optional(),
42
+ note: z.string().optional()
43
+ }).optional(),
44
+ audioReview: z.object({
45
+ includeCommitHistory: z.boolean().optional(),
46
+ includeRecentDiffs: z.boolean().optional(),
47
+ includeReleaseNotes: z.boolean().optional(),
48
+ includeGithubIssues: z.boolean().optional(),
49
+ commitHistoryLimit: z.number().optional(),
50
+ diffHistoryLimit: z.number().optional(),
51
+ releaseNotesLimit: z.number().optional(),
52
+ githubIssuesLimit: z.number().optional(),
53
+ context: z.string().optional(),
54
+ sendit: z.boolean().optional(),
55
+ maxRecordingTime: z.number().optional(),
56
+ audioDevice: z.string().optional(),
57
+ selectAudioDevice: z.boolean().optional()
58
+ }).optional(),
24
59
  publish: z.object({
25
60
  mergeMethod: z.enum([
26
61
  'merge',
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 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 }).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 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 PublishConfig = {\n from?: string;\n to?: string;\n}\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","instructions","string","model","contextDirectories","array","commit","add","cached","sendit","messageLimit","number","context","release","from","to","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,YAAAA,EAAcR,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;IACjCM,KAAAA,EAAOV,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,E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IAAIL,QAAQ,EAAA;QAC7CwB,qBAAAA,EAAuB5B,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;QAC3CyB,uBAAAA,EAAyB7B,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ;AACjD,KAAA,CAAA,CAAGA,QAAQ,EAAA;IACX0B,IAAAA,EAAM9B,CAAAA,CAAEC,MAAM,CAAC;QACX8B,UAAAA,EAAY/B,CAAAA,CAAEgC,MAAM,CAAChC,CAAAA,CAAES,MAAM,EAAA,EAAIT,CAAAA,CAAES,MAAM,EAAA,CAAA,CAAIL,QAAQ,EAAA;QACrD6B,aAAAA,EAAejC,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;QAClCF,MAAAA,EAAQF,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ;AAChC,KAAA,CAAA,CAAGA,QAAQ,EAAA;AACX8B,IAAAA,gBAAAA,EAAkBlC,EAAEY,KAAK,CAACZ,CAAAA,CAAES,MAAM,IAAIL,QAAQ;AAClD,CAAA;AAEkCJ,CAAAA,CAAEC,MAAM,CAAC;IACvCkC,YAAAA,EAAcnC,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACrC,CAAA;AAEmCJ,CAAAA,CAAEC,MAAM,CAAC;IACxCmC,WAAAA,EAAapC,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACpC,CAAA;;;;"}
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"],"mapp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AQ;AACpC,CAAA;;;;"}
@@ -1,4 +1,5 @@
1
- // Utility function for deep merging two objects.
1
+ import path from 'path';
2
+
2
3
  //Recursive implementation of jSON.stringify;
3
4
  const stringifyJSON = function(obj, options = {
4
5
  depth: 0
@@ -55,6 +56,38 @@ const incrementPatchVersion = (version)=>{
55
56
  parts[2] = (patch + 1).toString();
56
57
  return parts.join('.');
57
58
  };
59
+ const getOutputPath = (outputDirectory, filename)=>{
60
+ return path.join(outputDirectory, filename);
61
+ };
62
+ const getTimestampedFilename = (baseName, extension = '.json')=>{
63
+ const now = new Date();
64
+ // Format as YYMMdd-HHmm (e.g., 250701-1030)
65
+ const yy = now.getFullYear().toString().slice(-2);
66
+ const mm = (now.getMonth() + 1).toString().padStart(2, '0');
67
+ const dd = now.getDate().toString().padStart(2, '0');
68
+ const hh = now.getHours().toString().padStart(2, '0');
69
+ const min = now.getMinutes().toString().padStart(2, '0');
70
+ const timestamp = `${yy}${mm}${dd}-${hh}${min}`;
71
+ return `${timestamp}-${baseName}${extension}`;
72
+ };
73
+ const getTimestampedRequestFilename = (baseName)=>{
74
+ return getTimestampedFilename(baseName, '.request.json');
75
+ };
76
+ const getTimestampedResponseFilename = (baseName)=>{
77
+ return getTimestampedFilename(baseName, '.response.json');
78
+ };
79
+ const getTimestampedCommitFilename = ()=>{
80
+ return getTimestampedFilename('commit-message', '.md');
81
+ };
82
+ const getTimestampedReleaseNotesFilename = ()=>{
83
+ return getTimestampedFilename('release-notes', '.md');
84
+ };
85
+ const getTimestampedAudioFilename = ()=>{
86
+ return getTimestampedFilename('audio-recording', '.wav');
87
+ };
88
+ const getTimestampedTranscriptFilename = ()=>{
89
+ return getTimestampedFilename('audio-transcript', '.md');
90
+ };
58
91
 
59
- export { incrementPatchVersion, stringifyJSON };
92
+ export { getOutputPath, getTimestampedAudioFilename, getTimestampedCommitFilename, getTimestampedFilename, getTimestampedReleaseNotesFilename, getTimestampedRequestFilename, getTimestampedResponseFilename, getTimestampedTranscriptFilename, incrementPatchVersion, stringifyJSON };
60
93
  //# sourceMappingURL=general.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"general.js","sources":["../../src/util/general.ts"],"sourcesContent":["// Utility function for deep merging two objects.\nexport function deepMerge(target: any, source: any): any {\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key === \"__proto__\" || key === \"constructor\") {\n continue; // Skip prototype-polluting keys\n }\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n deepMerge(target[key], source[key]);\n } else {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\n\n//Recursive implementation of jSON.stringify;\nexport const stringifyJSON = function (obj: any, options: { depth: number } = { depth: 0 }): string {\n\n if (options.depth > 10) {\n return '{\"error\": \"Maximum depth reached\"}';\n }\n\n const arrOfKeyVals: string[] = [];\n const arrVals: string[] = [];\n let objKeys: string[] = [];\n\n /*********CHECK FOR PRIMITIVE TYPES**********/\n if (typeof obj === 'number' || typeof obj === 'boolean' || obj === null)\n return '' + obj;\n else if (typeof obj === 'string')\n return '\"' + obj + '\"';\n\n /*********CHECK FOR ARRAY**********/\n else if (Array.isArray(obj)) {\n //check for empty array\n if (obj[0] === undefined)\n return '[]';\n else {\n obj.forEach(function (el) {\n arrVals.push(stringifyJSON(el, { depth: options.depth + 1 }));\n });\n return '[' + arrVals + ']';\n }\n }\n /*********CHECK FOR OBJECT**********/\n else if (obj instanceof Object) {\n //get object keys\n objKeys = Object.keys(obj);\n //set key output;\n objKeys.forEach(function (key) {\n const keyOut = '\"' + key + '\":';\n const keyValOut = obj[key];\n //skip functions and undefined properties\n if (keyValOut instanceof Function || keyValOut === undefined)\n arrOfKeyVals.push('');\n else if (typeof keyValOut === 'string')\n arrOfKeyVals.push(keyOut + '\"' + keyValOut + '\"');\n else if (typeof keyValOut === 'boolean' || typeof keyValOut === 'number' || keyValOut === null)\n arrOfKeyVals.push(keyOut + keyValOut);\n //check for nested objects, call recursively until no more objects\n else if (keyValOut instanceof Object) {\n arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut, { depth: options.depth + 1 }));\n }\n });\n return '{' + arrOfKeyVals + '}';\n }\n return '';\n};\n\nexport const incrementPatchVersion = (version: string): string => {\n const parts = version.split('.');\n if (parts.length !== 3) {\n throw new Error(`Invalid version string: ${version}`);\n }\n const patch = parseInt(parts[2], 10);\n if (isNaN(patch)) {\n throw new Error(`Invalid patch version: ${parts[2]}`);\n }\n parts[2] = (patch + 1).toString();\n return parts.join('.');\n};"],"names":["stringifyJSON","obj","options","depth","arrOfKeyVals","arrVals","objKeys","Array","isArray","undefined","forEach","el","push","Object","keys","key","keyOut","keyValOut","Function","incrementPatchVersion","version","parts","split","length","Error","patch","parseInt","isNaN","toString","join"],"mappings":"AAAA;AAoBA;AACO,MAAMA,aAAAA,GAAgB,SAAUC,GAAQ,EAAEC,OAAAA,GAA6B;IAAEC,KAAAA,EAAO;AAAE,CAAC,EAAA;IAEtF,IAAID,OAAAA,CAAQC,KAAK,GAAG,EAAA,EAAI;QACpB,OAAO,oCAAA;AACX;AAEA,IAAA,MAAMC,eAAyB,EAAE;AACjC,IAAA,MAAMC,UAAoB,EAAE;AAC5B,IAAA,IAAIC,UAAoB,EAAE;mDAG1B,IAAI,OAAOL,GAAAA,KAAQ,QAAA,IAAY,OAAOA,GAAAA,KAAQ,SAAA,IAAaA,GAAAA,KAAQ,IAAA,EAC/D,OAAO,EAAA,GAAKA,GAAAA;AACX,SAAA,IAAI,OAAOA,GAAAA,KAAQ,QAAA,EACpB,OAAO,MAAMA,GAAAA,GAAM,GAAA;SAGlB,IAAIM,KAAAA,CAAMC,OAAO,CAACP,GAAAA,CAAAA,EAAM;;AAEzB,QAAA,IAAIA,GAAG,CAAC,CAAA,CAAE,KAAKQ,WACX,OAAO,IAAA;AACN,aAAA;YACDR,GAAAA,CAAIS,OAAO,CAAC,SAAUC,EAAE,EAAA;gBACpBN,OAAAA,CAAQO,IAAI,CAACZ,aAAAA,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AA;IAC5B,IAAID,KAAAA,CAAME,MAAM,KAAK,CAAA,EAAG;AACpB,QAAA,MAAM,IAAIC,KAAAA,CAAM,CAAC,wBAAwB,EAAEJ,OAAAA,CAAAA,CAAS,CAAA;AACxD;AACA,IAAA,MAAMK,KAAAA,GAAQC,QAAAA,CAASL,KAAK,CAAC,EAAE,EAAE,EAAA,CAAA;AACjC,IAAA,IAAIM,MAAMF,KAAAA,CAAAA,EAAQ;QACd,MAAM,IAAID,MAAM,CAAC,uBAAuB,EAAEH,KAAK,CAAC,EAAE,CAAA,CAAE,CAAA;AACxD;IACAA,KAAK,CAAC,EAAE,GAAII,CAAAA,KAAAA,GAAQ,CAAA,EAAGG,QAAQ,EAAA;IAC/B,OAAOP,KAAAA,CAAMQ,IAAI,CAAC,GAAA,CAAA;AACtB;;;;"}
1
+ {"version":3,"file":"general.js","sources":["../../src/util/general.ts"],"sourcesContent":["import path from 'path';\n\n// Utility function for deep merging two objects.\nexport function deepMerge(target: any, source: any): any {\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key === \"__proto__\" || key === \"constructor\") {\n continue; // Skip prototype-polluting keys\n }\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n deepMerge(target[key], source[key]);\n } else {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\n\n//Recursive implementation of jSON.stringify;\nexport const stringifyJSON = function (obj: any, options: { depth: number } = { depth: 0 }): string {\n\n if (options.depth > 10) {\n return '{\"error\": \"Maximum depth reached\"}';\n }\n\n const arrOfKeyVals: string[] = [];\n const arrVals: string[] = [];\n let objKeys: string[] = [];\n\n /*********CHECK FOR PRIMITIVE TYPES**********/\n if (typeof obj === 'number' || typeof obj === 'boolean' || obj === null)\n return '' + obj;\n else if (typeof obj === 'string')\n return '\"' + obj + '\"';\n\n /*********CHECK FOR ARRAY**********/\n else if (Array.isArray(obj)) {\n //check for empty array\n if (obj[0] === undefined)\n return '[]';\n else {\n obj.forEach(function (el) {\n arrVals.push(stringifyJSON(el, { depth: options.depth + 1 }));\n });\n return '[' + arrVals + ']';\n }\n }\n /*********CHECK FOR OBJECT**********/\n else if (obj instanceof Object) {\n //get object keys\n objKeys = Object.keys(obj);\n //set key output;\n objKeys.forEach(function (key) {\n const keyOut = '\"' + key + '\":';\n const keyValOut = obj[key];\n //skip functions and undefined properties\n if (keyValOut instanceof Function || keyValOut === undefined)\n arrOfKeyVals.push('');\n else if (typeof keyValOut === 'string')\n arrOfKeyVals.push(keyOut + '\"' + keyValOut + '\"');\n else if (typeof keyValOut === 'boolean' || typeof keyValOut === 'number' || keyValOut === null)\n arrOfKeyVals.push(keyOut + keyValOut);\n //check for nested objects, call recursively until no more objects\n else if (keyValOut instanceof Object) {\n arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut, { depth: options.depth + 1 }));\n }\n });\n return '{' + arrOfKeyVals + '}';\n }\n return '';\n};\n\nexport const incrementPatchVersion = (version: string): string => {\n const parts = version.split('.');\n if (parts.length !== 3) {\n throw new Error(`Invalid version string: ${version}`);\n }\n const patch = parseInt(parts[2], 10);\n if (isNaN(patch)) {\n throw new Error(`Invalid patch version: ${parts[2]}`);\n }\n parts[2] = (patch + 1).toString();\n return parts.join('.');\n};\n\nexport const getOutputPath = (outputDirectory: string, filename: string): string => {\n return path.join(outputDirectory, filename);\n};\n\nexport const getTimestampedFilename = (baseName: string, extension: string = '.json'): string => {\n const now = new Date();\n\n // Format as YYMMdd-HHmm (e.g., 250701-1030)\n const yy = now.getFullYear().toString().slice(-2);\n const mm = (now.getMonth() + 1).toString().padStart(2, '0');\n const dd = now.getDate().toString().padStart(2, '0');\n const hh = now.getHours().toString().padStart(2, '0');\n const min = now.getMinutes().toString().padStart(2, '0');\n\n const timestamp = `${yy}${mm}${dd}-${hh}${min}`;\n\n return `${timestamp}-${baseName}${extension}`;\n};\n\nexport const getTimestampedRequestFilename = (baseName: string): string => {\n return getTimestampedFilename(baseName, '.request.json');\n};\n\nexport const getTimestampedResponseFilename = (baseName: string): string => {\n return getTimestampedFilename(baseName, '.response.json');\n};\n\nexport const getTimestampedCommitFilename = (): string => {\n return getTimestampedFilename('commit-message', '.md');\n};\n\nexport const getTimestampedReleaseNotesFilename = (): string => {\n return getTimestampedFilename('release-notes', '.md');\n};\n\nexport const getTimestampedAudioFilename = (): string => {\n return getTimestampedFilename('audio-recording', '.wav');\n};\n\nexport const getTimestampedTranscriptFilename = (): string => {\n return getTimestampedFilename('audio-transcript', '.md');\n};"],"names":["stringifyJSON","obj","options","depth","arrOfKeyVals","arrVals","objKeys","Array","isArray","undefined","forEach","el","push","Object","keys","key","keyOut","keyValOut","Function","incrementPatchVersion","version","parts","split","length","Error","patch","parseInt","isNaN","toString","join","getOutputPath","outputDirectory","filename","path","getTimestampedFilename","baseName","extension","now","Date","yy","getFullYear","slice","mm","getMonth","padStart","dd","getDate","hh","getHours","min","getMinutes","timestamp","getTimestampedRequestFilename","getTimestampedResponseFilename","getTimestampedCommitFilename","getTimestampedReleaseNotesFilename","getTimestampedAudioFilename","getTimestampedTranscriptFilename"],"mappings":";;AAsBA;AACO,MAAMA,aAAAA,GAAgB,SAAUC,GAAQ,EAAEC,OAAAA,GAA6B;IAAEC,KAAAA,EAAO;AAAE,CAAC,EAAA;IAEtF,IAAID,OAAAA,CAAQC,KAAK,GAAG,EAAA,EAAI;QACpB,OAAO,oCAAA;AACX;AAEA,IAAA,MAAMC,eAAyB,EAAE;AACjC,IAAA,MAAMC,UAAoB,EAAE;AAC5B,IAAA,IAAIC,UAAoB,EAAE;mDAG1B,IAAI,OAAOL,GAAAA,KAAQ,QAAA,IAAY,OAAOA,GAAAA,KAAQ,SAAA,IAAaA,GAAAA,KAAQ,IAAA,EAC/D,OAAO,EAAA,GAAKA,GAAAA;AACX,SAAA,IAAI,OAAOA,GAAAA,KAAQ,QAAA,EACpB,OAAO,MAAMA,GAAAA,GAAM,GAAA;SAGlB,IAAIM,KAAAA,CAAMC,OAAO,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Issues = async (limit = 20)=>{
143
+ const octokit = getOctokit();
144
+ const { owner, repo } = await getRepoDetails();
145
+ const logger = getLogger();
146
+ try {
147
+ logger.debug(`Fetching up to ${limit} open GitHub issues...`);
148
+ const response = await octokit.issues.listForRepo({
149
+ owner,
150
+ repo,
151
+ state: 'open',
152
+ per_page: Math.min(limit, 100),
153
+ sort: 'updated',
154
+ direction: 'desc'
155
+ });
156
+ const issues = response.data.filter((issue)=>!issue.pull_request); // Filter out PRs
157
+ if (issues.length === 0) {
158
+ logger.debug('No open issues found');
159
+ return '';
160
+ }
161
+ const issueStrings = issues.slice(0, limit).map((issue)=>{
162
+ var _issue_body;
163
+ const labels = issue.labels.map((label)=>typeof label === 'string' ? label : label.name).join(', ');
164
+ return [
165
+ `Issue #${issue.number}: ${issue.title}`,
166
+ `Labels: ${labels || 'none'}`,
167
+ `Created: ${issue.created_at}`,
168
+ `Updated: ${issue.updated_at}`,
169
+ `Body: ${((_issue_body = issue.body) === null || _issue_body === void 0 ? void 0 : _issue_body.substring(0, 500)) || 'No description'}${issue.body && issue.body.length > 500 ? '...' : ''}`,
170
+ '---'
171
+ ].join('\n');
172
+ });
173
+ logger.debug(`Fetched ${issues.length} open issues`);
174
+ return issueStrings.join('\n\n');
175
+ } catch (error) {
176
+ logger.warn('Failed to fetch GitHub issues: %s', error.message);
177
+ return '';
178
+ }
179
+ };
180
+ const createIssue = async (title, body, labels)=>{
181
+ const octokit = getOctokit();
182
+ const { owner, repo } = await getRepoDetails();
183
+ const response = await octokit.issues.create({
184
+ owner,
185
+ repo,
186
+ title,
187
+ body,
188
+ labels: labels || []
189
+ });
190
+ return {
191
+ number: response.data.number,
192
+ html_url: response.data.html_url
193
+ };
194
+ };
142
195
 
143
- export { createPullRequest, createRelease, findOpenPullRequestByHeadRef, getCurrentBranchName, getOctokit, getRepoDetails, mergePullRequest, waitForPullRequestChecks };
196
+ export { createIssue, createPullRequest, createRelease, findOpenPullRequestByHeadRef, getCurrentBranchName, getOctokit, getOpenIssues, getRepoDetails, mergePullRequest, waitForPullRequestChecks };
144
197
  //# sourceMappingURL=github.js.map