@in-the-loop-labs/pair-review 5.3.7 → 5.4.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 +8 -0
- package/package.json +3 -3
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
- package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
- package/public/css/pr.css +389 -13
- package/public/index.html +1 -0
- package/public/js/components/AIPanel.js +317 -99
- package/public/js/components/AdvancedConfigTab.js +18 -108
- package/public/js/components/ReviewHistoryModal.js +294 -0
- package/public/js/components/ReviewModal.js +96 -7
- package/public/js/components/SplitButton.js +14 -0
- package/public/js/components/VoiceCentricConfigTab.js +18 -108
- package/public/js/index.js +18 -5
- package/public/js/local.js +4 -8
- package/public/js/modules/comment-manager.js +2 -1
- package/public/js/modules/diff-renderer.js +7 -6
- package/public/js/modules/file-comment-manager.js +6 -2
- package/public/js/modules/pierre-bridge.js +35 -1
- package/public/js/modules/suggestion-manager.js +4 -1
- package/public/js/pr.js +174 -66
- package/public/js/utils/council-timeout.js +203 -0
- package/public/js/utils/posted-comment.js +259 -14
- package/public/js/vendor/pierre-diffs-worker.js +41 -13485
- package/public/js/vendor/pierre-diffs.js +131 -1364
- package/public/local.html +4 -0
- package/public/pr.html +5 -0
- package/src/ai/copilot-provider.js +21 -2
- package/src/ai/cursor-agent-provider.js +21 -2
- package/src/ai/opencode-provider.js +21 -2
- package/src/chat/api-reference.js +22 -2
- package/src/config.js +28 -4
- package/src/database.js +416 -114
- package/src/git/worktree-pool-lifecycle.js +152 -33
- package/src/git/worktree-pool-usage.js +20 -0
- package/src/git/worktree.js +14 -5
- package/src/github/client.js +70 -15
- package/src/github/impl/graphql/pending-review-comments.js +50 -11
- package/src/github/impl/graphql/pending-review.js +8 -2
- package/src/github/impl/graphql/review-comment-edit.js +89 -0
- package/src/github/impl/host/pending-review-comments.js +41 -10
- package/src/github/impl/host/review-comment-edit.js +36 -0
- package/src/github/impl/rest/pending-review.js +6 -2
- package/src/github/impl/rest/review-comment-edit.js +44 -0
- package/src/github/impl/review-comment-edit-utils.js +45 -0
- package/src/github/operations/pending-review.js +4 -3
- package/src/github/operations/review-comment-edit.js +35 -0
- package/src/github/record-submission.js +78 -0
- package/src/github/update-posted-comment.js +115 -0
- package/src/main.js +42 -50
- package/src/routes/mcp.js +1 -0
- package/src/routes/pr.js +158 -120
- package/src/routes/reviews.js +8 -30
- package/src/routes/setup.js +22 -9
- package/src/setup/pr-setup.js +12 -3
- package/src/utils/diff-file-content.js +62 -25
- package/src/utils/json-extractor.js +267 -13
- package/src/utils/pr-file-blob-cache.js +134 -0
- package/src/utils/process-liveness.js +64 -0
package/public/local.html
CHANGED
|
@@ -562,6 +562,9 @@
|
|
|
562
562
|
<!-- Highlight.js for legacy/context-file syntax highlighting -->
|
|
563
563
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
564
564
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/elixir.min.js"></script>
|
|
565
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/erb.min.js"></script>
|
|
566
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/scala.min.js"></script>
|
|
567
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/dockerfile.min.js"></script>
|
|
565
568
|
|
|
566
569
|
<!-- Markdown-it Library for rendering markdown in comments -->
|
|
567
570
|
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.3.2/dist/markdown-it.min.js"></script>
|
|
@@ -616,6 +619,7 @@
|
|
|
616
619
|
<script src="/js/components/TextInputDialog.js"></script>
|
|
617
620
|
<script src="/js/components/AnalysisConfigModal.js"></script>
|
|
618
621
|
<script src="/js/components/TimeoutSelect.js"></script>
|
|
622
|
+
<script src="/js/utils/council-timeout.js"></script>
|
|
619
623
|
<script src="/js/components/VoiceCentricConfigTab.js"></script>
|
|
620
624
|
<script src="/js/components/AdvancedConfigTab.js"></script>
|
|
621
625
|
<script src="/js/components/CouncilProgressModal.js"></script>
|
package/public/pr.html
CHANGED
|
@@ -367,6 +367,9 @@
|
|
|
367
367
|
<!-- Highlight.js for legacy/context-file syntax highlighting -->
|
|
368
368
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
369
369
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/elixir.min.js"></script>
|
|
370
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/erb.min.js"></script>
|
|
371
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/scala.min.js"></script>
|
|
372
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/dockerfile.min.js"></script>
|
|
370
373
|
|
|
371
374
|
<!-- Markdown-it Library for rendering markdown in comments -->
|
|
372
375
|
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.3.2/dist/markdown-it.min.js"></script>
|
|
@@ -421,6 +424,7 @@
|
|
|
421
424
|
<script src="/js/components/TextInputDialog.js"></script>
|
|
422
425
|
<script src="/js/components/AnalysisConfigModal.js"></script>
|
|
423
426
|
<script src="/js/components/TimeoutSelect.js"></script>
|
|
427
|
+
<script src="/js/utils/council-timeout.js"></script>
|
|
424
428
|
<script src="/js/components/VoiceCentricConfigTab.js"></script>
|
|
425
429
|
<script src="/js/components/AdvancedConfigTab.js"></script>
|
|
426
430
|
<script src="/js/components/CouncilProgressModal.js"></script>
|
|
@@ -429,6 +433,7 @@
|
|
|
429
433
|
<script src="/js/components/StatusIndicator.js"></script>
|
|
430
434
|
<script src="/js/components/SuggestionNavigator.js"></script>
|
|
431
435
|
<script src="/js/components/ReviewModal.js"></script>
|
|
436
|
+
<script src="/js/components/ReviewHistoryModal.js"></script>
|
|
432
437
|
<script src="/js/components/PreviewModal.js"></script>
|
|
433
438
|
<script src="/js/components/SplitButton.js"></script>
|
|
434
439
|
<script src="/js/components/AISummaryModal.js"></script>
|
|
@@ -424,6 +424,22 @@ class CopilotProvider extends AIProvider {
|
|
|
424
424
|
return [...baseArgs, ...providerArgs, ...modelArgs];
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
/**
|
|
428
|
+
* Resolve merged env (provider env + model env) for the given model.
|
|
429
|
+
* Same merge the constructor applies for the analysis model, so the
|
|
430
|
+
* extraction model (possibly a different fast-tier model) gets its own env.
|
|
431
|
+
*
|
|
432
|
+
* @param {string} model - The model identifier
|
|
433
|
+
* @returns {Object} Env vars to merge into the child environment
|
|
434
|
+
*/
|
|
435
|
+
_resolveEnvForModel(model) {
|
|
436
|
+
const modelConfig = this.configOverrides?.models?.find(m => m.id === model);
|
|
437
|
+
return {
|
|
438
|
+
...(this.configOverrides?.env || {}),
|
|
439
|
+
...(modelConfig?.env || {})
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
427
443
|
/**
|
|
428
444
|
* Get CLI configuration for LLM extraction.
|
|
429
445
|
* Copilot reads from stdin when no -p argument is provided.
|
|
@@ -438,6 +454,7 @@ class CopilotProvider extends AIProvider {
|
|
|
438
454
|
|
|
439
455
|
// Build args consistently using the shared method, applying provider and model extra_args
|
|
440
456
|
const args = this.buildArgsForModel(model);
|
|
457
|
+
const env = this._resolveEnvForModel(model);
|
|
441
458
|
|
|
442
459
|
// Use stdin for prompt - safer than command args for arbitrary content
|
|
443
460
|
if (useShell) {
|
|
@@ -445,14 +462,16 @@ class CopilotProvider extends AIProvider {
|
|
|
445
462
|
command: `${copilotCmd} ${quoteShellArgs(args).join(' ')}`,
|
|
446
463
|
args: [],
|
|
447
464
|
useShell: true,
|
|
448
|
-
promptViaStdin: true
|
|
465
|
+
promptViaStdin: true,
|
|
466
|
+
env
|
|
449
467
|
};
|
|
450
468
|
}
|
|
451
469
|
return {
|
|
452
470
|
command: copilotCmd,
|
|
453
471
|
args,
|
|
454
472
|
useShell: false,
|
|
455
|
-
promptViaStdin: true
|
|
473
|
+
promptViaStdin: true,
|
|
474
|
+
env
|
|
456
475
|
};
|
|
457
476
|
}
|
|
458
477
|
|
|
@@ -772,6 +772,22 @@ class CursorAgentProvider extends AIProvider {
|
|
|
772
772
|
return [...baseArgs, ...providerArgs, ...modelArgs];
|
|
773
773
|
}
|
|
774
774
|
|
|
775
|
+
/**
|
|
776
|
+
* Resolve merged env (provider env + model env) for the given model.
|
|
777
|
+
* Same merge the constructor applies for the analysis model, so the
|
|
778
|
+
* extraction model (possibly a different fast-tier model) gets its own env.
|
|
779
|
+
*
|
|
780
|
+
* @param {string} model - The model identifier
|
|
781
|
+
* @returns {Object} Env vars to merge into the child environment
|
|
782
|
+
*/
|
|
783
|
+
_resolveEnvForModel(model) {
|
|
784
|
+
const modelConfig = this.configOverrides?.models?.find(m => m.id === model);
|
|
785
|
+
return {
|
|
786
|
+
...(this.configOverrides?.env || {}),
|
|
787
|
+
...(modelConfig?.env || {})
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
|
|
775
791
|
/**
|
|
776
792
|
* Get CLI configuration for LLM extraction
|
|
777
793
|
* @param {string} model - The model to use for extraction
|
|
@@ -785,6 +801,7 @@ class CursorAgentProvider extends AIProvider {
|
|
|
785
801
|
|
|
786
802
|
// Build args consistently using the shared method, applying provider and model extra_args
|
|
787
803
|
const args = this.buildArgsForModel(model);
|
|
804
|
+
const env = this._resolveEnvForModel(model);
|
|
788
805
|
|
|
789
806
|
// For extraction, we pass the prompt via stdin
|
|
790
807
|
if (useShell) {
|
|
@@ -792,14 +809,16 @@ class CursorAgentProvider extends AIProvider {
|
|
|
792
809
|
command: `${agentCmd} ${quoteShellArgs(args).join(' ')}`,
|
|
793
810
|
args: [],
|
|
794
811
|
useShell: true,
|
|
795
|
-
promptViaStdin: true
|
|
812
|
+
promptViaStdin: true,
|
|
813
|
+
env
|
|
796
814
|
};
|
|
797
815
|
}
|
|
798
816
|
return {
|
|
799
817
|
command: agentCmd,
|
|
800
818
|
args,
|
|
801
819
|
useShell: false,
|
|
802
|
-
promptViaStdin: true
|
|
820
|
+
promptViaStdin: true,
|
|
821
|
+
env
|
|
803
822
|
};
|
|
804
823
|
}
|
|
805
824
|
|
|
@@ -576,6 +576,22 @@ class OpenCodeProvider extends AIProvider {
|
|
|
576
576
|
return [...baseArgs, ...providerArgs, ...modelArgs];
|
|
577
577
|
}
|
|
578
578
|
|
|
579
|
+
/**
|
|
580
|
+
* Resolve merged env (provider env + model env) for the given model.
|
|
581
|
+
* Same merge the constructor applies for the analysis model, so the
|
|
582
|
+
* extraction model (possibly a different fast-tier model) gets its own env.
|
|
583
|
+
*
|
|
584
|
+
* @param {string} model - The model identifier
|
|
585
|
+
* @returns {Object} Env vars to merge into the child environment
|
|
586
|
+
*/
|
|
587
|
+
_resolveEnvForModel(model) {
|
|
588
|
+
const modelConfig = this.configOverrides?.models?.find(m => m.id === model);
|
|
589
|
+
return {
|
|
590
|
+
...(this.configOverrides?.env || {}),
|
|
591
|
+
...(modelConfig?.env || {})
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
|
|
579
595
|
/**
|
|
580
596
|
* Get CLI configuration for LLM extraction
|
|
581
597
|
* @param {string} model - The model to use for extraction
|
|
@@ -589,6 +605,7 @@ class OpenCodeProvider extends AIProvider {
|
|
|
589
605
|
|
|
590
606
|
// Build args consistently using the shared method, applying provider and model extra_args
|
|
591
607
|
const args = this.buildArgsForModel(model);
|
|
608
|
+
const env = this._resolveEnvForModel(model);
|
|
592
609
|
|
|
593
610
|
// For extraction, we pass the prompt via stdin
|
|
594
611
|
// OpenCode reads from stdin when no positional message arguments are provided
|
|
@@ -597,14 +614,16 @@ class OpenCodeProvider extends AIProvider {
|
|
|
597
614
|
command: `${opencodeCmd} ${quoteShellArgs(args).join(' ')}`,
|
|
598
615
|
args: [],
|
|
599
616
|
useShell: true,
|
|
600
|
-
promptViaStdin: true
|
|
617
|
+
promptViaStdin: true,
|
|
618
|
+
env
|
|
601
619
|
};
|
|
602
620
|
}
|
|
603
621
|
return {
|
|
604
622
|
command: opencodeCmd,
|
|
605
623
|
args,
|
|
606
624
|
useShell: false,
|
|
607
|
-
promptViaStdin: true
|
|
625
|
+
promptViaStdin: true,
|
|
626
|
+
env
|
|
608
627
|
};
|
|
609
628
|
}
|
|
610
629
|
|
|
@@ -69,6 +69,8 @@ curl -s http://localhost:{{PORT}}/api/reviews/{{REVIEW_ID}}/comments
|
|
|
69
69
|
|
|
70
70
|
Optional query param: \`includeDismissed=true\` to include soft-deleted (inactive) comments.
|
|
71
71
|
|
|
72
|
+
User comment \`status\` is lifecycle only: \`active\` or \`inactive\`. Each comment has \`publication: null\` (never posted) or \`{ state: "draft"|"posted", posted_at, review_url, comment_url, github_review_row_id, posting_count, changed }\`. Restoring a posted comment does not post it again. Local-mode comments have no publication.
|
|
73
|
+
|
|
72
74
|
**Response:** \`{ "success": true, "comments": [...] }\`
|
|
73
75
|
|
|
74
76
|
### Create a comment
|
|
@@ -123,6 +125,24 @@ curl -s -X PUT http://localhost:{{PORT}}/api/reviews/{{REVIEW_ID}}/comments/COMM
|
|
|
123
125
|
|
|
124
126
|
**Response:** \`{ "success": true, "message": "Comment updated successfully" }\`
|
|
125
127
|
|
|
128
|
+
### Update a posted comment on GitHub (PR mode only)
|
|
129
|
+
|
|
130
|
+
Editing a comment locally does not create another GitHub comment. If \`publication.changed\` is true, an explicit update sends the edited text to the existing host comment, including a comment in a pending draft review:
|
|
131
|
+
|
|
132
|
+
\`\`\`bash
|
|
133
|
+
curl -s -X POST http://localhost:{{PORT}}/api/reviews/{{REVIEW_ID}}/comments/COMMENT_ID/update-on-github
|
|
134
|
+
\`\`\`
|
|
135
|
+
|
|
136
|
+
**Response:** \`{ "success": true, "comment": {...} }\`. Failed updates return \`{ error, code, review_url? }\` (\`not_found_on_github\`, \`forbidden\`, or \`unresolved_identity\`) and never create a replacement. Missing identities are recovered only from exactly one strict match of the original sent text, author, and anchor. Dismissal remains local-only.
|
|
137
|
+
|
|
138
|
+
### Review history (PR mode only)
|
|
139
|
+
|
|
140
|
+
\`\`\`bash
|
|
141
|
+
curl -s http://localhost:{{PORT}}/api/reviews/{{REVIEW_ID}}/submissions
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
**Response:** \`{ "submissions": [{ ...review, "postings": [...] }] }\`, newest review first. Each posting retains the sent body, anchor, host link, current \`comment_status\`, and \`kind\` (\`post\` or \`update\`). Legacy duplicate review identities are grouped; backfilled snapshots are approximate.
|
|
145
|
+
|
|
126
146
|
### Delete a comment
|
|
127
147
|
|
|
128
148
|
> **Terminology note:** The UI refers to this operation as "dismiss." When a user asks to "dismiss a comment," use this DELETE endpoint.
|
|
@@ -143,9 +163,9 @@ curl -s -X PUT http://localhost:{{PORT}}/api/reviews/{{REVIEW_ID}}/comments/COMM
|
|
|
143
163
|
|
|
144
164
|
**Response:** \`{ "success": true, "message": "Comment restored successfully", "comment": {...} }\`
|
|
145
165
|
|
|
146
|
-
### Bulk delete
|
|
166
|
+
### Bulk delete pending comments
|
|
147
167
|
|
|
148
|
-
|
|
168
|
+
Dismisses all user comments not yet posted for a review. Posted comments are kept. Also dismisses any parent AI suggestions of the affected comments.
|
|
149
169
|
|
|
150
170
|
\`\`\`bash
|
|
151
171
|
curl -s -X DELETE http://localhost:{{PORT}}/api/reviews/{{REVIEW_ID}}/comments
|
package/src/config.js
CHANGED
|
@@ -12,11 +12,13 @@ const _stackWalkerOps = require('./github/operations/stack-walker');
|
|
|
12
12
|
const _pendingReviewOps = require('./github/operations/pending-review');
|
|
13
13
|
const _reviewLifecycleOps = require('./github/operations/review-lifecycle');
|
|
14
14
|
const _pendingReviewCommentsOps = require('./github/operations/pending-review-comments');
|
|
15
|
+
const _reviewCommentEditOps = require('./github/operations/review-comment-edit');
|
|
15
16
|
const IMPLEMENTATION_MATRIX = {
|
|
16
17
|
stack_walker: _stackWalkerOps.IMPLEMENTED_MODES,
|
|
17
18
|
pending_review_check: _pendingReviewOps.IMPLEMENTED_MODES,
|
|
18
19
|
review_lifecycle: _reviewLifecycleOps.IMPLEMENTED_MODES,
|
|
19
|
-
pending_review_comments: _pendingReviewCommentsOps.IMPLEMENTED_MODES
|
|
20
|
+
pending_review_comments: _pendingReviewCommentsOps.IMPLEMENTED_MODES,
|
|
21
|
+
review_comment_edit: _reviewCommentEditOps.IMPLEMENTED_MODES
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
// Recognised sub-keys that configure an implementation without selecting a
|
|
@@ -24,7 +26,9 @@ const IMPLEMENTATION_MATRIX = {
|
|
|
24
26
|
// explicitly keeps typos from being silently ignored.
|
|
25
27
|
const KNOWN_FEATURE_SUBKEYS = new Set([
|
|
26
28
|
'pending_review_comments_endpoint',
|
|
27
|
-
'pending_review_comments_batch'
|
|
29
|
+
'pending_review_comments_batch',
|
|
30
|
+
'review_comment_edit_endpoint',
|
|
31
|
+
'review_comment_edit_list_endpoint'
|
|
28
32
|
]);
|
|
29
33
|
|
|
30
34
|
let _cachedCommandToken = null;
|
|
@@ -41,13 +45,15 @@ const FEATURE_AREAS = [
|
|
|
41
45
|
'pending_review_check',
|
|
42
46
|
'stack_walker',
|
|
43
47
|
'review_lifecycle',
|
|
44
|
-
'pending_review_comments'
|
|
48
|
+
'pending_review_comments',
|
|
49
|
+
'review_comment_edit'
|
|
45
50
|
];
|
|
46
51
|
const GRAPHQL_DEFAULT_AREAS = new Set([
|
|
47
52
|
'pending_review_check',
|
|
48
53
|
'stack_walker',
|
|
49
54
|
'review_lifecycle',
|
|
50
|
-
'pending_review_comments'
|
|
55
|
+
'pending_review_comments',
|
|
56
|
+
'review_comment_edit'
|
|
51
57
|
]);
|
|
52
58
|
const ALLOWED_FEATURE_VALUES = new Set(['graphql', 'rest', 'host']);
|
|
53
59
|
|
|
@@ -1062,6 +1068,24 @@ function validateRepoConfig(config) {
|
|
|
1062
1068
|
}
|
|
1063
1069
|
}
|
|
1064
1070
|
|
|
1071
|
+
for (const [key, required] of [
|
|
1072
|
+
['review_comment_edit_endpoint', ['{owner}', '{repo}', '{comment_id}']],
|
|
1073
|
+
['review_comment_edit_list_endpoint', ['{owner}', '{repo}', '{pull_number}', '{review_id}']]
|
|
1074
|
+
]) {
|
|
1075
|
+
const value = features[key];
|
|
1076
|
+
if (value === undefined || value === null) continue;
|
|
1077
|
+
const prefix = `Invalid pair-review config: repos["${repoKey}"].features.${key}`;
|
|
1078
|
+
if (typeof value !== 'string' || !value) throw new Error(`${prefix} must be a non-empty string.`);
|
|
1079
|
+
if (resolvedFeatures.review_comment_edit !== 'host') throw new Error(`${prefix} is only valid when review_comment_edit = "host".`);
|
|
1080
|
+
if (!value.startsWith('/') || value.startsWith('//') || /[\\\\\r\n]/.test(value)) {
|
|
1081
|
+
throw new Error(`${prefix} must be a relative path starting with a single slash.`);
|
|
1082
|
+
}
|
|
1083
|
+
const missing = required.filter(placeholder => !value.includes(placeholder));
|
|
1084
|
+
if (missing.length) throw new Error(`${prefix} is missing required placeholder(s): ${missing.join(', ')}.`);
|
|
1085
|
+
const unknown = value.match(/\{[^}]+\}/g)?.filter(placeholder => !required.includes(placeholder)) || [];
|
|
1086
|
+
if (unknown.length) throw new Error(`${prefix} has unknown placeholder(s): ${unknown.join(', ')}.`);
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1065
1089
|
// Some hosts expose the pending-review endpoint but accept one comment
|
|
1066
1090
|
// per POST instead of the generic batch envelope. Batch mode remains the
|
|
1067
1091
|
// default to preserve the documented host-extension contract.
|