@in-the-loop-labs/pair-review 1.6.2 → 2.0.1
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 +77 -4
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/review-requests/SKILL.md +4 -1
- package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/skills/analyze/SKILL.md +4 -3
- package/public/css/pr.css +1962 -114
- package/public/js/CONVENTIONS.md +16 -0
- package/public/js/components/AIPanel.js +66 -0
- package/public/js/components/AnalysisConfigModal.js +2 -2
- package/public/js/components/ChatPanel.js +2955 -0
- package/public/js/components/CouncilProgressModal.js +12 -16
- package/public/js/components/KeyboardShortcuts.js +3 -0
- package/public/js/components/PanelGroup.js +723 -0
- package/public/js/components/PreviewModal.js +3 -8
- package/public/js/index.js +8 -0
- package/public/js/local.js +17 -615
- package/public/js/modules/analysis-history.js +19 -68
- package/public/js/modules/comment-manager.js +103 -20
- package/public/js/modules/diff-context.js +176 -0
- package/public/js/modules/diff-renderer.js +30 -0
- package/public/js/modules/file-comment-manager.js +126 -105
- package/public/js/modules/file-list-merger.js +64 -0
- package/public/js/modules/panel-resizer.js +25 -6
- package/public/js/modules/suggestion-manager.js +40 -125
- package/public/js/pr.js +1009 -159
- package/public/js/repo-settings.js +36 -6
- package/public/js/utils/category-emoji.js +44 -0
- package/public/js/utils/time.js +32 -0
- package/public/local.html +107 -70
- package/public/pr.html +107 -70
- package/public/repo-settings.html +32 -0
- package/src/ai/analyzer.js +5 -1
- package/src/ai/copilot-provider.js +39 -9
- package/src/ai/cursor-agent-provider.js +45 -11
- package/src/ai/gemini-provider.js +17 -4
- package/src/ai/prompts/config.js +7 -1
- package/src/ai/provider-availability.js +1 -1
- package/src/ai/provider.js +25 -37
- package/src/chat/CONVENTIONS.md +18 -0
- package/src/chat/pi-bridge.js +491 -0
- package/src/chat/prompt-builder.js +272 -0
- package/src/chat/session-manager.js +619 -0
- package/src/config.js +14 -0
- package/src/database.js +322 -15
- package/src/main.js +4 -17
- package/src/routes/analyses.js +721 -0
- package/src/routes/chat.js +655 -0
- package/src/routes/config.js +29 -8
- package/src/routes/context-files.js +274 -0
- package/src/routes/local.js +225 -1133
- package/src/routes/mcp.js +39 -30
- package/src/routes/pr.js +424 -58
- package/src/routes/reviews.js +1035 -0
- package/src/routes/shared.js +4 -29
- package/src/server.js +34 -12
- package/src/sse/review-events.js +46 -0
- package/src/utils/auto-context.js +88 -0
- package/src/utils/category-emoji.js +33 -0
- package/src/utils/diff-annotator.js +75 -1
- package/src/utils/diff-file-list.js +57 -0
- package/src/routes/analysis.js +0 -1600
- package/src/routes/comments.js +0 -534
package/README.md
CHANGED
|
@@ -10,6 +10,35 @@
|
|
|
10
10
|
|
|
11
11
|

