@eldrforge/kodrdriv 0.0.14 → 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.
Files changed (84) hide show
  1. package/README.md +1 -9
  2. package/dist/arguments.js +306 -55
  3. package/dist/arguments.js.map +1 -1
  4. package/dist/audio/devices.js +284 -0
  5. package/dist/audio/devices.js.map +1 -0
  6. package/dist/audio/index.js +31 -0
  7. package/dist/audio/index.js.map +1 -0
  8. package/dist/audio/processor.js +766 -0
  9. package/dist/audio/processor.js.map +1 -0
  10. package/dist/audio/types.js +16 -0
  11. package/dist/audio/types.js.map +1 -0
  12. package/dist/audio/validation.js +35 -0
  13. package/dist/audio/validation.js.map +1 -0
  14. package/dist/commands/audio-commit.js +64 -248
  15. package/dist/commands/audio-commit.js.map +1 -1
  16. package/dist/commands/audio-review.js +90 -701
  17. package/dist/commands/audio-review.js.map +1 -1
  18. package/dist/commands/commit.js +18 -18
  19. package/dist/commands/commit.js.map +1 -1
  20. package/dist/commands/release.js +14 -15
  21. package/dist/commands/release.js.map +1 -1
  22. package/dist/commands/review.js +152 -0
  23. package/dist/commands/review.js.map +1 -0
  24. package/dist/commands/select-audio.js +265 -0
  25. package/dist/commands/select-audio.js.map +1 -0
  26. package/dist/constants.js +86 -68
  27. package/dist/constants.js.map +1 -1
  28. package/dist/content/diff.js +155 -1
  29. package/dist/content/diff.js.map +1 -1
  30. package/dist/content/issues.js +256 -0
  31. package/dist/content/issues.js.map +1 -0
  32. package/dist/content/releaseNotes.js +90 -0
  33. package/dist/content/releaseNotes.js.map +1 -0
  34. package/dist/main.js +9 -2
  35. package/dist/main.js.map +1 -1
  36. package/dist/prompt/instructions/commit.md +18 -15
  37. package/dist/prompt/instructions/release.md +6 -5
  38. package/dist/prompt/instructions/{audio-review.md → review.md} +24 -18
  39. package/dist/prompt/prompts.js +87 -19
  40. package/dist/prompt/prompts.js.map +1 -1
  41. package/dist/types.js +27 -3
  42. package/dist/types.js.map +1 -1
  43. package/dist/util/general.js +7 -1
  44. package/dist/util/general.js.map +1 -1
  45. package/dist/util/openai.js +34 -3
  46. package/dist/util/openai.js.map +1 -1
  47. package/dist/util/stdin.js +61 -0
  48. package/dist/util/stdin.js.map +1 -0
  49. package/package.json +6 -6
  50. package/.kodrdriv/config.yaml +0 -20
  51. package/.kodrdriv/context/content.md +0 -7
  52. package/RELEASE_NOTES.md +0 -14
  53. package/docs/index.html +0 -17
  54. package/docs/package.json +0 -36
  55. package/docs/pnpm-lock.yaml +0 -3441
  56. package/docs/public/README.md +0 -132
  57. package/docs/public/advanced-usage.md +0 -188
  58. package/docs/public/code-icon.svg +0 -4
  59. package/docs/public/commands.md +0 -116
  60. package/docs/public/configuration.md +0 -274
  61. package/docs/public/examples.md +0 -352
  62. package/docs/public/kodrdriv-logo.svg +0 -62
  63. package/docs/src/App.css +0 -387
  64. package/docs/src/App.tsx +0 -60
  65. package/docs/src/components/DocumentPage.tsx +0 -56
  66. package/docs/src/components/ErrorMessage.tsx +0 -15
  67. package/docs/src/components/LoadingSpinner.tsx +0 -14
  68. package/docs/src/components/MarkdownRenderer.tsx +0 -56
  69. package/docs/src/components/Navigation.css +0 -73
  70. package/docs/src/components/Navigation.tsx +0 -36
  71. package/docs/src/index.css +0 -61
  72. package/docs/src/main.tsx +0 -10
  73. package/docs/src/test/setup.ts +0 -1
  74. package/docs/src/vite-env.d.ts +0 -10
  75. package/docs/tsconfig.node.json +0 -13
  76. package/docs/vite.config.ts +0 -15
  77. package/docs/vitest.config.ts +0 -15
  78. package/eslint.config.mjs +0 -83
  79. package/nodemon.json +0 -14
  80. package/output/kodrdriv/250701-1442-release-notes.md +0 -3
  81. package/pnpm-workspace.yaml +0 -5
  82. package/tsconfig.tsbuildinfo +0 -1
  83. package/vite.config.ts +0 -90
  84. package/vitest.config.ts +0 -24
package/README.md CHANGED
@@ -121,12 +121,4 @@ Apache-2.0 - see [LICENSE](LICENSE) file for details.
121
121
 
122
122
  ## About the Name
123
123
 
124
- Ski carving and efficient software development have a lot in common. Carving uses edge control to follow a smooth, energy-efficient arc just like automation uses clean, repeatable scripts to replace manual work. Both are about flow: linking turns or commits without hesitation. As carving unlocks speed and control, automation unlocks scalability and momentum. The result is clean tracks razor-thin arcs on snow, or tidy diffs in code. And when you've mastered your craft, you don't stop to think about your last move. Your code leaves a clean trail and your commit message can be automated straight from the diff.
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
124
+ Like Thor's hammer, this tool smashes through your repetitive coding tasks. But unlike Mjölnir, it won't make you worthy it'll just make you faster. Strike through commits, forge releases, and channel the lightning of AI to automate your workflow. Because sometimes you need a hammer, and sometimes you need a tool that actually works.
package/dist/arguments.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { Command } from 'commander';
2
2
  import { z } from 'zod';
3
- import { PROGRAM_NAME, VERSION, KODRDRIV_DEFAULTS, ALLOWED_COMMANDS, DEFAULT_COMMAND, DEFAULT_CHARACTER_ENCODING, DEFAULT_INSTRUCTIONS_DIR } from './constants.js';
3
+ import { PROGRAM_NAME, VERSION, KODRDRIV_DEFAULTS, ALLOWED_COMMANDS, DEFAULT_COMMAND } from './constants.js';
4
4
  import { getLogger } from './logging.js';
5
5
  import { create } from './util/storage.js';
6
+ import { readStdin } from './util/stdin.js';
6
7
 
