@link-assistant/hive-mind 0.46.1 → 0.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -15
- package/README.md +42 -8
- package/package.json +16 -3
- package/src/agent.lib.mjs +49 -70
- package/src/agent.prompts.lib.mjs +6 -20
- package/src/buildUserMention.lib.mjs +4 -17
- package/src/claude-limits.lib.mjs +15 -15
- package/src/claude.lib.mjs +617 -626
- package/src/claude.prompts.lib.mjs +7 -22
- package/src/codex.lib.mjs +39 -71
- package/src/codex.prompts.lib.mjs +6 -20
- package/src/config.lib.mjs +3 -16
- package/src/contributing-guidelines.lib.mjs +5 -18
- package/src/exit-handler.lib.mjs +4 -4
- package/src/git.lib.mjs +7 -7
- package/src/github-issue-creator.lib.mjs +17 -17
- package/src/github-linking.lib.mjs +8 -33
- package/src/github.batch.lib.mjs +20 -16
- package/src/github.graphql.lib.mjs +18 -18
- package/src/github.lib.mjs +89 -91
- package/src/hive.config.lib.mjs +50 -50
- package/src/hive.mjs +1293 -1296
- package/src/instrument.mjs +7 -11
- package/src/interactive-mode.lib.mjs +112 -138
- package/src/lenv-reader.lib.mjs +1 -6
- package/src/lib.mjs +36 -45
- package/src/lino.lib.mjs +2 -2
- package/src/local-ci-checks.lib.mjs +15 -14
- package/src/memory-check.mjs +52 -60
- package/src/model-mapping.lib.mjs +25 -32
- package/src/model-validation.lib.mjs +31 -31
- package/src/opencode.lib.mjs +37 -62
- package/src/opencode.prompts.lib.mjs +7 -21
- package/src/protect-branch.mjs +14 -15
- package/src/review.mjs +28 -27
- package/src/reviewers-hive.mjs +64 -69
- package/src/sentry.lib.mjs +13 -10
- package/src/solve.auto-continue.lib.mjs +48 -38
- package/src/solve.auto-pr.lib.mjs +111 -69
- package/src/solve.branch-errors.lib.mjs +17 -46
- package/src/solve.branch.lib.mjs +16 -23
- package/src/solve.config.lib.mjs +263 -261
- package/src/solve.error-handlers.lib.mjs +21 -79
- package/src/solve.execution.lib.mjs +10 -18
- package/src/solve.feedback.lib.mjs +25 -46
- package/src/solve.mjs +59 -60
- package/src/solve.preparation.lib.mjs +10 -36
- package/src/solve.repo-setup.lib.mjs +4 -19
- package/src/solve.repository.lib.mjs +37 -37
- package/src/solve.results.lib.mjs +32 -46
- package/src/solve.session.lib.mjs +7 -22
- package/src/solve.validation.lib.mjs +19 -17
- package/src/solve.watch.lib.mjs +20 -33
- package/src/start-screen.mjs +24 -24
- package/src/task.mjs +38 -44
- package/src/telegram-bot.mjs +125 -121
- package/src/telegram-top-command.lib.mjs +32 -48
- package/src/usage-limit.lib.mjs +9 -13
- package/src/version-info.lib.mjs +1 -1
- package/src/version.lib.mjs +1 -1
- package/src/youtrack/solve.youtrack.lib.mjs +3 -8
- package/src/youtrack/youtrack-sync.mjs +8 -14
- package/src/youtrack/youtrack.lib.mjs +26 -28
package/src/solve.config.lib.mjs
CHANGED
|
@@ -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
|
|
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 =
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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: '
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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') {
|