openairev 0.3.2 → 0.3.4
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 +4 -4
- package/package.json +1 -1
- package/src/cli/init.js +31 -28
- package/src/mcp/mcp-server.js +2 -2
package/README.md
CHANGED
|
@@ -222,11 +222,11 @@ Restart your agent CLI after adding.
|
|
|
222
222
|
|
|
223
223
|
The review runs asynchronously so you can see progress:
|
|
224
224
|
|
|
225
|
-
1. Call `openairev_review` →
|
|
226
|
-
2.
|
|
227
|
-
3. When
|
|
225
|
+
1. Call `openairev_review` → starts review in background, returns immediately
|
|
226
|
+
2. Read `.openairev/progress.json` → shows live progress (files read, commands run, tokens)
|
|
227
|
+
3. When `status` is `"completed"`, the verdict and feedback are in the same file
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
The executor AI can read the progress file directly (no MCP round-trip needed), or use `openairev_status` as an alternative. The AI can also launch the review in a sub-agent and continue other work while it runs.
|
|
230
230
|
|
|
231
231
|
## Config
|
|
232
232
|
|
package/package.json
CHANGED
package/src/cli/init.js
CHANGED
|
@@ -215,6 +215,24 @@ function buildToolsConfig(answers) {
|
|
|
215
215
|
return tools;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
function upsertMarkedSection(filePath, marker, content, label) {
|
|
219
|
+
if (existsSync(filePath)) {
|
|
220
|
+
const existing = readFileSync(filePath, 'utf-8');
|
|
221
|
+
if (existing.includes(marker)) {
|
|
222
|
+
const regex = new RegExp(`${marker}[\\s\\S]*?${marker}`, 'g');
|
|
223
|
+
const updated = existing.replace(regex, content);
|
|
224
|
+
writeFileSync(filePath, updated);
|
|
225
|
+
console.log(`${chalk.green('✓')} OpenAIRev instructions updated in ${label}`);
|
|
226
|
+
} else {
|
|
227
|
+
writeFileSync(filePath, existing + '\n' + content + '\n');
|
|
228
|
+
console.log(`${chalk.green('✓')} OpenAIRev instructions appended to ${label}`);
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
writeFileSync(filePath, content + '\n');
|
|
232
|
+
console.log(`${chalk.green('✓')} ${label} created with OpenAIRev instructions`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
218
236
|
function copyIfMissing(src, dest) {
|
|
219
237
|
if (!existsSync(dest) && existsSync(src)) {
|
|
220
238
|
copyFileSync(src, dest);
|
|
@@ -240,25 +258,18 @@ ${marker}
|
|
|
240
258
|
This project uses OpenAIRev for independent AI code review. When the user asks to "review", "get a review", or "check my changes":
|
|
241
259
|
|
|
242
260
|
1. Call \`openairev_review\` with \`executor: "claude_code"\` and \`diff_cmd\` scoped to the files you changed (e.g. \`"git diff HEAD -- src/auth.ts src/routes.ts"\`). The review starts in the background and returns immediately.
|
|
243
|
-
2.
|
|
244
|
-
3. When
|
|
261
|
+
2. To check progress, read \`.openairev/progress.json\` — it updates in real-time showing what the reviewer is reading and doing.
|
|
262
|
+
3. When \`progress.json\` shows \`"status": "completed"\`, the verdict and feedback are in the same file.
|
|
245
263
|
|
|
246
|
-
|
|
264
|
+
**Tips**:
|
|
265
|
+
- Always use \`diff_cmd\` to scope the diff to your changed files. Do NOT let it auto-detect — the full repo diff may be too large.
|
|
266
|
+
- You can launch the review in a **sub-agent** and continue other work while it runs.
|
|
247
267
|
- When you receive review feedback, treat it as **peer review** — use your judgment, don't blindly apply every suggestion.
|
|
248
|
-
-
|
|
268
|
+
- Focus on high-confidence \`critical_issues\` and \`repair_instructions\`.
|
|
249
269
|
${marker}
|
|
250
270
|
`;
|
|
251
271
|
|
|
252
|
-
|
|
253
|
-
const existing = readFileSync(claudeMdPath, 'utf-8');
|
|
254
|
-
if (!existing.includes(marker)) {
|
|
255
|
-
writeFileSync(claudeMdPath, existing + '\n' + instructions.trim() + '\n');
|
|
256
|
-
console.log(`${chalk.green('✓')} OpenAIRev instructions appended to CLAUDE.md`);
|
|
257
|
-
}
|
|
258
|
-
} else {
|
|
259
|
-
writeFileSync(claudeMdPath, instructions.trim() + '\n');
|
|
260
|
-
console.log(`${chalk.green('✓')} CLAUDE.md created with OpenAIRev instructions`);
|
|
261
|
-
}
|
|
272
|
+
upsertMarkedSection(claudeMdPath, marker, instructions.trim(), 'CLAUDE.md');
|
|
262
273
|
}
|
|
263
274
|
|
|
264
275
|
/**
|
|
@@ -302,23 +313,15 @@ ${marker}
|
|
|
302
313
|
This project uses OpenAIRev for independent AI code review. When the user asks to "review", "get a review", or "check my changes":
|
|
303
314
|
|
|
304
315
|
1. Call \`openairev_review\` with \`executor: "codex"\` and \`diff_cmd\` scoped to the files you changed (e.g. \`"git diff HEAD -- src/auth.ts src/routes.ts"\`). The review starts in the background and returns immediately.
|
|
305
|
-
2.
|
|
306
|
-
3. When
|
|
316
|
+
2. To check progress, read \`.openairev/progress.json\` — it updates in real-time showing what the reviewer is reading and doing.
|
|
317
|
+
3. When \`progress.json\` shows \`"status": "completed"\`, the verdict and feedback are in the same file.
|
|
307
318
|
|
|
308
|
-
|
|
319
|
+
**Tips**:
|
|
320
|
+
- Always use \`diff_cmd\` to scope the diff to your changed files. Do NOT let it auto-detect — the full repo diff may be too large.
|
|
309
321
|
- When you receive review feedback, treat it as **peer review** — use your judgment, don't blindly apply every suggestion.
|
|
310
|
-
-
|
|
322
|
+
- Focus on high-confidence \`critical_issues\` and \`repair_instructions\`.
|
|
311
323
|
${marker}
|
|
312
324
|
`;
|
|
313
325
|
|
|
314
|
-
|
|
315
|
-
const existing = readFileSync(agentsMdPath, 'utf-8');
|
|
316
|
-
if (!existing.includes(marker)) {
|
|
317
|
-
writeFileSync(agentsMdPath, existing + '\n' + instructions.trim() + '\n');
|
|
318
|
-
console.log(`${chalk.green('✓')} OpenAIRev instructions appended to AGENTS.md`);
|
|
319
|
-
}
|
|
320
|
-
} else {
|
|
321
|
-
writeFileSync(agentsMdPath, instructions.trim() + '\n');
|
|
322
|
-
console.log(`${chalk.green('✓')} AGENTS.md created with OpenAIRev instructions`);
|
|
323
|
-
}
|
|
326
|
+
upsertMarkedSection(agentsMdPath, marker, instructions.trim(), 'AGENTS.md');
|
|
324
327
|
}
|
package/src/mcp/mcp-server.js
CHANGED
|
@@ -25,7 +25,7 @@ const server = new McpServer({
|
|
|
25
25
|
|
|
26
26
|
server.tool(
|
|
27
27
|
'openairev_review',
|
|
28
|
-
'TRIGGER: Use this tool when the user says "review", "review my code", "get a review", "check my changes", "openairev", or asks for independent/cross-model code review. Sends current code changes to a DIFFERENT AI model for independent review. The review runs in the background
|
|
28
|
+
'TRIGGER: Use this tool when the user says "review", "review my code", "get a review", "check my changes", "openairev", or asks for independent/cross-model code review. Sends current code changes to a DIFFERENT AI model for independent review. The review runs in the background and returns immediately. To check progress, read .openairev/progress.json — it updates in real-time. When status is "completed", the verdict is in the same file.',
|
|
29
29
|
{
|
|
30
30
|
executor: z.string().optional().describe('Which agent wrote the code (claude_code or codex). If you are Claude Code, set this to "claude_code". If you are Codex, set this to "codex".'),
|
|
31
31
|
diff: z.string().optional().describe('The diff to review. IMPORTANT: Pass only the diff for files YOU changed, not the entire repo. Use `git diff HEAD -- file1 file2` to scope it. If omitted, auto-detects from git which may be too large.'),
|
|
@@ -98,7 +98,7 @@ server.tool(
|
|
|
98
98
|
|
|
99
99
|
server.tool(
|
|
100
100
|
'openairev_status',
|
|
101
|
-
'Check the progress and result of the current or most recent OpenAIRev review.
|
|
101
|
+
'Check the progress and result of the current or most recent OpenAIRev review. Alternative to reading .openairev/progress.json directly.',
|
|
102
102
|
{},
|
|
103
103
|
async () => {
|
|
104
104
|
const progress = readProgress();
|