@link-assistant/hive-mind 0.46.1 → 0.47.0

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 (63) hide show
  1. package/CHANGELOG.md +10 -15
  2. package/README.md +42 -8
  3. package/package.json +16 -3
  4. package/src/agent.lib.mjs +49 -70
  5. package/src/agent.prompts.lib.mjs +6 -20
  6. package/src/buildUserMention.lib.mjs +4 -17
  7. package/src/claude-limits.lib.mjs +15 -15
  8. package/src/claude.lib.mjs +617 -626
  9. package/src/claude.prompts.lib.mjs +7 -22
  10. package/src/codex.lib.mjs +39 -71
  11. package/src/codex.prompts.lib.mjs +6 -20
  12. package/src/config.lib.mjs +3 -16
  13. package/src/contributing-guidelines.lib.mjs +5 -18
  14. package/src/exit-handler.lib.mjs +4 -4
  15. package/src/git.lib.mjs +7 -7
  16. package/src/github-issue-creator.lib.mjs +17 -17
  17. package/src/github-linking.lib.mjs +8 -33
  18. package/src/github.batch.lib.mjs +20 -16
  19. package/src/github.graphql.lib.mjs +18 -18
  20. package/src/github.lib.mjs +89 -91
  21. package/src/hive.config.lib.mjs +50 -50
  22. package/src/hive.mjs +1293 -1296
  23. package/src/instrument.mjs +7 -11
  24. package/src/interactive-mode.lib.mjs +112 -138
  25. package/src/lenv-reader.lib.mjs +1 -6
  26. package/src/lib.mjs +36 -45
  27. package/src/lino.lib.mjs +2 -2
  28. package/src/local-ci-checks.lib.mjs +15 -14
  29. package/src/memory-check.mjs +52 -60
  30. package/src/model-mapping.lib.mjs +25 -32
  31. package/src/model-validation.lib.mjs +31 -31
  32. package/src/opencode.lib.mjs +37 -62
  33. package/src/opencode.prompts.lib.mjs +7 -21
  34. package/src/protect-branch.mjs +14 -15
  35. package/src/review.mjs +28 -27
  36. package/src/reviewers-hive.mjs +64 -69
  37. package/src/sentry.lib.mjs +13 -10
  38. package/src/solve.auto-continue.lib.mjs +48 -38
  39. package/src/solve.auto-pr.lib.mjs +111 -69
  40. package/src/solve.branch-errors.lib.mjs +17 -46
  41. package/src/solve.branch.lib.mjs +16 -23
  42. package/src/solve.config.lib.mjs +263 -261
  43. package/src/solve.error-handlers.lib.mjs +21 -79
  44. package/src/solve.execution.lib.mjs +10 -18
  45. package/src/solve.feedback.lib.mjs +25 -46
  46. package/src/solve.mjs +59 -60
  47. package/src/solve.preparation.lib.mjs +10 -36
  48. package/src/solve.repo-setup.lib.mjs +4 -19
  49. package/src/solve.repository.lib.mjs +37 -37
  50. package/src/solve.results.lib.mjs +32 -46
  51. package/src/solve.session.lib.mjs +7 -22
  52. package/src/solve.validation.lib.mjs +19 -17
  53. package/src/solve.watch.lib.mjs +20 -33
  54. package/src/start-screen.mjs +24 -24
  55. package/src/task.mjs +38 -44
  56. package/src/telegram-bot.mjs +125 -121
  57. package/src/telegram-top-command.lib.mjs +32 -48
  58. package/src/usage-limit.lib.mjs +9 -13
  59. package/src/version-info.lib.mjs +1 -1
  60. package/src/version.lib.mjs +1 -1
  61. package/src/youtrack/solve.youtrack.lib.mjs +3 -8
  62. package/src/youtrack/youtrack-sync.mjs +8 -14
  63. package/src/youtrack/youtrack.lib.mjs +26 -28
@@ -8,7 +8,7 @@
8
8
  // This approach was adopted per issue #482 feedback to minimize custom code maintenance
