@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.
Files changed (63) hide show
  1. package/README.md +77 -4
  2. package/package.json +1 -1
  3. package/plugin/.claude-plugin/plugin.json +1 -1
  4. package/plugin/skills/review-requests/SKILL.md +4 -1
  5. package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
  6. package/plugin-code-critic/skills/analyze/SKILL.md +4 -3
  7. package/public/css/pr.css +1962 -114
  8. package/public/js/CONVENTIONS.md +16 -0
  9. package/public/js/components/AIPanel.js +66 -0
  10. package/public/js/components/AnalysisConfigModal.js +2 -2
  11. package/public/js/components/ChatPanel.js +2955 -0
  12. package/public/js/components/CouncilProgressModal.js +12 -16
  13. package/public/js/components/KeyboardShortcuts.js +3 -0
  14. package/public/js/components/PanelGroup.js +723 -0
  15. package/public/js/components/PreviewModal.js +3 -8
  16. package/public/js/index.js +8 -0
  17. package/public/js/local.js +17 -615
  18. package/public/js/modules/analysis-history.js +19 -68
  19. package/public/js/modules/comment-manager.js +103 -20
  20. package/public/js/modules/diff-context.js +176 -0
  21. package/public/js/modules/diff-renderer.js +30 -0
  22. package/public/js/modules/file-comment-manager.js +126 -105
  23. package/public/js/modules/file-list-merger.js +64 -0
  24. package/public/js/modules/panel-resizer.js +25 -6
  25. package/public/js/modules/suggestion-manager.js +40 -125
  26. package/public/js/pr.js +1009 -159
  27. package/public/js/repo-settings.js +36 -6
  28. package/public/js/utils/category-emoji.js +44 -0
  29. package/public/js/utils/time.js +32 -0
  30. package/public/local.html +107 -70
  31. package/public/pr.html +107 -70
  32. package/public/repo-settings.html +32 -0
  33. package/src/ai/analyzer.js +5 -1
  34. package/src/ai/copilot-provider.js +39 -9
  35. package/src/ai/cursor-agent-provider.js +45 -11
  36. package/src/ai/gemini-provider.js +17 -4
  37. package/src/ai/prompts/config.js +7 -1
  38. package/src/ai/provider-availability.js +1 -1
  39. package/src/ai/provider.js +25 -37
  40. package/src/chat/CONVENTIONS.md +18 -0
  41. package/src/chat/pi-bridge.js +491 -0
  42. package/src/chat/prompt-builder.js +272 -0
  43. package/src/chat/session-manager.js +619 -0
  44. package/src/config.js +14 -0
  45. package/src/database.js +322 -15
  46. package/src/main.js +4 -17
  47. package/src/routes/analyses.js +721 -0
  48. package/src/routes/chat.js +655 -0
  49. package/src/routes/config.js +29 -8
  50. package/src/routes/context-files.js +274 -0
  51. package/src/routes/local.js +225 -1133
  52. package/src/routes/mcp.js +39 -30
  53. package/src/routes/pr.js +424 -58
  54. package/src/routes/reviews.js +1035 -0
  55. package/src/routes/shared.js +4 -29
  56. package/src/server.js +34 -12
  57. package/src/sse/review-events.js +46 -0
  58. package/src/utils/auto-context.js +88 -0
  59. package/src/utils/category-emoji.js +33 -0
  60. package/src/utils/diff-annotator.js +75 -1
  61. package/src/utils/diff-file-list.js +57 -0
  62. package/src/routes/analysis.js +0 -1600
  63. package/src/routes/comments.js +0 -534
package/README.md CHANGED
@@ -10,6 +10,35 @@
10
10
 
11
11
  ![pair-review screenshot](https://raw.githubusercontent.com/in-the-loop-labs/pair-review/main/docs/screenshot.png)
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": "@in-the-loop-labs/pair-review",
3
- "version": "1.6.2",
3
+ "version": "2.0.1",
4
4
  "description": "Your AI-powered code review partner - Close the feedback loop with AI coding agents",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pair-review",
3
- "version": "1.6.2",
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
- For each PR found, open it in the browser with the `?analyze=true` query parameter, which
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": "1.6.2",
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
- - Include `provider`, `model`, `summary`, `suggestions`, and `fileLevelSuggestions` from the orchestrated JSON
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/analysis-results`:
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/analysis-results" \
113
+ -X POST "${SERVER_URL}/api/analyses/results" \
113
114
  -H "Content-Type: application/json" \
114
115
  -d @- <<'PAYLOAD'
115
116
  { ... }