kodevu 0.1.40 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/config.js +11 -0
- package/src/index.js +6 -1
- package/src/report-generator.js +6 -0
- package/src/reviewers.js +11 -1
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ npx kodevu [target] [options]
|
|
|
49
49
|
- `--output, -o`: Report output directory (default: `~/.kodevu`).
|
|
50
50
|
- `--format, -f`: Output formats (e.g., `markdown`, `json`, or `markdown,json`).
|
|
51
51
|
- `--debug, -d`: Print debug information.
|
|
52
|
+
- `--version, -V`: Print the current version and exit.
|
|
52
53
|
|
|
53
54
|
### Environment Variables
|
|
54
55
|
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -101,6 +101,7 @@ export function parseCliArgs(argv) {
|
|
|
101
101
|
target: "",
|
|
102
102
|
debug: false,
|
|
103
103
|
help: false,
|
|
104
|
+
version: false,
|
|
104
105
|
reviewer: "",
|
|
105
106
|
lang: "",
|
|
106
107
|
prompt: "",
|
|
@@ -118,6 +119,11 @@ export function parseCliArgs(argv) {
|
|
|
118
119
|
continue;
|
|
119
120
|
}
|
|
120
121
|
|
|
122
|
+
if (value === "--version" || value === "-V") {
|
|
123
|
+
args.version = true;
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
|
|
121
127
|
if (value === "--debug" || value === "-d") {
|
|
122
128
|
args.debug = true;
|
|
123
129
|
continue;
|
|
@@ -276,6 +282,7 @@ Options:
|
|
|
276
282
|
--format, -f Output formats (markdown, json, comma-separated)
|
|
277
283
|
--debug, -d Print extra debug information
|
|
278
284
|
--help, -h Show help
|
|
285
|
+
--version, -V Show version
|
|
279
286
|
|
|
280
287
|
Environment Variables:
|
|
281
288
|
KODEVU_REVIEWER Default reviewer
|
|
@@ -285,3 +292,7 @@ Environment Variables:
|
|
|
285
292
|
KODEVU_TIMEOUT Reviewer timeout in ms
|
|
286
293
|
`);
|
|
287
294
|
}
|
|
295
|
+
|
|
296
|
+
export function printVersion() {
|
|
297
|
+
console.log(packageVersion);
|
|
298
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { resolveConfig, parseCliArgs, printHelp } from "./config.js";
|
|
3
|
+
import { resolveConfig, parseCliArgs, printHelp, printVersion } from "./config.js";
|
|
4
4
|
import { runReviewCycle } from "./review-runner.js";
|
|
5
5
|
import { logger } from "./logger.js";
|
|
6
6
|
|
|
@@ -19,6 +19,11 @@ if (cliArgs.help) {
|
|
|
19
19
|
process.exit(0);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
if (cliArgs.version) {
|
|
23
|
+
printVersion();
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
try {
|
|
23
28
|
const config = await resolveConfig(cliArgs);
|
|
24
29
|
logger.init(config);
|
package/src/report-generator.js
CHANGED
|
@@ -258,6 +258,7 @@ export function shouldWriteFormat(config, format) {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
export function buildReport(config, backend, targetInfo, details, diffPayloads, reviewer, reviewerResult, tokenUsage) {
|
|
261
|
+
const stderrText = reviewerResult.stderr?.trim();
|
|
261
262
|
const lines = [
|
|
262
263
|
`# ${backend.displayName} Review Report: ${details.displayId}`,
|
|
263
264
|
"",
|
|
@@ -300,6 +301,10 @@ export function buildReport(config, backend, targetInfo, details, diffPayloads,
|
|
|
300
301
|
diffPayloads.report.text.trim() || "(empty diff)",
|
|
301
302
|
"```",
|
|
302
303
|
"",
|
|
304
|
+
"## Reviewer Diagnostics",
|
|
305
|
+
"",
|
|
306
|
+
stderrText ? "```text\n" + stderrText + "\n```" : "_No stderr output._",
|
|
307
|
+
"",
|
|
303
308
|
`## ${reviewer.responseSectionTitle}`,
|
|
304
309
|
"",
|
|
305
310
|
reviewerResult.message?.trim() ? reviewerResult.message.trim() : reviewer.emptyResponseText
|
|
@@ -351,6 +356,7 @@ export function buildJsonReport(config, backend, targetInfo, details, diffPayloa
|
|
|
351
356
|
}
|
|
352
357
|
},
|
|
353
358
|
diff: diffPayloads.report.text.trim(),
|
|
359
|
+
reviewerDiagnostics: reviewerResult.stderr?.trim() || "",
|
|
354
360
|
reviewerResponse: reviewerResult.message?.trim() ? reviewerResult.message.trim() : reviewer.emptyResponseText
|
|
355
361
|
};
|
|
356
362
|
}
|
package/src/reviewers.js
CHANGED
|
@@ -76,7 +76,17 @@ export const REVIEWERS = {
|
|
|
76
76
|
responseSectionTitle: "Copilot Response",
|
|
77
77
|
emptyResponseText: "_No final response returned from copilot._",
|
|
78
78
|
async run(config, workingDir, promptText, diffText) {
|
|
79
|
-
const
|
|
79
|
+
const args = [
|
|
80
|
+
"-p",
|
|
81
|
+
promptText,
|
|
82
|
+
"-s",
|
|
83
|
+
"--no-color",
|
|
84
|
+
"--no-ask-user",
|
|
85
|
+
"--allow-all-tools",
|
|
86
|
+
"--add-dir",
|
|
87
|
+
workingDir
|
|
88
|
+
];
|
|
89
|
+
const execResult = await runCommand("copilot", args, {
|
|
80
90
|
cwd: workingDir,
|
|
81
91
|
input: ["Unified diff:", diffText].join("\n\n"),
|
|
82
92
|
allowFailure: true,
|