9
9
 
10
10
  // Export an initialization function that accepts 'use'
11
- export const initializeConfig = async (use) => {
11
+ export const initializeConfig = async use => {
12
12
  // Import yargs with specific version for hideBin support
13
13
  const yargsModule = await use('yargs@17.7.2');
14
14
  const yargs = yargsModule.default || yargsModule;
@@ -18,266 +18,268 @@ export const initializeConfig = async (use) => {
18
18
  };
19
19
 
20
20
  // Function to create yargs configuration - avoids duplication
21
- export const createYargsConfig = (yargsInstance) => {
22
- return yargsInstance
23
- .usage('Usage: solve.mjs <issue-url> [options]')
24
- .command('$0 <issue-url>', 'Solve a GitHub issue or pull request', (yargs) => {
25
- yargs.positional('issue-url', {
21
+ export const createYargsConfig = yargsInstance => {
22
+ return (
23
+ yargsInstance
24
+ .usage('Usage: solve.mjs <issue-url> [options]')
25
+ .command('$0 <issue-url>', 'Solve a GitHub issue or pull request', yargs => {
26
+ yargs.positional('issue-url', {
27
+ type: 'string',
28
+ description: 'The GitHub issue URL to solve',
29
+ });
30
+ })
31
+ .fail((msg, err) => {
32
+ // Custom fail handler to suppress yargs error output
33
+ // Errors will be handled in the parseArguments catch block
34
+ if (err) throw err; // Rethrow actual errors
35
+ // For validation errors, throw a clean error object with the message
36
+ const error = new Error(msg);
37
+ error.name = 'YargsValidationError';
38
+ throw error;
39
+ })
40
+ .option('resume', {
26
41
  type: 'string',
27
- description: 'The GitHub issue URL to solve'
28
- });
29
- })
30
- .fail((msg, err) => {
31
- // Custom fail handler to suppress yargs error output
32
- // Errors will be handled in the parseArguments catch block
33
- if (err) throw err; // Rethrow actual errors
34
- // For validation errors, throw a clean error object with the message
35
- const error = new Error(msg);
36
- error.name = 'YargsValidationError';
37
- throw error;
38
- })
39
- .option('resume', {
40
- type: 'string',
41
- description: 'Resume from a previous session ID (when limit was reached)',
42
- alias: 'r'
43
- })
44
- .option('only-prepare-command', {
45
- type: 'boolean',
46
- description: 'Only prepare and print the claude command without executing it',
47
- })
48
- .option('dry-run', {
49
- type: 'boolean',
50
- description: 'Prepare everything but do not execute Claude (alias for --only-prepare-command)',
51
- alias: 'n'
52
- })
53
- .option('skip-tool-connection-check', {
54
- type: 'boolean',
55
- description: 'Skip tool connection check (useful in CI environments). Does NOT skip model validation.',
56
- default: false
57
- })
58
- .option('skip-tool-check', {
59
- type: 'boolean',
60
- description: 'Alias for --skip-tool-connection-check (deprecated, use --skip-tool-connection-check instead)',
61
- default: false,
62
- hidden: true
63
- })
64
- .option('skip-claude-check', {
65
- type: 'boolean',
66
- description: 'Alias for --skip-tool-connection-check (deprecated)',
67
- default: false,
68
- hidden: true
69
- })
70
- .option('tool-connection-check', {
71
- type: 'boolean',
72
- description: 'Perform tool connection check (enabled by default, use --no-tool-connection-check to skip). Does NOT affect model validation.',
73
- default: true,
74
- hidden: true
75
- })
76
- .option('tool-check', {
77
- type: 'boolean',
78
- description: 'Alias for --tool-connection-check (deprecated)',
79
- default: true,
80
- hidden: true
81
- })
82
- .option('model', {
83
- type: 'string',
84
- description: 'Model to use (for claude: opus, sonnet, haiku, haiku-3-5, haiku-3; for opencode: grok, gpt4o; for codex: gpt5, gpt5-codex, o3; for agent: grok, grok-code, big-pickle)',
85
- alias: 'm',
86
- default: (currentParsedArgs) => {
87
- // Dynamic default based on tool selection
88
- if (currentParsedArgs?.tool === 'opencode') {
89
- return 'grok-code-fast-1';
90
- } else if (currentParsedArgs?.tool === 'codex') {
91
- return 'gpt-5';
92
- } else if (currentParsedArgs?.tool === 'agent') {
93
- return 'grok-code';
94
- }
95
- return 'sonnet';
96
- }
97
- })
98
- .option('auto-pull-request-creation', {
99
- type: 'boolean',
100
- description: 'Automatically create a draft pull request before running Claude',
101
- default: true
102
- })
103
- .option('verbose', {
104
- type: 'boolean',
105
- description: 'Enable verbose logging for debugging',
106
- alias: 'v',
107
- default: false
108
- })
109
- .option('fork', {
110
- type: 'boolean',
111
- description: 'Fork the repository if you don\'t have write access',
112
- alias: 'f',
113
- default: false
114
- })
115
- .option('auto-fork', {
116
- type: 'boolean',
117
- description: 'Automatically fork public repositories without write access (fails for private repos)',
118
- default: true
119
- })
120
- .option('attach-logs', {
121
- type: 'boolean',
122
- description: 'Upload the solution draft log file to the Pull Request on completion (⚠️ WARNING: May expose sensitive data)',
123
- default: false
124
- })
125
- .option('auto-close-pull-request-on-fail', {
126
- type: 'boolean',
127
- description: 'Automatically close the pull request if execution fails',
128
- default: false
129
- })
130
- .option('auto-continue', {
131
- type: 'boolean',
132
- description: 'Continue with existing PR when issue URL is provided (instead of creating new PR)',
133
- default: true
134
- })
135
- .option('auto-continue-on-limit-reset', {
136
- type: 'boolean',
137
- description: 'Automatically continue when AI tool limit resets (calculates reset time and waits)',
138
- default: false
139
- })
140
- .option('auto-resume-on-errors', {
141
- type: 'boolean',
142
- description: 'Automatically resume on network errors (503, etc.) with exponential backoff',
143
- default: false
144
- })
145
- .option('auto-continue-only-on-new-comments', {
146
- type: 'boolean',
147
- description: 'Explicitly fail on absence of new comments in auto-continue or continue mode',
148
- default: false
149
- })
150
- .option('auto-commit-uncommitted-changes', {
151
- type: 'boolean',
152
- description: 'Automatically commit and push uncommitted changes made by Claude (disabled by default)',
153
- default: false
154
- })
155
- .option('auto-restart-on-uncommitted-changes', {
156
- type: 'boolean',
157
- description: 'Automatically restart when uncommitted changes are detected to allow the tool to handle them (default: true, use --no-auto-restart-on-uncommitted-changes to disable)',
158
- default: true
159
- })
160
- .option('auto-restart-max-iterations', {
161
- type: 'number',
162
- description: 'Maximum number of auto-restart iterations when uncommitted changes are detected (default: 3)',
163
- default: 3
164
- })
165
- .option('continue-only-on-feedback', {
166
- type: 'boolean',
167
- description: 'Only continue if feedback is detected (works only with pull request link or issue link with --auto-continue)',
168
- default: false
169
- })
170
- .option('watch', {
171
- type: 'boolean',
172
- description: 'Monitor continuously for feedback and auto-restart when detected (stops when PR is merged)',
173
- alias: 'w',
174
- default: false
175
- })
176
- .option('watch-interval', {
177
- type: 'number',
178
- description: 'Interval in seconds for checking feedback in watch mode (default: 60)',
179
- default: 60
180
- })
181
- .option('min-disk-space', {
182
- type: 'number',
183
- description: 'Minimum required disk space in MB (default: 500)',
184
- default: 500
185
- })
186
- .option('log-dir', {
187
- type: 'string',
188
- description: 'Directory to save log files (defaults to current working directory)',
189
- alias: 'l'
190
- })
191
- .option('think', {
192
- type: 'string',
193
- description: 'Thinking level: low (Think.), medium (Think hard.), high (Think harder.), max (Ultrathink.)',
194
- choices: ['low', 'medium', 'high', 'max'],
195
- default: undefined
196
- })
197
- .option('prompt-plan-sub-agent', {
198
- type: 'boolean',
199
- description: 'Encourage AI to use Plan sub-agent for initial planning (only works with --tool claude)',
200
- default: false
201
- })
202
- .option('base-branch', {
203
- type: 'string',
204
- description: 'Target branch for the pull request (defaults to repository default branch)',
205
- alias: 'b'
206
- })
207
- .option('sentry', {
208
- type: 'boolean',
209
- description: 'Enable Sentry error tracking and monitoring (use --no-sentry to disable)',
210
- default: true
211
- })
212
- .option('auto-cleanup', {
213
- type: 'boolean',
214
- description: 'Automatically delete temporary working directory on completion (error, success, or CTRL+C). Default: true for private repos, false for public repos. Use explicit flag to override.',
215
- default: undefined
216
- })
217
- .option('auto-merge-default-branch-to-pull-request-branch', {
218
- type: 'boolean',
219
- description: 'Automatically merge the default branch to the pull request branch when continuing work (only in continue mode)',
220
- default: false
221
- })
222
- .option('allow-fork-divergence-resolution-using-force-push-with-lease', {
223
- type: 'boolean',
224
- description: 'Allow automatic force-push (--force-with-lease) when fork diverges from upstream (DANGEROUS: can overwrite fork history)',
225
- default: false
226
- })
227
- .option('allow-to-push-to-contributors-pull-requests-as-maintainer', {
228
- type: 'boolean',
229
- description: 'When continuing a fork PR as a maintainer, attempt to push directly to the contributor\'s fork if "Allow edits by maintainers" is enabled. Requires --auto-fork to be enabled.',
230
- default: false
231
- })
232
- .option('prefix-fork-name-with-owner-name', {
233
- type: 'boolean',
234
- description: 'Prefix fork name with original owner name (e.g., "owner-repo" instead of "repo"). Useful when forking repositories with same name from different owners.',
235
- default: true
236
- })
237
- .option('tool', {
238
- type: 'string',
239
- description: 'AI tool to use for solving issues',
240
- choices: ['claude', 'opencode', 'codex', 'agent'],
241
- default: 'claude'
242
- })
243
- .option('interactive-mode', {
244
- type: 'boolean',
245
- description: '[EXPERIMENTAL] Post Claude output as PR comments in real-time. Only supported for --tool claude.',
246
- default: false
247
- })
248
- .option('prompt-explore-sub-agent', {
249
- type: 'boolean',
250
- description: 'Encourage Claude to use Explore sub-agent for codebase exploration. Only supported for --tool claude.',
251
- default: false
252
- })
253
- .option('prompt-general-purpose-sub-agent', {
254
- type: 'boolean',
255
- description: 'Prompt AI to use general-purpose sub agents for processing large tasks with multiple files/folders. Only supported for --tool claude.',
256
- default: false
257
- })
258
- .option('tokens-budget-stats', {
259
- type: 'boolean',
260
- description: '[EXPERIMENTAL] Show detailed token budget statistics including context window usage and ratios. Only supported for --tool claude.',
261
- default: false
262
- })
263
- .option('prompt-issue-reporting', {
264
- type: 'boolean',
265
- description: 'Enable automatic issue creation for spotted bugs/errors not related to main task. Issues will include reproducible examples, workarounds, and fix suggestions. Works for both current and third-party repositories. Only supported for --tool claude.',
266
- default: false
267
- })
268
- .option('prompt-case-studies', {
269
- type: 'boolean',
270
- description: 'Create comprehensive case study documentation for the issue including logs, analysis, timeline, root cause investigation, and proposed solutions. Organizes findings into ./docs/case-studies/issue-{id}/ directory. Only supported for --tool claude.',
271
- default: false
272
- })
273
- .parserConfiguration({
274
- 'boolean-negation': true
275
- })
276
- // Use yargs built-in strict mode to reject unrecognized options
277
- // This prevents issues like #453 and #482 where unknown options are silently ignored
278
- .strict()
279
- .help('h')
280
- .alias('h', 'help');
42
+ description: 'Resume from a previous session ID (when limit was reached)',
43
+ alias: 'r',
44
+ })
45
+ .option('only-prepare-command', {
46
+ type: 'boolean',
47
+ description: 'Only prepare and print the claude command without executing it',
48
+ })
49
+ .option('dry-run', {
50
+ type: 'boolean',
51
+ description: 'Prepare everything but do not execute Claude (alias for --only-prepare-command)',
52
+ alias: 'n',
53
+ })
54
+ .option('skip-tool-connection-check', {
55
+ type: 'boolean',
56
+ description: 'Skip tool connection check (useful in CI environments). Does NOT skip model validation.',
57
+ default: false,
58
+ })
59
+ .option('skip-tool-check', {
60
+ type: 'boolean',
61
+ description: 'Alias for --skip-tool-connection-check (deprecated, use --skip-tool-connection-check instead)',
62
+ default: false,
63
+ hidden: true,
64
+ })
65
+ .option('skip-claude-check', {
66
+ type: 'boolean',
67
+ description: 'Alias for --skip-tool-connection-check (deprecated)',
68
+ default: false,
69
+ hidden: true,
70
+ })
71
+ .option('tool-connection-check', {
72
+ type: 'boolean',
73
+ description: 'Perform tool connection check (enabled by default, use --no-tool-connection-check to skip). Does NOT affect model validation.',
74
+ default: true,
75
+ hidden: true,
76
+ })
77
+ .option('tool-check', {
78
+ type: 'boolean',
79
+ description: 'Alias for --tool-connection-check (deprecated)',
80
+ default: true,
81
+ hidden: true,
82
+ })
83
+ .option('model', {
84
+ type: 'string',
85
+ description: 'Model to use (for claude: opus, sonnet, haiku, haiku-3-5, haiku-3; for opencode: grok, gpt4o; for codex: gpt5, gpt5-codex, o3; for agent: grok, grok-code, big-pickle)',
86
+ alias: 'm',
87
+ default: currentParsedArgs => {
88
+ // Dynamic default based on tool selection
89
+ if (currentParsedArgs?.tool === 'opencode') {
90
+ return 'grok-code-fast-1';
91
+ } else if (currentParsedArgs?.tool === 'codex') {
92
+ return 'gpt-5';
93
+ } else if (currentParsedArgs?.tool === 'agent') {
94
+ return 'grok-code';
95
+ }
96
+ return 'sonnet';
97
+ },
98
+ })
99
+ .option('auto-pull-request-creation', {
100
+ type: 'boolean',
101
+ description: 'Automatically create a draft pull request before running Claude',
102
+ default: true,
103
+ })
104
+ .option('verbose', {
105
+ type: 'boolean',
106
+ description: 'Enable verbose logging for debugging',
107
+ alias: 'v',
108
+ default: false,
109
+ })
110
+ .option('fork', {
111
+ type: 'boolean',
112
+ description: "Fork the repository if you don't have write access",
113
+ alias: 'f',
114
+ default: false,
115
+ })
116
+ .option('auto-fork', {
117
+ type: 'boolean',
118
+ description: 'Automatically fork public repositories without write access (fails for private repos)',
119
+ default: true,
120
+ })
121
+ .option('attach-logs', {
122
+ type: 'boolean',
123
+ description: 'Upload the solution draft log file to the Pull Request on completion (⚠️ WARNING: May expose sensitive data)',
124
+ default: false,
125
+ })
126
+ .option('auto-close-pull-request-on-fail', {
127
+ type: 'boolean',
128
+ description: 'Automatically close the pull request if execution fails',
129
+ default: false,
130
+ })
131
+ .option('auto-continue', {
132
+ type: 'boolean',
133
+ description: 'Continue with existing PR when issue URL is provided (instead of creating new PR)',
134
+ default: true,
135
+ })
136
+ .option('auto-continue-on-limit-reset', {
137
+ type: 'boolean',
138
+ description: 'Automatically continue when AI tool limit resets (calculates reset time and waits)',
139
+ default: false,
140
+ })
141
+ .option('auto-resume-on-errors', {
142
+ type: 'boolean',
143
+ description: 'Automatically resume on network errors (503, etc.) with exponential backoff',
144
+ default: false,
145
+ })
146
+ .option('auto-continue-only-on-new-comments', {
147
+ type: 'boolean',
148
+ description: 'Explicitly fail on absence of new comments in auto-continue or continue mode',
149
+ default: false,
150
+ })
151
+ .option('auto-commit-uncommitted-changes', {
152
+ type: 'boolean',
153
+ description: 'Automatically commit and push uncommitted changes made by Claude (disabled by default)',
154
+ default: false,
155
+ })
156
+ .option('auto-restart-on-uncommitted-changes', {
157
+ type: 'boolean',
158
+ description: 'Automatically restart when uncommitted changes are detected to allow the tool to handle them (default: true, use --no-auto-restart-on-uncommitted-changes to disable)',
159
+ default: true,
160
+ })
161
+ .option('auto-restart-max-iterations', {
162
+ type: 'number',
163
+ description: 'Maximum number of auto-restart iterations when uncommitted changes are detected (default: 3)',
164
+ default: 3,
165
+ })
166
+ .option('continue-only-on-feedback', {
167
+ type: 'boolean',
168
+ description: 'Only continue if feedback is detected (works only with pull request link or issue link with --auto-continue)',
169
+ default: false,
170
+ })
171
+ .option('watch', {
172
+ type: 'boolean',
173
+ description: 'Monitor continuously for feedback and auto-restart when detected (stops when PR is merged)',
174
+ alias: 'w',
175
+ default: false,
176
+ })
177
+ .option('watch-interval', {
178
+ type: 'number',
179
+ description: 'Interval in seconds for checking feedback in watch mode (default: 60)',
180
+ default: 60,
181
+ })
182
+ .option('min-disk-space', {
183
+ type: 'number',
184
+ description: 'Minimum required disk space in MB (default: 500)',
185
+ default: 500,
186
+ })
187
+ .option('log-dir', {
188
+ type: 'string',
189
+ description: 'Directory to save log files (defaults to current working directory)',
190
+ alias: 'l',
191
+ })
192
+ .option('think', {
193
+ type: 'string',
194
+ description: 'Thinking level: low (Think.), medium (Think hard.), high (Think harder.), max (Ultrathink.)',
195
+ choices: ['low', 'medium', 'high', 'max'],
196
+ default: undefined,
197
+ })
198
+ .option('prompt-plan-sub-agent', {
199
+ type: 'boolean',
200
+ description: 'Encourage AI to use Plan sub-agent for initial planning (only works with --tool claude)',
201
+ default: false,
202
+ })
203
+ .option('base-branch', {
204
+ type: 'string',
205
+ description: 'Target branch for the pull request (defaults to repository default branch)',
206
+ alias: 'b',
207
+ })
208
+ .option('sentry', {
209
+ type: 'boolean',
210
+ description: 'Enable Sentry error tracking and monitoring (use --no-sentry to disable)',
211
+ default: true,
212
+ })
213
+ .option('auto-cleanup', {
214
+ type: 'boolean',
215
+ description: 'Automatically delete temporary working directory on completion (error, success, or CTRL+C). Default: true for private repos, false for public repos. Use explicit flag to override.',
216
+ default: undefined,
217
+ })
218
+ .option('auto-merge-default-branch-to-pull-request-branch', {
219
+ type: 'boolean',
220
+ description: 'Automatically merge the default branch to the pull request branch when continuing work (only in continue mode)',
221
+ default: false,
222
+ })
223
+ .option('allow-fork-divergence-resolution-using-force-push-with-lease', {
224
+ type: 'boolean',
225
+ description: 'Allow automatic force-push (--force-with-lease) when fork diverges from upstream (DANGEROUS: can overwrite fork history)',
226
+ default: false,
227
+ })
228
+ .option('allow-to-push-to-contributors-pull-requests-as-maintainer', {
229
+ type: 'boolean',
230
+ description: 'When continuing a fork PR as a maintainer, attempt to push directly to the contributor\'s fork if "Allow edits by maintainers" is enabled. Requires --auto-fork to be enabled.',
231
+ default: false,
232
+ })
233
+ .option('prefix-fork-name-with-owner-name', {
234
+ type: 'boolean',
235
+ description: 'Prefix fork name with original owner name (e.g., "owner-repo" instead of "repo"). Useful when forking repositories with same name from different owners.',
236
+ default: true,
237
+ })
238
+ .option('tool', {
239
+ type: 'string',
240
+ description: 'AI tool to use for solving issues',
241
+ choices: ['claude', 'opencode', 'codex', 'agent'],
242
+ default: 'claude',
243
+ })
244
+ .option('interactive-mode', {
245
+ type: 'boolean',
246
+ description: '[EXPERIMENTAL] Post Claude output as PR comments in real-time. Only supported for --tool claude.',
247
+ default: false,
248
+ })
249
+ .option('prompt-explore-sub-agent', {
250
+ type: 'boolean',
251
+ description: 'Encourage Claude to use Explore sub-agent for codebase exploration. Only supported for --tool claude.',
252
+ default: false,
253
+ })
254
+ .option('prompt-general-purpose-sub-agent', {
255
+ type: 'boolean',
256
+ description: 'Prompt AI to use general-purpose sub agents for processing large tasks with multiple files/folders. Only supported for --tool claude.',
257
+ default: false,
258
+ })
259
+ .option('tokens-budget-stats', {
260
+ type: 'boolean',
261
+ description: '[EXPERIMENTAL] Show detailed token budget statistics including context window usage and ratios. Only supported for --tool claude.',
262
+ default: false,
263
+ })
264
+ .option('prompt-issue-reporting', {
265
+ type: 'boolean',
266
+ description: 'Enable automatic issue creation for spotted bugs/errors not related to main task. Issues will include reproducible examples, workarounds, and fix suggestions. Works for both current and third-party repositories. Only supported for --tool claude.',
267
+ default: false,
268
+ })
269
+ .option('prompt-case-studies', {
270
+ type: 'boolean',
271
+ description: 'Create comprehensive case study documentation for the issue including logs, analysis, timeline, root cause investigation, and proposed solutions. Organizes findings into ./docs/case-studies/issue-{id}/ directory. Only supported for --tool claude.',
272
+ default: false,
273
+ })
274
+ .parserConfiguration({
275
+ 'boolean-negation': true,
276
+ })
277
+ // Use yargs built-in strict mode to reject unrecognized options
278
+ // This prevents issues like #453 and #482 where unknown options are silently ignored
279
+ .strict()
280
+ .help('h')
281
+ .alias('h', 'help')
282
+ );
281
283
  };
282
284
 
283
285
  // Parse command line arguments - now needs yargs and hideBin passed in
@@ -296,7 +298,7 @@ export const parseArguments = async (yargs, hideBin) => {
296
298
  const stderrBuffer = [];
297
299
 
298
300
  // Temporarily override stderr.write to capture output
299
- process.stderr.write = function(chunk, encoding, callback) {
301
+ process.stderr.write = function (chunk, encoding, callback) {
300
302
  stderrBuffer.push(chunk.toString());
301
303
  // Call the callback if provided (for compatibility)
302
304
  if (typeof encoding === 'function') {