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 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` → returns *"Review started. Call openairev_status."*
226
- 2. Call `openairev_status` → shows live progress (files read, commands run, tokens)
227
- 3. When done, `openairev_status` returns the full verdict and feedback
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
- This lets the executor AI (and user) see what the reviewer is doing instead of waiting blindly.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openairev",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Cross-model AI code reviewer — independent review for AI-assisted coding workflows",
5
5
  "type": "module",
6
6
  "bin": {
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. Call \`openairev_status\` to check progress. It shows what the reviewer is reading and doing. If the review is still running, call it again after a few seconds.
244
- 3. When the review is complete, \`openairev_status\` returns the full verdict with feedback.
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
- - **IMPORTANT**: 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.
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
- - The review verdict includes \`critical_issues\`, \`repair_instructions\`, and a \`confidence\` score. Focus on high-confidence critical issues.
268
+ - Focus on high-confidence \`critical_issues\` and \`repair_instructions\`.
249
269
  ${marker}
250
270
  `;
251
271
 
252
- if (existsSync(claudeMdPath)) {
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. Call \`openairev_status\` to check progress. It shows what the reviewer is reading and doing. If the review is still running, call it again after a few seconds.
306
- 3. When the review is complete, \`openairev_status\` returns the full verdict with feedback.
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
- - **IMPORTANT**: 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.
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
- - The review verdict includes \`critical_issues\`, \`repair_instructions\`, and a \`confidence\` score. Focus on high-confidence critical issues.
322
+ - Focus on high-confidence \`critical_issues\` and \`repair_instructions\`.
311
323
  ${marker}
312
324
  `;
313
325
 
314
- if (existsSync(agentsMdPath)) {
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
  }
@@ -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 call openairev_status to check progress and get the verdict when ready.',
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. Call this after openairev_review to see what the reviewer is doing and get the verdict when ready.',
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();