7
8
  z.object({
8
9
  dryRun: z.boolean().optional(),
@@ -11,11 +12,11 @@ z.object({
11
12
  overrides: z.boolean().optional(),
12
13
  checkConfig: z.boolean().optional(),
13
14
  initConfig: z.boolean().optional(),
14
- openaiApiKey: z.string().optional(),
15
15
  model: z.string().optional(),
16
16
  contextDirectories: z.array(z.string()).optional(),
17
- instructions: z.string().optional(),
18
17
  configDir: z.string().optional(),
18
+ outputDir: z.string().optional(),
19
+ preferencesDir: z.string().optional(),
19
20
  cached: z.boolean().optional(),
20
21
  add: z.boolean().optional(),
21
22
  sendit: z.boolean().optional(),
@@ -23,6 +24,8 @@ z.object({
23
24
  to: z.string().optional(),
24
25
  excludedPatterns: z.array(z.string()).optional(),
25
26
  context: z.string().optional(),
27
+ note: z.string().optional(),
28
+ direction: z.string().optional(),
26
29
  messageLimit: z.number().optional(),
27
30
  mergeMethod: z.enum([
28
31
  'merge',
@@ -38,7 +41,9 @@ z.object({
38
41
  commitHistoryLimit: z.number().optional(),
39
42
  diffHistoryLimit: z.number().optional(),
40
43
  releaseNotesLimit: z.number().optional(),
41
- githubIssuesLimit: z.number().optional()
44
+ githubIssuesLimit: z.number().optional(),
45
+ file: z.string().optional(),
46
+ keepTemp: z.boolean().optional()
42
47
  });
43
48
  // Function to transform flat CLI args into nested Config structure
44
49
  const transformCliArgs = (finalCliArgs)=>{
@@ -50,9 +55,12 @@ const transformCliArgs = (finalCliArgs)=>{
50
55
  if (finalCliArgs.overrides !== undefined) transformedCliArgs.overrides = finalCliArgs.overrides;
51
56
  if (finalCliArgs.model !== undefined) transformedCliArgs.model = finalCliArgs.model;
52
57
  if (finalCliArgs.contextDirectories !== undefined) transformedCliArgs.contextDirectories = finalCliArgs.contextDirectories;
53
- if (finalCliArgs.instructions !== undefined) transformedCliArgs.instructions = finalCliArgs.instructions;
54
58
  // Map configDir (CLI) to configDirectory (Cardigantime standard)
55
59
  if (finalCliArgs.configDir !== undefined) transformedCliArgs.configDirectory = finalCliArgs.configDir;
60
+ // Map outputDir (CLI) to outputDirectory (Config standard)
61
+ if (finalCliArgs.outputDir !== undefined) transformedCliArgs.outputDirectory = finalCliArgs.outputDir;
62
+ // Map preferencesDir (CLI) to preferencesDirectory (Config standard)
63
+ if (finalCliArgs.preferencesDir !== undefined) transformedCliArgs.preferencesDirectory = finalCliArgs.preferencesDir;
56
64
  // Nested mappings for 'commit' options
57
65
  if (finalCliArgs.cached !== undefined || finalCliArgs.sendit !== undefined || finalCliArgs.add !== undefined) {
58
66
  transformedCliArgs.commit = {};
@@ -61,6 +69,13 @@ const transformCliArgs = (finalCliArgs)=>{
61
69
  if (finalCliArgs.sendit !== undefined) transformedCliArgs.commit.sendit = finalCliArgs.sendit;
62
70
  if (finalCliArgs.messageLimit !== undefined) transformedCliArgs.commit.messageLimit = finalCliArgs.messageLimit;
63
71
  if (finalCliArgs.context !== undefined) transformedCliArgs.commit.context = finalCliArgs.context;
72
+ if (finalCliArgs.direction !== undefined) transformedCliArgs.commit.direction = finalCliArgs.direction;
73
+ }
74
+ // Nested mappings for 'audioCommit' options
75
+ if (finalCliArgs.file !== undefined || finalCliArgs.keepTemp !== undefined) {
76
+ transformedCliArgs.audioCommit = {};
77
+ if (finalCliArgs.file !== undefined) transformedCliArgs.audioCommit.file = finalCliArgs.file;
78
+ if (finalCliArgs.keepTemp !== undefined) transformedCliArgs.audioCommit.keepTemp = finalCliArgs.keepTemp;
64
79
  }
65
80
  // Nested mappings for 'release' options
66
81
  if (finalCliArgs.from !== undefined || finalCliArgs.to !== undefined) {
@@ -81,7 +96,6 @@ const transformCliArgs = (finalCliArgs)=>{
81
96
  if (finalCliArgs.scopeRoots !== undefined) {
82
97
  try {
83
98
  transformedCliArgs.link.scopeRoots = JSON.parse(finalCliArgs.scopeRoots);
84
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
85
99
  } catch (error) {
86
100
  throw new Error(`Invalid JSON for scope-roots: ${finalCliArgs.scopeRoots}`);
87
101
  }
@@ -89,7 +103,7 @@ const transformCliArgs = (finalCliArgs)=>{
89
103
  if (finalCliArgs.workspaceFile !== undefined) transformedCliArgs.link.workspaceFile = finalCliArgs.workspaceFile;
90
104
  }
91
105
  // Nested mappings for 'audio-review' options
92
- if (finalCliArgs.includeCommitHistory !== undefined || finalCliArgs.includeRecentDiffs !== undefined || finalCliArgs.includeReleaseNotes !== undefined || finalCliArgs.includeGithubIssues !== undefined || finalCliArgs.commitHistoryLimit !== undefined || finalCliArgs.diffHistoryLimit !== undefined || finalCliArgs.releaseNotesLimit !== undefined || finalCliArgs.githubIssuesLimit !== undefined) {
106
+ if (finalCliArgs.includeCommitHistory !== undefined || finalCliArgs.includeRecentDiffs !== undefined || finalCliArgs.includeReleaseNotes !== undefined || finalCliArgs.includeGithubIssues !== undefined || finalCliArgs.commitHistoryLimit !== undefined || finalCliArgs.diffHistoryLimit !== undefined || finalCliArgs.releaseNotesLimit !== undefined || finalCliArgs.githubIssuesLimit !== undefined || finalCliArgs.file !== undefined || finalCliArgs.keepTemp !== undefined) {
93
107
  transformedCliArgs.audioReview = {};
94
108
  if (finalCliArgs.includeCommitHistory !== undefined) transformedCliArgs.audioReview.includeCommitHistory = finalCliArgs.includeCommitHistory;
95
109
  if (finalCliArgs.includeRecentDiffs !== undefined) transformedCliArgs.audioReview.includeRecentDiffs = finalCliArgs.includeRecentDiffs;
@@ -99,12 +113,29 @@ const transformCliArgs = (finalCliArgs)=>{
99
113
  if (finalCliArgs.diffHistoryLimit !== undefined) transformedCliArgs.audioReview.diffHistoryLimit = finalCliArgs.diffHistoryLimit;
100
114
  if (finalCliArgs.releaseNotesLimit !== undefined) transformedCliArgs.audioReview.releaseNotesLimit = finalCliArgs.releaseNotesLimit;
101
115
  if (finalCliArgs.githubIssuesLimit !== undefined) transformedCliArgs.audioReview.githubIssuesLimit = finalCliArgs.githubIssuesLimit;
102
- // Only add context and sendit if we already have an audioReview object from the specific properties above
103
116
  if (finalCliArgs.context !== undefined) transformedCliArgs.audioReview.context = finalCliArgs.context;
104
117
  if (finalCliArgs.sendit !== undefined) transformedCliArgs.audioReview.sendit = finalCliArgs.sendit;
118
+ if (finalCliArgs.file !== undefined) transformedCliArgs.audioReview.file = finalCliArgs.file;
119
+ if (finalCliArgs.keepTemp !== undefined) transformedCliArgs.audioReview.keepTemp = finalCliArgs.keepTemp;
120
+ }
121
+ // Nested mappings for 'review' options
122
+ if (finalCliArgs.includeCommitHistory !== undefined || finalCliArgs.includeRecentDiffs !== undefined || finalCliArgs.includeReleaseNotes !== undefined || finalCliArgs.includeGithubIssues !== undefined || finalCliArgs.commitHistoryLimit !== undefined || finalCliArgs.diffHistoryLimit !== undefined || finalCliArgs.releaseNotesLimit !== undefined || finalCliArgs.githubIssuesLimit !== undefined || finalCliArgs.context !== undefined || finalCliArgs.sendit !== undefined || finalCliArgs.note !== undefined) {
123
+ transformedCliArgs.review = {};
124
+ if (finalCliArgs.note !== undefined) transformedCliArgs.review.note = finalCliArgs.note;
125
+ // Include optional review configuration options if specified
126
+ if (finalCliArgs.includeCommitHistory !== undefined) transformedCliArgs.review.includeCommitHistory = finalCliArgs.includeCommitHistory;
127
+ if (finalCliArgs.includeRecentDiffs !== undefined) transformedCliArgs.review.includeRecentDiffs = finalCliArgs.includeRecentDiffs;
128
+ if (finalCliArgs.includeReleaseNotes !== undefined) transformedCliArgs.review.includeReleaseNotes = finalCliArgs.includeReleaseNotes;
129
+ if (finalCliArgs.includeGithubIssues !== undefined) transformedCliArgs.review.includeGithubIssues = finalCliArgs.includeGithubIssues;
130
+ if (finalCliArgs.commitHistoryLimit !== undefined) transformedCliArgs.review.commitHistoryLimit = finalCliArgs.commitHistoryLimit;
131
+ if (finalCliArgs.diffHistoryLimit !== undefined) transformedCliArgs.review.diffHistoryLimit = finalCliArgs.diffHistoryLimit;
132
+ if (finalCliArgs.releaseNotesLimit !== undefined) transformedCliArgs.review.releaseNotesLimit = finalCliArgs.releaseNotesLimit;
133
+ if (finalCliArgs.githubIssuesLimit !== undefined) transformedCliArgs.review.githubIssuesLimit = finalCliArgs.githubIssuesLimit;
134
+ if (finalCliArgs.context !== undefined) transformedCliArgs.review.context = finalCliArgs.context;
135
+ if (finalCliArgs.sendit !== undefined) transformedCliArgs.review.sendit = finalCliArgs.sendit;
105
136
  }
106
137
  if (finalCliArgs.excludedPatterns !== undefined) transformedCliArgs.excludedPatterns = finalCliArgs.excludedPatterns;
107
- // Note: finalCliArgs.openaiApiKey is intentionally omitted here as it belongs to SecureConfig
138
+ // Note: openaiApiKey is handled separately via environment variable only
108
139
  return transformedCliArgs;
109
140
  };
110
141
  // Update configure signature to accept cardigantime
@@ -160,7 +191,7 @@ const configure = async (cardigantime)=>{
160
191
  ];
161
192
  }
162
193
  // Get CLI arguments using the new function
163
- const [finalCliArgs, commandConfig] = getCliConfig(program);
194
+ const [finalCliArgs, commandConfig] = await getCliConfig(program);
164
195
  logger.silly('Loaded Command Line Options: %s', JSON.stringify(finalCliArgs, null, 2));
165
196
  // Transform the flat CLI args using the new function
166
197
  const transformedCliArgs = transformCliArgs(finalCliArgs);
@@ -190,6 +221,7 @@ const configure = async (cardigantime)=>{
190
221
  logger.verbose(` Debug: ${config.debug}`);
191
222
  logger.verbose(` Verbose: ${config.verbose}`);
192
223
  logger.verbose(` Config directory: ${config.configDirectory}`);
224
+ logger.verbose(` Output directory: ${config.outputDirectory}`);
193
225
  logger.verbose(` Context directories: ${((_config_contextDirectories = config.contextDirectories) === null || _config_contextDirectories === void 0 ? void 0 : _config_contextDirectories.join(', ')) || 'none'}`);
194
226
  if (config.excludedPatterns && config.excludedPatterns.length > 0) {
195
227
  logger.verbose(` Excluded patterns: ${config.excludedPatterns.join(', ')}`);
@@ -206,18 +238,92 @@ const configure = async (cardigantime)=>{
206
238
  ];
207
239
  };
208
240
  // Function to handle CLI argument parsing and processing
209
- function getCliConfig(program) {
241
+ async function getCliConfig(program) {
210
242
  const addSharedOptions = (command)=>{
211
243
  command.option('--dry-run', 'perform a dry run without saving files') // Removed default, will be handled by merging
212
- .option('--verbose', 'enable verbose logging').option('--debug', 'enable debug logging').option('--overrides', 'enable overrides').option('--model <model>', 'OpenAI model to use').option('-d, --context-directories [contextDirectories...]', 'directories to scan for context').option('-i, --instructions <file>', 'instructions for the AI').option('--config-dir <configDir>', 'configuration directory') // Keep config-dir for specifying location
213
- .option('--excluded-paths [excludedPatterns...]', 'paths to exclude from the diff');
244
+ .option('--verbose', 'enable verbose logging').option('--debug', 'enable debug logging').option('--overrides', 'enable overrides').option('--model <model>', 'OpenAI model to use').option('-d, --context-directories [contextDirectories...]', 'directories to scan for context').option('--config-dir <configDir>', 'configuration directory') // Keep config-dir for specifying location
245
+ .option('--output-dir <outputDir>', 'output directory for generated files').option('--preferences-dir <preferencesDir>', 'preferences directory for personal settings').option('--excluded-paths [excludedPatterns...]', 'paths to exclude from the diff').option('--keep-temp', 'keep temporary recording files');
214
246
  };
215
247
  // Add global options to the main program
216
248
  // (cardigantime already adds most global options like --verbose, --debug, --config-dir)
217
249
  // Add subcommands
218
- const commitCommand = program.command('commit').option('--cached', 'use cached diff').option('--add', 'add all changes before committing').option('--sendit', 'Commit with the message generated. No review.').option('--context <context>', 'context for the commit message').option('--message-limit <messageLimit>', 'limit the number of messages to generate').description('Generate commit notes');
250
+ const commitCommand = program.command('commit').argument('[direction]', 'direction or guidance for the commit message').description('Generate commit notes').option('--context <context>', 'context for the commit message').option('--cached', 'use cached diff').option('--add', 'add all changes before committing').option('--sendit', 'Commit with the message generated. No review.').option('--message-limit <messageLimit>', 'limit the number of messages to generate');
251
+ // Add shared options to commit command
219
252
  addSharedOptions(commitCommand);
220
- const audioCommitCommand = program.command('audio-commit').option('--cached', 'use cached diff').option('--add', 'add all changes before committing').option('--sendit', 'Commit with the message generated. No review.').option('--message-limit <messageLimit>', 'limit the number of messages to generate').description('Record audio to provide context, then generate and optionally commit with AI-generated message');
253
+ // Customize help output for commit command
254
+ commitCommand.configureHelp({
255
+ formatHelp: (cmd, helper)=>{
256
+ const nameAndVersion = `${helper.commandUsage(cmd)}\n\n${helper.commandDescription(cmd)}\n`;
257
+ const commitOptions = [
258
+ [
259
+ '--context <context>',
260
+ 'context for the commit message'
261
+ ]
262
+ ];
263
+ const behavioralOptions = [
264
+ [
265
+ '--cached',
266
+ 'use cached diff'
267
+ ],
268
+ [
269
+ '--add',
270
+ 'add all changes before committing'
271
+ ],
272
+ [
273
+ '--sendit',
274
+ 'Commit with the message generated. No review.'
275
+ ],
276
+ [
277
+ '--message-limit <messageLimit>',
278
+ 'limit the number of messages to generate'
279
+ ]
280
+ ];
281
+ const globalOptions = [
282
+ [
283
+ '--dry-run',
284
+ 'perform a dry run without saving files'
285
+ ],
286
+ [
287
+ '--verbose',
288
+ 'enable verbose logging'
289
+ ],
290
+ [
291
+ '--debug',
292
+ 'enable debug logging'
293
+ ],
294
+ [
295
+ '--overrides',
296
+ 'enable overrides'
297
+ ],
298
+ [
299
+ '--model <model>',
300
+ 'OpenAI model to use'
301
+ ],
302
+ [
303
+ '-d, --context-directories [contextDirectories...]',
304
+ 'directories to scan for context'
305
+ ],
306
+ [
307
+ '--config-dir <configDir>',
308
+ 'configuration directory'
309
+ ],
310
+ [
311
+ '--excluded-paths [excludedPatterns...]',
312
+ 'paths to exclude from the diff'
313
+ ],
314
+ [
315
+ '-h, --help',
316
+ 'display help for command'
317
+ ]
318
+ ];
319
+ const formatOptionsSection = (title, options)=>{
320
+ const maxWidth = Math.max(...options.map(([flag])=>flag.length));
321
+ return `${title}:\n` + options.map(([flag, desc])=>` ${flag.padEnd(maxWidth + 2)} ${desc}`).join('\n') + '\n';
322
+ };
323
+ return nameAndVersion + '\n' + formatOptionsSection('Commit Message Options', commitOptions) + '\n' + formatOptionsSection('Behavioral Options', behavioralOptions) + '\n' + formatOptionsSection('Global Options', globalOptions) + '\n' + 'Environment Variables:\n' + ' OPENAI_API_KEY OpenAI API key (required)\n';
324
+ }
325
+ });
326
+ const audioCommitCommand = program.command('audio-commit').option('--cached', 'use cached diff').option('--add', 'add all changes before committing').option('--sendit', 'Commit with the message generated. No review.').option('--direction <direction>', 'direction or guidance for the commit message').option('--message-limit <messageLimit>', 'limit the number of messages to generate').option('--file <file>', 'audio file path').description('Record audio to provide context, then generate and optionally commit with AI-generated message');
221
327
  addSharedOptions(audioCommitCommand);
222
328
  const releaseCommand = program.command('release').option('--from <from>', 'branch to generate release notes from').option('--to <to>', 'branch to generate release notes to').option('--context <context>', 'context for the commit message').description('Generate release notes');
223
329
  addSharedOptions(releaseCommand);
@@ -227,10 +333,135 @@ function getCliConfig(program) {
227
333
  addSharedOptions(linkCommand);
228
334
  const unlinkCommand = program.command('unlink').option('--scope-roots <scopeRoots>', 'JSON mapping of scopes to root directories (e.g., \'{"@company": "../"}\')').option('--workspace-file <workspaceFile>', 'path to workspace file', 'pnpm-workspace.yaml').description('Remove pnpm workspace links and rebuild dependencies');
229
335
  addSharedOptions(unlinkCommand);
230
- const audioReviewCommand = program.command('audio-review').option('--include-commit-history', 'include recent commit log messages in context (default: true)').option('--no-include-commit-history', 'exclude commit log messages from context').option('--include-recent-diffs', 'include recent commit diffs in context (default: true)').option('--no-include-recent-diffs', 'exclude recent diffs from context').option('--include-release-notes', 'include recent release notes in context (default: false)').option('--no-include-release-notes', 'exclude release notes from context').option('--include-github-issues', 'include open GitHub issues in context (default: true)').option('--no-include-github-issues', 'exclude GitHub issues from context').option('--commit-history-limit <limit>', 'number of recent commits to include', parseInt).option('--diff-history-limit <limit>', 'number of recent commit diffs to include', parseInt).option('--release-notes-limit <limit>', 'number of recent release notes to include', parseInt).option('--github-issues-limit <limit>', 'number of open GitHub issues to include (max 20)', parseInt).option('--context <context>', 'additional context for the audio review').option('--sendit', 'Create GitHub issues automatically without confirmation').description('Record audio, transcribe with Whisper, and analyze for project issues using AI');
336
+ const audioReviewCommand = program.command('audio-review').option('--include-commit-history', 'include recent commit log messages in context (default: true)').option('--no-include-commit-history', 'exclude commit log messages from context').option('--include-recent-diffs', 'include recent commit diffs in context (default: true)').option('--no-include-recent-diffs', 'exclude recent diffs from context').option('--include-release-notes', 'include recent release notes in context (default: false)').option('--no-include-release-notes', 'exclude release notes from context').option('--include-github-issues', 'include open GitHub issues in context (default: true)').option('--no-include-github-issues', 'exclude GitHub issues from context').option('--commit-history-limit <limit>', 'number of recent commits to include', parseInt).option('--diff-history-limit <limit>', 'number of recent commit diffs to include', parseInt).option('--release-notes-limit <limit>', 'number of recent release notes to include', parseInt).option('--github-issues-limit <limit>', 'number of open GitHub issues to include (max 20)', parseInt).option('--context <context>', 'additional context for the audio review').option('--file <file>', 'audio file path').description('Record audio, transcribe with Whisper, and analyze for project issues using AI');
231
337
  addSharedOptions(audioReviewCommand);
338
+ const reviewCommand = program.command('review').argument('[note]', 'review note to analyze for project issues').option('--include-commit-history', 'include recent commit log messages in context (default: true)').option('--no-include-commit-history', 'exclude commit log messages from context').option('--include-recent-diffs', 'include recent commit diffs in context (default: true)').option('--no-include-recent-diffs', 'exclude recent diffs from context').option('--include-release-notes', 'include recent release notes in context (default: false)').option('--no-include-release-notes', 'exclude release notes from context').option('--include-github-issues', 'include open GitHub issues in context (default: true)').option('--no-include-github-issues', 'exclude GitHub issues from context').option('--commit-history-limit <limit>', 'number of recent commits to include', parseInt).option('--diff-history-limit <limit>', 'number of recent commit diffs to include', parseInt).option('--release-notes-limit <limit>', 'number of recent release notes to include', parseInt).option('--github-issues-limit <limit>', 'number of open GitHub issues to include (max 20)', parseInt).option('--context <context>', 'additional context for the review').option('--sendit', 'Create GitHub issues automatically without confirmation').description('Analyze review note for project issues using AI');
339
+ addSharedOptions(reviewCommand);
340
+ // Customize help output for review command
341
+ reviewCommand.configureHelp({
342
+ formatHelp: (cmd, helper)=>{
343
+ const nameAndVersion = `kodrdriv review [note] [options]\n\nAnalyze review note for project issues using AI\n`;
344
+ const argumentsSection = [
345
+ [
346
+ 'note',
347
+ 'review note to analyze for project issues (can also be piped via STDIN)'
348
+ ]
349
+ ];
350
+ const reviewOptions = [
351
+ [
352
+ '--context <context>',
353
+ 'additional context for the review'
354
+ ]
355
+ ];
356
+ const gitContextOptions = [
357
+ [
358
+ '--include-commit-history',
359
+ 'include recent commit log messages in context (default: true)'
360
+ ],
361
+ [
362
+ '--no-include-commit-history',
363
+ 'exclude commit log messages from context'
364
+ ],
365
+ [
366
+ '--include-recent-diffs',
367
+ 'include recent commit diffs in context (default: true)'
368
+ ],
369
+ [
370
+ '--no-include-recent-diffs',
371
+ 'exclude recent diffs from context'
372
+ ],
373
+ [
374
+ '--include-release-notes',
375
+ 'include recent release notes in context (default: false)'
376
+ ],
377
+ [
378
+ '--no-include-release-notes',
379
+ 'exclude release notes from context'
380
+ ],
381
+ [
382
+ '--include-github-issues',
383
+ 'include open GitHub issues in context (default: true)'
384
+ ],
385
+ [
386
+ '--no-include-github-issues',
387
+ 'exclude GitHub issues from context'
388
+ ],
389
+ [
390
+ '--commit-history-limit <limit>',
391
+ 'number of recent commits to include'
392
+ ],
393
+ [
394
+ '--diff-history-limit <limit>',
395
+ 'number of recent commit diffs to include'
396
+ ],
397
+ [
398
+ '--release-notes-limit <limit>',
399
+ 'number of recent release notes to include'
400
+ ],
401
+ [
402
+ '--github-issues-limit <limit>',
403
+ 'number of open GitHub issues to include (max 20)'
404
+ ]
405
+ ];
406
+ const behavioralOptions = [
407
+ [
408
+ '--sendit',
409
+ 'Create GitHub issues automatically without confirmation'
410
+ ]
411
+ ];
412
+ const globalOptions = [
413
+ [
414
+ '--dry-run',
415
+ 'perform a dry run without saving files'
416
+ ],
417
+ [
418
+ '--verbose',
419
+ 'enable verbose logging'
420
+ ],
421
+ [
422
+ '--debug',
423
+ 'enable debug logging'
424
+ ],
425
+ [
426
+ '--overrides',
427
+ 'enable overrides'
428
+ ],
429
+ [
430
+ '--model <model>',
431
+ 'OpenAI model to use'
432
+ ],
433
+ [
434
+ '-d, --context-directories [contextDirectories...]',
435
+ 'directories to scan for context'
436
+ ],
437
+ [
438
+ '--config-dir <configDir>',
439
+ 'configuration directory'
440
+ ],
441
+ [
442
+ '--output-dir <outputDir>',
443
+ 'output directory for generated files'
444
+ ],
445
+ [
446
+ '--excluded-paths [excludedPatterns...]',
447
+ 'paths to exclude from the diff'
448
+ ],
449
+ [
450
+ '-h, --help',
451
+ 'display help for command'
452
+ ]
453
+ ];
454
+ const formatOptionsSection = (title, options)=>{
455
+ const maxWidth = Math.max(...options.map(([flag])=>flag.length));
456
+ return `${title}:\n` + options.map(([flag, desc])=>` ${flag.padEnd(maxWidth + 2)} ${desc}`).join('\n') + '\n';
457
+ };
458
+ return nameAndVersion + '\n' + formatOptionsSection('Arguments', argumentsSection) + '\n' + formatOptionsSection('Options', reviewOptions) + '\n' + formatOptionsSection('Git Context Parameters', gitContextOptions) + '\n' + formatOptionsSection('Behavioral Options', behavioralOptions) + '\n' + formatOptionsSection('Global Options', globalOptions) + '\n' + 'Environment Variables:\n' + ' OPENAI_API_KEY OpenAI API key (required)\n';
459
+ }
460
+ });
232
461
  const cleanCommand = program.command('clean').description('Remove the output directory and all generated files');
233
462
  addSharedOptions(cleanCommand);
463
+ const selectAudioCommand = program.command('select-audio').description('Interactively select and save audio device for recording');
464
+ addSharedOptions(selectAudioCommand);
234
465
  program.parse();
235
466
  const cliArgs = program.opts(); // Get all opts initially
236
467
  // Determine which command is being run
@@ -244,6 +475,16 @@ function getCliConfig(program) {
244
475
  if (ALLOWED_COMMANDS.includes(commandName)) {
245
476
  if (commandName === 'commit' && commitCommand.opts) {
246
477
  commandOptions = commitCommand.opts();
478
+ // Handle positional argument for direction
479
+ const args = commitCommand.args;
480
+ if (args && args.length > 0 && args[0]) {
481
+ commandOptions.direction = args[0];
482
+ }
483
+ // Check for STDIN input for direction (takes precedence over positional argument)
484
+ const stdinInput = await readStdin();
485
+ if (stdinInput) {
486
+ commandOptions.direction = stdinInput;
487
+ }
247
488
  } else if (commandName === 'audio-commit' && audioCommitCommand.opts) {
248
489
  commandOptions = audioCommitCommand.opts();
249
490
  } else if (commandName === 'release' && releaseCommand.opts) {
@@ -256,8 +497,22 @@ function getCliConfig(program) {
256
497
  commandOptions = unlinkCommand.opts();
257
498
  } else if (commandName === 'audio-review' && audioReviewCommand.opts) {
258
499
  commandOptions = audioReviewCommand.opts();
500
+ } else if (commandName === 'review' && reviewCommand.opts) {
501
+ commandOptions = reviewCommand.opts();
502
+ // Handle positional argument for note
503
+ const args = reviewCommand.args;
504
+ if (args && args.length > 0 && args[0]) {
505
+ commandOptions.note = args[0];
506
+ }
507
+ // Check for STDIN input for note (takes precedence over positional argument)
508
+ const stdinInput = await readStdin();
509
+ if (stdinInput) {
510
+ commandOptions.note = stdinInput;
511
+ }
259
512
  } else if (commandName === 'clean' && cleanCommand.opts) {
260
513
  commandOptions = cleanCommand.opts();
514
+ } else if (commandName === 'select-audio' && selectAudioCommand.opts) {
515
+ commandOptions = selectAudioCommand.opts();
261
516
  }
262
517
  }
263
518
  // Include command name in CLI args for merging
@@ -278,7 +533,7 @@ async function validateAndProcessSecureOptions() {
278
533
  const isCheckConfig = process.argv.includes('--check-config');
279
534
  const isInitConfig = process.argv.includes('--init-config');
280
535
  if (!process.env.OPENAI_API_KEY && !isCheckConfig && !isInitConfig) {
281
- throw new Error('OpenAI API key is required, set OPENAI_API_KEY environment variable or provide --openai-api-key');
536
+ throw new Error('OpenAI API key is required. Please set the OPENAI_API_KEY environment variable.');
282
537
  }
283
538
  // Prefer CLI key if provided, otherwise use env var (might be undefined for check-config/init-config)
284
539
  const openaiApiKey = process.env.OPENAI_API_KEY;
@@ -289,12 +544,10 @@ async function validateAndProcessSecureOptions() {
289
544
  }
290
545
  // Renamed validation function to reflect its broader role
291
546
  async function validateAndProcessOptions(options) {
292
- var _options_commit, _options_commit1, _options_commit2, _options_commit3, _options_commit4, _options_release, _options_release1, _options_release2, _options_release3, _options_audioReview, _options_audioReview1, _options_audioReview2, _options_audioReview3, _options_audioReview4, _options_audioReview5, _options_audioReview6, _options_audioReview7, _options_audioReview8, _options_audioReview9, _options_publish, _options_publish1, _options_publish2, _options_link, _options_link1, _options_link2;
547
+ var _options_commit, _options_commit1, _options_commit2, _options_commit3, _options_commit4, _options_commit5, _options_audioCommit, _options_audioCommit1, _options_audioCommit2, _options_audioCommit3, _options_release, _options_release1, _options_release2, _options_release3, _options_audioReview, _options_audioReview1, _options_audioReview2, _options_audioReview3, _options_audioReview4, _options_audioReview5, _options_audioReview6, _options_audioReview7, _options_audioReview8, _options_audioReview9, _options_audioReview10, _options_audioReview11, _options_audioReview12, _options_audioReview13, _options_review, _options_review1, _options_review2, _options_review3, _options_review4, _options_review5, _options_review6, _options_review7, _options_review8, _options_review9, _options_review10, _options_publish, _options_publish1, _options_publish2, _options_publish3, _options_publish4, _options_link, _options_link1, _options_link2;
293
548
  const contextDirectories = await validateContextDirectories(options.contextDirectories || KODRDRIV_DEFAULTS.contextDirectories);
294
- const instructionsPathOrContent = options.instructions || KODRDRIV_DEFAULTS.instructions;
295
- const instructions = await validateAndReadInstructions(instructionsPathOrContent);
296
549
  const configDir = options.configDirectory || KODRDRIV_DEFAULTS.configDirectory;
297
- var _options_dryRun, _options_verbose, _options_debug, _options_overrides, _options_model, _options_commit_add, _options_commit_cached, _options_commit_sendit, _options_commit_messageLimit, _options_release_from, _options_release_to, _options_release_messageLimit, _options_audioReview_includeCommitHistory, _options_audioReview_includeRecentDiffs, _options_audioReview_includeReleaseNotes, _options_audioReview_includeGithubIssues, _options_audioReview_commitHistoryLimit, _options_audioReview_diffHistoryLimit, _options_audioReview_releaseNotesLimit, _options_audioReview_githubIssuesLimit, _options_audioReview_sendit, _options_publish_mergeMethod, _options_publish_requiredEnvVars, _options_link_scopeRoots, _options_link_workspaceFile, _options_link_dryRun, _options_excludedPatterns;
550
+ var _options_dryRun, _options_verbose, _options_debug, _options_overrides, _options_model, _options_outputDirectory, _options_preferencesDirectory, _options_commit_add, _options_commit_cached, _options_commit_sendit, _options_commit_messageLimit, _options_audioCommit_maxRecordingTime, _options_audioCommit_audioDevice, _options_release_from, _options_release_to, _options_release_messageLimit, _options_audioReview_includeCommitHistory, _options_audioReview_includeRecentDiffs, _options_audioReview_includeReleaseNotes, _options_audioReview_includeGithubIssues, _options_audioReview_commitHistoryLimit, _options_audioReview_diffHistoryLimit, _options_audioReview_releaseNotesLimit, _options_audioReview_githubIssuesLimit, _options_audioReview_sendit, _options_audioReview_maxRecordingTime, _options_audioReview_audioDevice, _options_review_includeCommitHistory, _options_review_includeRecentDiffs, _options_review_includeReleaseNotes, _options_review_includeGithubIssues, _options_review_commitHistoryLimit, _options_review_diffHistoryLimit, _options_review_releaseNotesLimit, _options_review_githubIssuesLimit, _options_review_sendit, _options_publish_mergeMethod, _options_publish_requiredEnvVars, _options_publish_linkWorkspacePackages, _options_publish_unlinkWorkspacePackages, _options_link_scopeRoots, _options_link_workspaceFile, _options_link_dryRun, _options_excludedPatterns;
298
551
  // Skip config directory validation since Cardigantime handles hierarchical lookup
299
552
  // Ensure all required fields are present and have correct types after merging
300
553
  const finalConfig = {
@@ -303,16 +556,24 @@ async function validateAndProcessOptions(options) {
303
556
  debug: (_options_debug = options.debug) !== null && _options_debug !== void 0 ? _options_debug : KODRDRIV_DEFAULTS.debug,
304
557
  overrides: (_options_overrides = options.overrides) !== null && _options_overrides !== void 0 ? _options_overrides : KODRDRIV_DEFAULTS.overrides,
305
558
  model: (_options_model = options.model) !== null && _options_model !== void 0 ? _options_model : KODRDRIV_DEFAULTS.model,
306
- instructions: instructions,
307
559
  contextDirectories: contextDirectories,
308
560
  configDirectory: configDir,
561
+ outputDirectory: (_options_outputDirectory = options.outputDirectory) !== null && _options_outputDirectory !== void 0 ? _options_outputDirectory : KODRDRIV_DEFAULTS.outputDirectory,
562
+ preferencesDirectory: (_options_preferencesDirectory = options.preferencesDirectory) !== null && _options_preferencesDirectory !== void 0 ? _options_preferencesDirectory : KODRDRIV_DEFAULTS.preferencesDirectory,
309
563
  // Command-specific options with defaults
310
564
  commit: {
311
565
  add: (_options_commit_add = (_options_commit = options.commit) === null || _options_commit === void 0 ? void 0 : _options_commit.add) !== null && _options_commit_add !== void 0 ? _options_commit_add : KODRDRIV_DEFAULTS.commit.add,
312
566
  cached: (_options_commit_cached = (_options_commit1 = options.commit) === null || _options_commit1 === void 0 ? void 0 : _options_commit1.cached) !== null && _options_commit_cached !== void 0 ? _options_commit_cached : KODRDRIV_DEFAULTS.commit.cached,
313
567
  sendit: (_options_commit_sendit = (_options_commit2 = options.commit) === null || _options_commit2 === void 0 ? void 0 : _options_commit2.sendit) !== null && _options_commit_sendit !== void 0 ? _options_commit_sendit : KODRDRIV_DEFAULTS.commit.sendit,
314
568
  messageLimit: (_options_commit_messageLimit = (_options_commit3 = options.commit) === null || _options_commit3 === void 0 ? void 0 : _options_commit3.messageLimit) !== null && _options_commit_messageLimit !== void 0 ? _options_commit_messageLimit : KODRDRIV_DEFAULTS.commit.messageLimit,
315
- context: (_options_commit4 = options.commit) === null || _options_commit4 === void 0 ? void 0 : _options_commit4.context
569
+ context: (_options_commit4 = options.commit) === null || _options_commit4 === void 0 ? void 0 : _options_commit4.context,
570
+ direction: (_options_commit5 = options.commit) === null || _options_commit5 === void 0 ? void 0 : _options_commit5.direction
571
+ },
572
+ audioCommit: {
573
+ maxRecordingTime: (_options_audioCommit_maxRecordingTime = (_options_audioCommit = options.audioCommit) === null || _options_audioCommit === void 0 ? void 0 : _options_audioCommit.maxRecordingTime) !== null && _options_audioCommit_maxRecordingTime !== void 0 ? _options_audioCommit_maxRecordingTime : KODRDRIV_DEFAULTS.audioCommit.maxRecordingTime,
574
+ audioDevice: (_options_audioCommit_audioDevice = (_options_audioCommit1 = options.audioCommit) === null || _options_audioCommit1 === void 0 ? void 0 : _options_audioCommit1.audioDevice) !== null && _options_audioCommit_audioDevice !== void 0 ? _options_audioCommit_audioDevice : KODRDRIV_DEFAULTS.audioCommit.audioDevice,
575
+ file: (_options_audioCommit2 = options.audioCommit) === null || _options_audioCommit2 === void 0 ? void 0 : _options_audioCommit2.file,
576
+ keepTemp: (_options_audioCommit3 = options.audioCommit) === null || _options_audioCommit3 === void 0 ? void 0 : _options_audioCommit3.keepTemp
316
577
  },
317
578
  release: {
318
579
  from: (_options_release_from = (_options_release = options.release) === null || _options_release === void 0 ? void 0 : _options_release.from) !== null && _options_release_from !== void 0 ? _options_release_from : KODRDRIV_DEFAULTS.release.from,
@@ -330,12 +591,31 @@ async function validateAndProcessOptions(options) {
330
591
  releaseNotesLimit: (_options_audioReview_releaseNotesLimit = (_options_audioReview6 = options.audioReview) === null || _options_audioReview6 === void 0 ? void 0 : _options_audioReview6.releaseNotesLimit) !== null && _options_audioReview_releaseNotesLimit !== void 0 ? _options_audioReview_releaseNotesLimit : KODRDRIV_DEFAULTS.audioReview.releaseNotesLimit,
331
592
  githubIssuesLimit: (_options_audioReview_githubIssuesLimit = (_options_audioReview7 = options.audioReview) === null || _options_audioReview7 === void 0 ? void 0 : _options_audioReview7.githubIssuesLimit) !== null && _options_audioReview_githubIssuesLimit !== void 0 ? _options_audioReview_githubIssuesLimit : KODRDRIV_DEFAULTS.audioReview.githubIssuesLimit,
332
593
  context: (_options_audioReview8 = options.audioReview) === null || _options_audioReview8 === void 0 ? void 0 : _options_audioReview8.context,
333
- sendit: (_options_audioReview_sendit = (_options_audioReview9 = options.audioReview) === null || _options_audioReview9 === void 0 ? void 0 : _options_audioReview9.sendit) !== null && _options_audioReview_sendit !== void 0 ? _options_audioReview_sendit : KODRDRIV_DEFAULTS.audioReview.sendit
594
+ sendit: (_options_audioReview_sendit = (_options_audioReview9 = options.audioReview) === null || _options_audioReview9 === void 0 ? void 0 : _options_audioReview9.sendit) !== null && _options_audioReview_sendit !== void 0 ? _options_audioReview_sendit : KODRDRIV_DEFAULTS.audioReview.sendit,
595
+ maxRecordingTime: (_options_audioReview_maxRecordingTime = (_options_audioReview10 = options.audioReview) === null || _options_audioReview10 === void 0 ? void 0 : _options_audioReview10.maxRecordingTime) !== null && _options_audioReview_maxRecordingTime !== void 0 ? _options_audioReview_maxRecordingTime : KODRDRIV_DEFAULTS.audioReview.maxRecordingTime,
596
+ audioDevice: (_options_audioReview_audioDevice = (_options_audioReview11 = options.audioReview) === null || _options_audioReview11 === void 0 ? void 0 : _options_audioReview11.audioDevice) !== null && _options_audioReview_audioDevice !== void 0 ? _options_audioReview_audioDevice : KODRDRIV_DEFAULTS.audioReview.audioDevice,
597
+ file: (_options_audioReview12 = options.audioReview) === null || _options_audioReview12 === void 0 ? void 0 : _options_audioReview12.file,
598
+ keepTemp: (_options_audioReview13 = options.audioReview) === null || _options_audioReview13 === void 0 ? void 0 : _options_audioReview13.keepTemp
599
+ },
600
+ review: {
601
+ includeCommitHistory: (_options_review_includeCommitHistory = (_options_review = options.review) === null || _options_review === void 0 ? void 0 : _options_review.includeCommitHistory) !== null && _options_review_includeCommitHistory !== void 0 ? _options_review_includeCommitHistory : KODRDRIV_DEFAULTS.review.includeCommitHistory,
602
+ includeRecentDiffs: (_options_review_includeRecentDiffs = (_options_review1 = options.review) === null || _options_review1 === void 0 ? void 0 : _options_review1.includeRecentDiffs) !== null && _options_review_includeRecentDiffs !== void 0 ? _options_review_includeRecentDiffs : KODRDRIV_DEFAULTS.review.includeRecentDiffs,
603
+ includeReleaseNotes: (_options_review_includeReleaseNotes = (_options_review2 = options.review) === null || _options_review2 === void 0 ? void 0 : _options_review2.includeReleaseNotes) !== null && _options_review_includeReleaseNotes !== void 0 ? _options_review_includeReleaseNotes : KODRDRIV_DEFAULTS.review.includeReleaseNotes,
604
+ includeGithubIssues: (_options_review_includeGithubIssues = (_options_review3 = options.review) === null || _options_review3 === void 0 ? void 0 : _options_review3.includeGithubIssues) !== null && _options_review_includeGithubIssues !== void 0 ? _options_review_includeGithubIssues : KODRDRIV_DEFAULTS.review.includeGithubIssues,
605
+ commitHistoryLimit: (_options_review_commitHistoryLimit = (_options_review4 = options.review) === null || _options_review4 === void 0 ? void 0 : _options_review4.commitHistoryLimit) !== null && _options_review_commitHistoryLimit !== void 0 ? _options_review_commitHistoryLimit : KODRDRIV_DEFAULTS.review.commitHistoryLimit,
606
+ diffHistoryLimit: (_options_review_diffHistoryLimit = (_options_review5 = options.review) === null || _options_review5 === void 0 ? void 0 : _options_review5.diffHistoryLimit) !== null && _options_review_diffHistoryLimit !== void 0 ? _options_review_diffHistoryLimit : KODRDRIV_DEFAULTS.review.diffHistoryLimit,
607
+ releaseNotesLimit: (_options_review_releaseNotesLimit = (_options_review6 = options.review) === null || _options_review6 === void 0 ? void 0 : _options_review6.releaseNotesLimit) !== null && _options_review_releaseNotesLimit !== void 0 ? _options_review_releaseNotesLimit : KODRDRIV_DEFAULTS.review.releaseNotesLimit,
608
+ githubIssuesLimit: (_options_review_githubIssuesLimit = (_options_review7 = options.review) === null || _options_review7 === void 0 ? void 0 : _options_review7.githubIssuesLimit) !== null && _options_review_githubIssuesLimit !== void 0 ? _options_review_githubIssuesLimit : KODRDRIV_DEFAULTS.review.githubIssuesLimit,
609
+ context: (_options_review8 = options.review) === null || _options_review8 === void 0 ? void 0 : _options_review8.context,
610
+ sendit: (_options_review_sendit = (_options_review9 = options.review) === null || _options_review9 === void 0 ? void 0 : _options_review9.sendit) !== null && _options_review_sendit !== void 0 ? _options_review_sendit : KODRDRIV_DEFAULTS.review.sendit,
611
+ note: (_options_review10 = options.review) === null || _options_review10 === void 0 ? void 0 : _options_review10.note
334
612
  },
335
613
  publish: {
336
614
  mergeMethod: (_options_publish_mergeMethod = (_options_publish = options.publish) === null || _options_publish === void 0 ? void 0 : _options_publish.mergeMethod) !== null && _options_publish_mergeMethod !== void 0 ? _options_publish_mergeMethod : KODRDRIV_DEFAULTS.publish.mergeMethod,
337
615
  dependencyUpdatePatterns: (_options_publish1 = options.publish) === null || _options_publish1 === void 0 ? void 0 : _options_publish1.dependencyUpdatePatterns,
338
- requiredEnvVars: (_options_publish_requiredEnvVars = (_options_publish2 = options.publish) === null || _options_publish2 === void 0 ? void 0 : _options_publish2.requiredEnvVars) !== null && _options_publish_requiredEnvVars !== void 0 ? _options_publish_requiredEnvVars : KODRDRIV_DEFAULTS.publish.requiredEnvVars
616
+ requiredEnvVars: (_options_publish_requiredEnvVars = (_options_publish2 = options.publish) === null || _options_publish2 === void 0 ? void 0 : _options_publish2.requiredEnvVars) !== null && _options_publish_requiredEnvVars !== void 0 ? _options_publish_requiredEnvVars : KODRDRIV_DEFAULTS.publish.requiredEnvVars,
617
+ linkWorkspacePackages: (_options_publish_linkWorkspacePackages = (_options_publish3 = options.publish) === null || _options_publish3 === void 0 ? void 0 : _options_publish3.linkWorkspacePackages) !== null && _options_publish_linkWorkspacePackages !== void 0 ? _options_publish_linkWorkspacePackages : KODRDRIV_DEFAULTS.publish.linkWorkspacePackages,
618
+ unlinkWorkspacePackages: (_options_publish_unlinkWorkspacePackages = (_options_publish4 = options.publish) === null || _options_publish4 === void 0 ? void 0 : _options_publish4.unlinkWorkspacePackages) !== null && _options_publish_unlinkWorkspacePackages !== void 0 ? _options_publish_unlinkWorkspacePackages : KODRDRIV_DEFAULTS.publish.unlinkWorkspacePackages
339
619
  },
340
620
  link: {
341
621
  scopeRoots: (_options_link_scopeRoots = (_options_link = options.link) === null || _options_link === void 0 ? void 0 : _options_link.scopeRoots) !== null && _options_link_scopeRoots !== void 0 ? _options_link_scopeRoots : KODRDRIV_DEFAULTS.link.scopeRoots,
@@ -376,35 +656,6 @@ async function validateContextDirectories(contextDirectories) {
376
656
  }
377
657
  return validDirectories;
378
658
  }
379
- // Updated to handle reading the file content
380
- // Export for testing
381
- async function validateAndReadInstructions(instructionsPath) {
382
- const logger = getLogger();
383
- const storage = create({
384
- log: logger.info
385
- });
386
- try {
387
- // Assume it's a file path first
388
- if (await storage.isFileReadable(instructionsPath)) {
389
- logger.verbose(`Reading instructions from file: ${instructionsPath}`);
390
- return storage.readFile(instructionsPath, DEFAULT_CHARACTER_ENCODING);
391
- } else {
392
- // If not a readable file, assume it might be the content itself (e.g., from config file)
393
- logger.verbose(`Using provided instructions string directly.`);
394
- return instructionsPath; // Return the string as is
395
- }
396
- } catch (error) {
397
- logger.error('Error reading instructions file %s: %s', instructionsPath, error.message);
398
- // Decide how to handle error: throw, return default, etc.
399
- // Returning default for now, but might need adjustment
400
- logger.warn('Falling back to default instructions path due to error.');
401
- // Re-read the default file path if the provided one failed
402
- if (await storage.isFileReadable(DEFAULT_INSTRUCTIONS_DIR)) {
403
- return storage.readFile(DEFAULT_INSTRUCTIONS_DIR, DEFAULT_CHARACTER_ENCODING);
404
- }
405
- throw new Error(`Failed to read instructions from ${instructionsPath} or default location.`);
406
- }
407
- }
408
659
 
409
- export { configure, getCliConfig, transformCliArgs, validateAndProcessOptions, validateAndProcessSecureOptions, validateAndReadInstructions, validateCommand, validateContextDirectories };
660
+ export { configure, getCliConfig, transformCliArgs, validateAndProcessOptions, validateAndProcessSecureOptions, validateCommand, validateContextDirectories };
410
661
  //# sourceMappingURL=arguments.js.map