@in-the-loop-labs/pair-review 3.0.6 → 3.1.0
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/package.json +2 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/skills/analyze/references/level1-balanced.md +8 -0
- package/plugin-code-critic/skills/analyze/references/level1-fast.md +7 -0
- package/plugin-code-critic/skills/analyze/references/level1-thorough.md +8 -0
- package/plugin-code-critic/skills/analyze/references/level2-balanced.md +9 -0
- package/plugin-code-critic/skills/analyze/references/level2-fast.md +8 -0
- package/plugin-code-critic/skills/analyze/references/level2-thorough.md +9 -0
- package/plugin-code-critic/skills/analyze/references/level3-balanced.md +9 -0
- package/plugin-code-critic/skills/analyze/references/level3-fast.md +8 -0
- package/plugin-code-critic/skills/analyze/references/level3-thorough.md +9 -0
- package/plugin-code-critic/skills/analyze/references/orchestration-balanced.md +9 -0
- package/plugin-code-critic/skills/analyze/references/orchestration-fast.md +5 -0
- package/plugin-code-critic/skills/analyze/references/orchestration-thorough.md +9 -0
- package/public/css/analysis-config.css +83 -0
- package/public/css/pr.css +191 -4
- package/public/index.html +20 -0
- package/public/js/components/AIPanel.js +1 -1
- package/public/js/components/AdvancedConfigTab.js +83 -8
- package/public/js/components/AnalysisConfigModal.js +155 -5
- package/public/js/components/ChatPanel.js +22 -5
- package/public/js/components/CouncilProgressModal.js +239 -22
- package/public/js/components/TimeoutSelect.js +2 -0
- package/public/js/components/VoiceCentricConfigTab.js +179 -12
- package/public/js/index.js +119 -1
- package/public/js/local.js +141 -47
- package/public/js/modules/suggestion-manager.js +2 -1
- package/public/js/pr.js +71 -12
- package/public/js/repo-settings.js +2 -2
- package/public/local.html +32 -11
- package/public/pr.html +2 -0
- package/src/ai/analyzer.js +371 -111
- package/src/ai/claude-provider.js +2 -0
- package/src/ai/codex-provider.js +1 -1
- package/src/ai/copilot-provider.js +2 -0
- package/src/ai/executable-provider.js +534 -0
- package/src/ai/gemini-provider.js +2 -0
- package/src/ai/index.js +9 -1
- package/src/ai/pi-provider.js +10 -8
- package/src/ai/prompts/baseline/consolidation/balanced.js +54 -2
- package/src/ai/prompts/baseline/consolidation/fast.js +31 -1
- package/src/ai/prompts/baseline/consolidation/thorough.js +46 -3
- package/src/ai/prompts/baseline/level1/balanced.js +12 -0
- package/src/ai/prompts/baseline/level1/fast.js +11 -0
- package/src/ai/prompts/baseline/level1/thorough.js +12 -0
- package/src/ai/prompts/baseline/level2/balanced.js +13 -0
- package/src/ai/prompts/baseline/level2/fast.js +12 -0
- package/src/ai/prompts/baseline/level2/thorough.js +13 -0
- package/src/ai/prompts/baseline/level3/balanced.js +13 -0
- package/src/ai/prompts/baseline/level3/fast.js +12 -0
- package/src/ai/prompts/baseline/level3/thorough.js +13 -0
- package/src/ai/prompts/baseline/orchestration/balanced.js +15 -0
- package/src/ai/prompts/baseline/orchestration/fast.js +11 -0
- package/src/ai/prompts/baseline/orchestration/thorough.js +15 -0
- package/src/ai/prompts/render-for-skill.js +3 -0
- package/src/ai/prompts/shared/output-schema.js +8 -0
- package/src/ai/provider.js +89 -4
- package/src/chat/prompt-builder.js +17 -1
- package/src/chat/session-manager.js +32 -28
- package/src/config.js +15 -2
- package/src/database.js +59 -15
- package/src/git/base-branch.js +113 -29
- package/src/local-review.js +15 -9
- package/src/main.js +3 -2
- package/src/routes/analyses.js +34 -8
- package/src/routes/chat.js +15 -8
- package/src/routes/config.js +3 -120
- package/src/routes/councils.js +15 -6
- package/src/routes/executable-analysis.js +494 -0
- package/src/routes/local.js +152 -15
- package/src/routes/mcp.js +9 -4
- package/src/routes/pr.js +166 -29
- package/src/routes/reviews.js +31 -5
- package/src/routes/shared.js +72 -5
- package/src/routes/worktrees.js +4 -2
- package/src/utils/comment-formatter.js +28 -11
- package/src/utils/instructions.js +22 -8
- package/src/utils/logger.js +20 -10
|
@@ -6,24 +6,38 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Merge repository and request instructions with XML-like tags for AI clarity
|
|
9
|
+
* Merge global, repository, and request instructions with XML-like tags for AI clarity.
|
|
10
10
|
* Server is the single source of truth for how instructions are merged.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
12
|
+
* Precedence (lowest → highest): global → repo → custom/request
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} instructions - Instructions to merge
|
|
15
|
+
* @param {string|null} [instructions.globalInstructions] - Global instructions from ~/.pair-review/global-instructions.md
|
|
16
|
+
* @param {string|null} [instructions.repoInstructions] - Default instructions from repository settings
|
|
17
|
+
* @param {string|null} [instructions.requestInstructions] - Custom instructions from the analysis request
|
|
18
|
+
* @returns {string|null} Merged instructions with XML tags, or null if all inputs are empty
|
|
15
19
|
*/
|
|
16
|
-
function mergeInstructions(repoInstructions, requestInstructions) {
|
|
17
|
-
if (!repoInstructions && !requestInstructions) {
|
|
20
|
+
function mergeInstructions({ globalInstructions, repoInstructions, requestInstructions } = {}) {
|
|
21
|
+
if (!globalInstructions && !repoInstructions && !requestInstructions) {
|
|
18
22
|
return null;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
const parts = [];
|
|
26
|
+
if (globalInstructions) {
|
|
27
|
+
parts.push(`These are global instructions that apply to all reviews:\n<global_instructions>\n${globalInstructions}\n</global_instructions>`);
|
|
28
|
+
}
|
|
22
29
|
if (repoInstructions) {
|
|
23
|
-
|
|
30
|
+
const repoPrecedence = globalInstructions
|
|
31
|
+
? ' They take precedence over global_instructions in areas where they overlap or conflict:'
|
|
32
|
+
: '';
|
|
33
|
+
parts.push(`These are default instructions for this repository.${repoPrecedence}\n<repo_instructions>\n${repoInstructions}\n</repo_instructions>`);
|
|
24
34
|
}
|
|
25
35
|
if (requestInstructions) {
|
|
26
|
-
|
|
36
|
+
const overrides = [repoInstructions && 'repo_instructions', globalInstructions && 'global_instructions'].filter(Boolean);
|
|
37
|
+
const customPrecedence = overrides.length
|
|
38
|
+
? ` They take precedence over ${overrides.join(' and ')} in areas where they overlap or conflict:`
|
|
39
|
+
: '';
|
|
40
|
+
parts.push(`These are custom instructions for this analysis run.${customPrecedence}\n<custom_instructions>\n${requestInstructions}\n</custom_instructions>`);
|
|
27
41
|
}
|
|
28
42
|
return parts.join('\n\n');
|
|
29
43
|
}
|
package/src/utils/logger.js
CHANGED
|
@@ -129,28 +129,38 @@ class AILogger {
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* Log AI analysis error
|
|
132
|
+
* @param {string} message - Error message
|
|
133
|
+
* @param {Error} [error] - Optional error object to include
|
|
132
134
|
*/
|
|
133
|
-
error(message) {
|
|
135
|
+
error(message, error) {
|
|
134
136
|
if (!this.enabled) return;
|
|
135
137
|
const timestamp = new Date().toISOString().split('T')[1].split('.')[0];
|
|
136
|
-
|
|
137
|
-
`${COLORS.cyan}[${timestamp}]${COLORS.reset} ` +
|
|
138
|
+
let output = `${COLORS.cyan}[${timestamp}]${COLORS.reset} ` +
|
|
138
139
|
`${COLORS.bright}${COLORS.red}[AI ✗]${COLORS.reset} ` +
|
|
139
|
-
`${COLORS.red}${message}${COLORS.reset}
|
|
140
|
-
)
|
|
140
|
+
`${COLORS.red}${message}${COLORS.reset}`;
|
|
141
|
+
if (error) {
|
|
142
|
+
const errorMsg = error.message || String(error);
|
|
143
|
+
output += ` ${COLORS.red}${errorMsg}${COLORS.reset}`;
|
|
144
|
+
}
|
|
145
|
+
process.stderr.write(output + '\n');
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
/**
|
|
144
149
|
* Log AI analysis warning
|
|
150
|
+
* @param {string} message - Warning message
|
|
151
|
+
* @param {Error} [error] - Optional error object to include
|
|
145
152
|
*/
|
|
146
|
-
warn(message) {
|
|
153
|
+
warn(message, error) {
|
|
147
154
|
if (!this.enabled) return;
|
|
148
155
|
const timestamp = new Date().toISOString().split('T')[1].split('.')[0];
|
|
149
|
-
|
|
150
|
-
`${COLORS.cyan}[${timestamp}]${COLORS.reset} ` +
|
|
156
|
+
let output = `${COLORS.cyan}[${timestamp}]${COLORS.reset} ` +
|
|
151
157
|
`${COLORS.bright}${COLORS.yellow}[AI ⚠]${COLORS.reset} ` +
|
|
152
|
-
`${COLORS.yellow}${message}${COLORS.reset}
|
|
153
|
-
)
|
|
158
|
+
`${COLORS.yellow}${message}${COLORS.reset}`;
|
|
159
|
+
if (error) {
|
|
160
|
+
const errorMsg = error.message || String(error);
|
|
161
|
+
output += ` ${COLORS.yellow}${errorMsg}${COLORS.reset}`;
|
|
162
|
+
}
|
|
163
|
+
this._stdout.write(output + '\n');
|
|
154
164
|
}
|
|
155
165
|
|
|
156
166
|
/**
|