|
|
12
12
|
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
- [What is pair-review?](#what-is-pair-review)
|
|
16
|
+
- [Why pair-review?](#why-pair-review)
|
|
17
|
+
- [Workflows](#workflows)
|
|
18
|
+
- [Local Review](#1-local-review-human-reviews-agent-generated-code)
|
|
19
|
+
- [Meta-Review](#2-meta-review-judging-ai-suggestions)
|
|
20
|
+
- [AI-Guided Review](#3-ai-guided-review-when-youre-accountable)
|
|
21
|
+
- [Quick Start](#quick-start)
|
|
22
|
+
- [Command Line Interface](#command-line-interface)
|
|
23
|
+
- [Configuration](#configuration)
|
|
24
|
+
- [Environment Variables](#environment-variables)
|
|
25
|
+
- [GitHub Token](#github-token)
|
|
26
|
+
- [AI Provider Configuration](#ai-provider-configuration)
|
|
27
|
+
- [Features](#features)
|
|
28
|
+
- [Three-Level AI Analysis](#three-level-ai-analysis)
|
|
29
|
+
- [Analysis Configuration](#analysis-configuration)
|
|
30
|
+
- [Chat](#chat)
|
|
31
|
+
- [Customization](#customization)
|
|
32
|
+
- [Review Feedback Export](#review-feedback-export)
|
|
33
|
+
- [Inline Comments](#inline-comments)
|
|
34
|
+
- [Local Mode](#local-mode)
|
|
35
|
+
- [Claude Code Plugins](#claude-code-plugins)
|
|
36
|
+
- [MCP Integration](#mcp-integration)
|
|
37
|
+
- [Development](#development)
|
|
38
|
+
- [FAQ](#faq)
|
|
39
|
+
- [Contributing](#contributing)
|
|
40
|
+
- [License](#license)
|
|
41
|
+
|
|
13
42
|
## What is pair-review?
|
|
14
43
|
|
|
15
44
|
pair-review is a local web application for keeping humans in the loop with AI coding agents. Calling it an AI code review tool would be accurate but incomplete — it supports multiple workflows beyond automated review, from reviewing agent-generated code before committing, to judging AI suggestions instead of reading every line, to using AI to guide your attention during a thorough review. You pick what fits your situation.
|
|
@@ -365,10 +394,6 @@ The CLI command used for a provider follows this precedence (highest to lowest):
|
|
|
365
394
|
2. Config file `providers.<provider>.command`
|
|
366
395
|
3. Built-in default
|
|
367
396
|
|
|
368
|
-
#### Migration Notes
|
|
369
|
-
|
|
370
|
-
If you have an older config file using `provider` and `model` keys at the top level, they are automatically treated as `default_provider` and `default_model`. No migration is required.
|
|
371
|
-
|
|
372
397
|
## Features
|
|
373
398
|
|
|
374
399
|
### Three-Level AI Analysis
|
|
@@ -381,6 +406,51 @@ pair-review's AI analysis system examines your code changes at increasing levels
|
|
|
381
406
|
|
|
382
407
|
This progressive approach keeps analysis focused while catching issues at every scope.
|
|
383
408
|
|
|
409
|
+
### Analysis Configuration
|
|
410
|
+
|
|
411
|
+
There are three ways to configure which models run your analysis, each building on the last:
|
|
412
|
+
|
|
413
|
+
**Single Model** — Pick one provider and model. All enabled analysis levels run with that model, and consolidation uses the same model. The simplest option.
|
|
414
|
+
|
|
415
|
+
**Review Council** — Pick multiple provider+model combinations that all run in parallel across the selected analysis levels. You pick a separate consolidation model that merges everything together.
|
|
416
|
+
|
|
417
|
+
- Each reviewer can have its own timeout, instructions, and prompt tier (see [Model Tiers](#model-tiers))
|
|
418
|
+
- Results consolidate first across levels for each reviewer, then across reviewers
|
|
419
|
+
- Individual reviewer results are available alongside the overall council result
|
|
420
|
+
|
|
421
|
+
**Advanced** — For each enabled analysis level, pick different provider+model combinations. Level 1 might use a fast model while Level 3 uses a thorough one. Supports the same per-model options as Review Council (timeout, instructions, tier). Consolidation model is selected separately. Results consolidate first within each level (if multiple reviewers), then across levels.
|
|
422
|
+
|
|
423
|
+
The key difference from Review Council is consolidation order: Advanced consolidates within each level first, then across levels, so there are no per-reviewer rollups.
|
|
424
|
+
|
|
425
|
+
**Example use cases:**
|
|
426
|
+
|
|
427
|
+
- **Large changesets with Opus 4.6**: Use review council instructions to tell the model to use a Team — it will spawn sub-agents to divide the work
|
|
428
|
+
- **Multi-model parallel review**: Give each model a specific focus area (security, performance, correctness) via per-model instructions and get combined results
|
|
429
|
+
- **Cross-model perspectives**: Run the same analysis across different providers (e.g., Claude, Gemini, GPT) — where models agree signals high-confidence findings, but unique outliers from a single model can be equally valuable, catching issue types that only that model excels at spotting
|
|
430
|
+
|
|
431
|
+
### Chat
|
|
432
|
+
|
|
433
|
+
Chat with a full coding agent while you review — it can read the codebase, answer questions, and interact with pair-review on your behalf. Powered by [Pi](https://github.com/mariozechner/pi-coding-agent).
|
|
434
|
+
|
|
435
|
+
**What you can do:**
|
|
436
|
+
|
|
437
|
+
- Ask questions about the code, architecture, or intent behind changes
|
|
438
|
+
- Have the agent pull related code into the diff panel as context files — see how changed code connects to the rest of the codebase without leaving the review
|
|
439
|
+
- Adopt, dismiss, or discuss AI suggestions directly from the conversation
|
|
440
|
+
- Create and edit review comments through chat
|
|
441
|
+
- Trigger new analysis runs with custom instructions
|
|
442
|
+
- Start conversations from context — an analysis run, an AI suggestion, a comment, any line or file
|
|
443
|
+
|
|
444
|
+
**Setup:**
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
npm install -g @mariozechner/pi-coding-agent
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
Configure your preferred models in `providers.pi.models` — see [AI Provider Configuration](#ai-provider-configuration) for details. Everything else in pair-review works without Pi installed.
|
|
451
|
+
|
|
452
|
+
**Keyboard shortcut:** Press `p` then `c` to toggle the chat panel.
|
|
453
|
+
|
|
384
454
|
### Customization
|
|
385
455
|
|
|
386
456
|
Tailor AI analysis to your team's standards and your current needs:
|
|
@@ -638,6 +708,9 @@ A: OpenCode has no built-in models, so you must configure them in your `~/.pair-
|
|
|
638
708
|
**Q: How do I use Pi as my AI provider?**
|
|
639
709
|
A: Like OpenCode, Pi has no built-in models. Configure them in your `~/.pair-review/config.json` by adding a `providers.pi.models` array with at least one model definition. Pi supports many providers (Google, Anthropic, OpenAI, etc.) via its `--provider` and `--model` flags. See the [AI Provider Configuration](#ai-provider-configuration) section and `config.example.json` for examples.
|
|
640
710
|
|
|
711
|
+
**Q: Why does chat use Pi instead of Claude or other providers?**
|
|
712
|
+
A: Pi provides persistent interactive sessions with a full agent — it can read files and run commands in the context of the codebase. Pi is model-agnostic and uses your existing provider subscriptions — no separate API keys needed.
|
|
713
|
+
|
|
641
714
|
## Contributing
|
|
642
715
|
|
|
643
716
|
Contributions welcome! Please:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pair-review",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "pair-review app integration — Open PRs and local changes in the pair-review web UI, run server-side AI analysis, and address review feedback. Requires the pair-review MCP server.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "in-the-loop-labs",
|
|
@@ -35,7 +35,10 @@ Each result provides `number`, `title`, `html_url`, and `repo` (as `owner/repo`)
|
|
|
35
35
|
|
|
36
36
|
### Phase 3: Open each PR in pair-review with auto-analysis
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
**Limit**: Open at most **5** PRs. If more than 5 are found, open only the first 5 (most
|
|
39
|
+
recently updated) and report how many were skipped.
|
|
40
|
+
|
|
41
|
+
For each PR found (up to the limit), open it in the browser with the `?analyze=true` query parameter, which
|
|
39
42
|
automatically starts AI analysis when the page loads:
|
|
40
43
|
|
|
41
44
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-critic",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "AI-powered code review analysis — Run three-level AI analysis and implement-review-fix loops directly in your coding agent. Works standalone, no server required.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "in-the-loop-labs",
|
|
@@ -104,12 +104,13 @@ Push the orchestrated JSON to the pair-review web UI so suggestions appear inlin
|
|
|
104
104
|
2. **Build the POST body** from the orchestrated output:
|
|
105
105
|
- For local mode: set `path` (absolute working directory from `pwd`) and `headSha` (from `git rev-parse HEAD`)
|
|
106
106
|
- For PR mode: set `repo` (`owner/repo`) and `prNumber`
|
|
107
|
-
-
|
|
107
|
+
- Set `provider` and `model` to describe what ran the analysis (e.g., the AI provider and model used)
|
|
108
|
+
- Include `summary`, `suggestions`, and `fileLevelSuggestions` from the orchestrated JSON
|
|
108
109
|
|
|
109
|
-
3. **POST via `curl`** to `${SERVER_URL}/api/
|
|
110
|
+
3. **POST via `curl`** to `${SERVER_URL}/api/analyses/results`:
|
|
110
111
|
```
|
|
111
112
|
curl -s --connect-timeout 3 --max-time 10 \
|
|
112
|
-
-X POST "${SERVER_URL}/api/
|
|
113
|
+
-X POST "${SERVER_URL}/api/analyses/results" \
|
|
113
114
|
-H "Content-Type: application/json" \
|
|
114
115
|
-d @- <<'PAYLOAD'
|
|
115
116
|
{ ... }
|