opencode-reviewer 0.4.2 → 0.4.3
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 +2 -0
- package/dist/tui.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ OpenCode installs the [npm package](https://www.npmjs.com/package/opencode-revie
|
|
|
30
30
|
"reviewCustomTools": false,
|
|
31
31
|
"reviewExternalDirectories": false,
|
|
32
32
|
"autoApprove": false,
|
|
33
|
+
"extraCareful": true,
|
|
33
34
|
"autoApproveDelaySeconds": 15,
|
|
34
35
|
"formatRetries": 1,
|
|
35
36
|
"timeoutMs": 30000,
|
|
@@ -64,6 +65,7 @@ rules to `ask` in `opencode.json`. Existing `allow` rules skip review.
|
|
|
64
65
|
| `reviewCustomTools` | Review permissions requested by registered custom tools. |
|
|
65
66
|
| `reviewExternalDirectories` | Review directory access independently of the other switches. Directory approval can resume the operation without another prompt. |
|
|
66
67
|
| `autoApprove` | Allow completed Safe reviews once after the visible countdown. |
|
|
68
|
+
| `extraCareful` | Include the extra-careful prompt in auto-mode reviews. Defaults to `true`; set `false` to omit it. |
|
|
67
69
|
| `autoApproveDelaySeconds` | Countdown duration, 0–3600 seconds. |
|
|
68
70
|
| `formatRetries` | Additional attempts to correct malformed assessment JSON, 0–100. |
|
|
69
71
|
| `timeoutMs` | Total review deadline, 1–3,600,000 ms. |
|
package/dist/tui.js
CHANGED
|
@@ -554,7 +554,7 @@ import { CliRenderEvents, CodeRenderable, RGBA, SyntaxStyle } from "@opentui/cor
|
|
|
554
554
|
init_define_REVIEW_PROMPTS();
|
|
555
555
|
import path from "node:path";
|
|
556
556
|
function parseConfig(options = {}) {
|
|
557
|
-
const keys = /* @__PURE__ */ new Set(["baseURL", "model", "apiKey", "apiKeyEnv", "instructions", "stream", "reviewBash", "reviewEdits", "reviewMcp", "reviewCustomTools", "reviewExternalDirectories", "autoApprove", "autoApproveDelaySeconds", "formatRetries", "timeoutMs", "maxFiles", "maxEvidenceBytes"]);
|
|
557
|
+
const keys = /* @__PURE__ */ new Set(["baseURL", "model", "apiKey", "apiKeyEnv", "instructions", "stream", "reviewBash", "reviewEdits", "reviewMcp", "reviewCustomTools", "reviewExternalDirectories", "autoApprove", "extraCareful", "autoApproveDelaySeconds", "formatRetries", "timeoutMs", "maxFiles", "maxEvidenceBytes"]);
|
|
558
558
|
for (const key of Object.keys(options)) if (!keys.has(key)) throw new Error(`Unknown opencode-reviewer setting: ${key}`);
|
|
559
559
|
const text = (name, optional = false) => {
|
|
560
560
|
const value = options[name];
|
|
@@ -602,6 +602,7 @@ function parseConfig(options = {}) {
|
|
|
602
602
|
reviewCustomTools: boolean("reviewCustomTools", false),
|
|
603
603
|
reviewExternalDirectories: boolean("reviewExternalDirectories", false),
|
|
604
604
|
autoApprove: boolean("autoApprove", false),
|
|
605
|
+
extraCareful: boolean("extraCareful"),
|
|
605
606
|
autoApproveDelaySeconds: number("autoApproveDelaySeconds", 15, 0, 3600),
|
|
606
607
|
formatRetries: number("formatRetries", 1, 0, 100),
|
|
607
608
|
timeoutMs: number("timeoutMs", 3e4, 1, 36e5),
|
|
@@ -1637,7 +1638,7 @@ async function review(evidence, config, signal, fetcher = fetch, environment = p
|
|
|
1637
1638
|
if (config.apiKeyEnv && !key) throw new Error(`API key environment variable ${config.apiKeyEnv} is unset or empty`);
|
|
1638
1639
|
const prompt2 = prompts[evidence.kind];
|
|
1639
1640
|
const messages = [
|
|
1640
|
-
{ role: "system", content: [prompt2.instructions, ...config.autoApprove ? [prompts.extraCareful] : [], CONTRACT].join("\n\n") },
|
|
1641
|
+
{ role: "system", content: [prompt2.instructions, ...config.autoApprove && config.extraCareful ? [prompts.extraCareful] : [], CONTRACT].join("\n\n") },
|
|
1641
1642
|
{ role: "user", content: JSON.stringify(evidence) }
|
|
1642
1643
|
];
|
|
1643
1644
|
let usage;
|