kodevu 0.1.64 → 0.1.65

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 CHANGED
@@ -42,7 +42,7 @@ npx kodevu [target] [options]
42
42
  ### Options
43
43
 
44
44
  - `target`: Repository path (Git) or SVN URL/Working copy (default: `.`).
45
- - `--reviewer, -r`: `codex`, `gemini`, `copilot`, `openai`, or `auto` (default: `auto`).
45
+ - `--reviewer, -r`: `codex`, `gemini`, `copilot`, `openai`, `opencode` or `auto` (default: `auto`).
46
46
  - `--rev, -v`: A specific revision or commit hash to review.
47
47
  - `--last, -n`: Number of latest revisions to review (default: 1). Use negative values (e.g., `-3`) to review only the 3rd commit from the top.
48
48
  - `--uncommitted, -u`: Review current uncommitted changes in the target working tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodevu",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Poll SVN revisions or Git commits, send each change diff to a reviewer CLI, and write configurable review reports.",
package/src/config.js CHANGED
@@ -8,8 +8,8 @@ const require = createRequire(import.meta.url);
8
8
  const { version: packageVersion } = require("../package.json");
9
9
 
10
10
  const defaultStorageDir = path.join(os.homedir(), ".kodevu");
11
- const SUPPORTED_REVIEWERS = ["codex", "gemini", "copilot", "openai"];
12
- const AUTO_SUPPORTED_REVIEWERS = ["codex", "gemini", "copilot"];
11
+ const SUPPORTED_REVIEWERS = ["codex", "gemini", "copilot", "openai", "opencode"];
12
+ const AUTO_SUPPORTED_REVIEWERS = ["codex", "gemini", "copilot", "opencode"];
13
13
 
14
14
  const defaultConfig = {
15
15
  reviewer: "auto",
@@ -405,7 +405,7 @@ Usage:
405
405
 
406
406
  Options:
407
407
  --target, <path> Target repository path (default: current directory)
408
- --reviewer, -r Reviewer (codex | gemini | copilot | openai | auto, default: auto)
408
+ --reviewer, -r Reviewer (codex | gemini | copilot | openai | opencode | auto, default: auto)
409
409
  --prompt, -p Additional instructions or @file.txt to read from file
410
410
  --lang, -l Output language (e.g. zh, en, auto)
411
411
  --rev, -v Review specific revision(s), hashes, branches or ranges (comma-separated)
package/src/reviewers.js CHANGED
@@ -165,6 +165,45 @@ export const REVIEWERS = {
165
165
  }
166
166
  }
167
167
  },
168
+ opencode: {
169
+ displayName: "OpenCode",
170
+ responseSectionTitle: "OpenCode Response",
171
+ emptyResponseText: "_No final response returned from opencode._",
172
+ async run(config, workingDir, promptText, diffText) {
173
+ const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "kodevu-opencode-"));
174
+ const reviewInputFile = path.join(tempDir, "review-input.md");
175
+
176
+ try {
177
+ await fs.writeFile(
178
+ reviewInputFile,
179
+ [promptText, "### Unified Diff", "```diff", diffText, "```"].join("\n\n"),
180
+ "utf8"
181
+ );
182
+
183
+ const args = [
184
+ "run",
185
+ "Please perform the code review strictly following the instructions and unified diff provided in the attached file.",
186
+ "-f",
187
+ reviewInputFile,
188
+ "--pure"
189
+ ];
190
+
191
+ const execResult = await runCommand("opencode", args, {
192
+ cwd: workingDir,
193
+ allowFailure: true,
194
+ timeoutMs: config.commandTimeoutMs,
195
+ debug: config.debug
196
+ });
197
+
198
+ return {
199
+ ...execResult,
200
+ message: execResult.stdout
201
+ };
202
+ } finally {
203
+ await fs.rm(tempDir, { recursive: true, force: true });
204
+ }
205
+ }
206
+ },
168
207
  openai: {
169
208
  displayName: "OpenAI API",
170
209
  responseSectionTitle: "OpenAI Response",