agent-reviews 0.5.0 → 0.5.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-reviews",
|
|
3
3
|
"description": "Manage GitHub PR review comments from Claude Code. Automatically triage, fix, and respond to bot findings.",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Paul Bakaus",
|
|
7
7
|
"url": "https://github.com/pbakaus"
|
package/lib/comments.js
CHANGED
|
@@ -130,6 +130,40 @@ function isBot(username) {
|
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// Body cleanup
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Strip bot boilerplate from comment bodies:
|
|
139
|
+
* - HTML comments (<!-- ... -->)
|
|
140
|
+
* - Cursor "Fix in Cursor" / "Fix in Web" button blocks
|
|
141
|
+
* - "Additional Locations" <details> blocks
|
|
142
|
+
* - Collapse leftover blank lines
|
|
143
|
+
*/
|
|
144
|
+
function cleanBody(body) {
|
|
145
|
+
if (!body) return body;
|
|
146
|
+
|
|
147
|
+
let cleaned = body;
|
|
148
|
+
|
|
149
|
+
// Remove HTML comments (single and multi-line)
|
|
150
|
+
cleaned = cleaned.replace(/<!--[\s\S]*?-->/g, "");
|
|
151
|
+
|
|
152
|
+
// Remove <details> blocks containing "Additional Locations"
|
|
153
|
+
cleaned = cleaned.replace(
|
|
154
|
+
/<details>\s*<summary>\s*Additional Locations[\s\S]*?<\/details>/gi,
|
|
155
|
+
""
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// Remove <p> blocks containing cursor.com links
|
|
159
|
+
cleaned = cleaned.replace(/<p>\s*<a [^>]*cursor\.com[\s\S]*?<\/p>/gi, "");
|
|
160
|
+
|
|
161
|
+
// Collapse runs of 3+ newlines into 2
|
|
162
|
+
cleaned = cleaned.replace(/\n{3,}/g, "\n\n");
|
|
163
|
+
|
|
164
|
+
return cleaned.trim();
|
|
165
|
+
}
|
|
166
|
+
|
|
133
167
|
// ---------------------------------------------------------------------------
|
|
134
168
|
// Processing
|
|
135
169
|
// ---------------------------------------------------------------------------
|
|
@@ -148,7 +182,7 @@ function processComments(data, options = {}) {
|
|
|
148
182
|
repliesMap.get(comment.in_reply_to_id).push({
|
|
149
183
|
id: comment.id,
|
|
150
184
|
user: comment.user?.login,
|
|
151
|
-
body: comment.body,
|
|
185
|
+
body: cleanBody(comment.body),
|
|
152
186
|
createdAt: comment.created_at,
|
|
153
187
|
isBot: isBot(comment.user?.login),
|
|
154
188
|
});
|
|
@@ -174,7 +208,7 @@ function processComments(data, options = {}) {
|
|
|
174
208
|
path: comment.path,
|
|
175
209
|
line: comment.line || comment.original_line,
|
|
176
210
|
diffHunk: comment.diff_hunk || null,
|
|
177
|
-
body: comment.body,
|
|
211
|
+
body: cleanBody(comment.body),
|
|
178
212
|
createdAt: comment.created_at,
|
|
179
213
|
updatedAt: comment.updated_at,
|
|
180
214
|
url: comment.html_url,
|
|
@@ -197,7 +231,7 @@ function processComments(data, options = {}) {
|
|
|
197
231
|
path: null,
|
|
198
232
|
line: null,
|
|
199
233
|
diffHunk: null,
|
|
200
|
-
body: comment.body,
|
|
234
|
+
body: cleanBody(comment.body),
|
|
201
235
|
createdAt: comment.created_at,
|
|
202
236
|
updatedAt: comment.updated_at,
|
|
203
237
|
url: comment.html_url,
|
|
@@ -221,7 +255,7 @@ function processComments(data, options = {}) {
|
|
|
221
255
|
path: null,
|
|
222
256
|
line: null,
|
|
223
257
|
diffHunk: null,
|
|
224
|
-
body: review.body,
|
|
258
|
+
body: cleanBody(review.body),
|
|
225
259
|
state: review.state,
|
|
226
260
|
createdAt: review.submitted_at,
|
|
227
261
|
updatedAt: review.submitted_at,
|
|
@@ -330,5 +364,6 @@ module.exports = {
|
|
|
330
364
|
replyToComment,
|
|
331
365
|
isBot,
|
|
332
366
|
isMetaComment,
|
|
367
|
+
cleanBody,
|
|
333
368
|
DEFAULT_META_FILTERS,
|
|
334
369
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-reviews",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "CLI and Claude Code skill for managing GitHub PR review comments. List, filter, reply, and watch for bot findings.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Paul Bakaus",
|
|
@@ -28,9 +28,14 @@
|
|
|
28
28
|
".claude-plugin/"
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build:skill": "node scripts/build-skill.js"
|
|
31
|
+
"build:skill": "node scripts/build-skill.js",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest"
|
|
32
34
|
},
|
|
33
35
|
"engines": {
|
|
34
36
|
"node": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"vitest": "^4.0.18"
|
|
35
40
|
}
|
|
36
41
|
}
|
|
@@ -130,6 +130,40 @@ function isBot(username) {
|
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// Body cleanup
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Strip bot boilerplate from comment bodies:
|
|
139
|
+
* - HTML comments (<!-- ... -->)
|
|
140
|
+
* - Cursor "Fix in Cursor" / "Fix in Web" button blocks
|
|
141
|
+
* - "Additional Locations" <details> blocks
|
|
142
|
+
* - Collapse leftover blank lines
|
|
143
|
+
*/
|
|
144
|
+
function cleanBody(body) {
|
|
145
|
+
if (!body) return body;
|
|
146
|
+
|
|
147
|
+
let cleaned = body;
|
|
148
|
+
|
|
149
|
+
// Remove HTML comments (single and multi-line)
|
|
150
|
+
cleaned = cleaned.replace(/<!--[\s\S]*?-->/g, "");
|
|
151
|
+
|
|
152
|
+
// Remove <details> blocks containing "Additional Locations"
|
|
153
|
+
cleaned = cleaned.replace(
|
|
154
|
+
/<details>\s*<summary>\s*Additional Locations[\s\S]*?<\/details>/gi,
|
|
155
|
+
""
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// Remove <p> blocks containing cursor.com links
|
|
159
|
+
cleaned = cleaned.replace(/<p>\s*<a [^>]*cursor\.com[\s\S]*?<\/p>/gi, "");
|
|
160
|
+
|
|
161
|
+
// Collapse runs of 3+ newlines into 2
|
|
162
|
+
cleaned = cleaned.replace(/\n{3,}/g, "\n\n");
|
|
163
|
+
|
|
164
|
+
return cleaned.trim();
|
|
165
|
+
}
|
|
166
|
+
|
|
133
167
|
// ---------------------------------------------------------------------------
|
|
134
168
|
// Processing
|
|
135
169
|
// ---------------------------------------------------------------------------
|
|
@@ -148,7 +182,7 @@ function processComments(data, options = {}) {
|
|
|
148
182
|
repliesMap.get(comment.in_reply_to_id).push({
|
|
149
183
|
id: comment.id,
|
|
150
184
|
user: comment.user?.login,
|
|
151
|
-
body: comment.body,
|
|
185
|
+
body: cleanBody(comment.body),
|
|
152
186
|
createdAt: comment.created_at,
|
|
153
187
|
isBot: isBot(comment.user?.login),
|
|
154
188
|
});
|
|
@@ -174,7 +208,7 @@ function processComments(data, options = {}) {
|
|
|
174
208
|
path: comment.path,
|
|
175
209
|
line: comment.line || comment.original_line,
|
|
176
210
|
diffHunk: comment.diff_hunk || null,
|
|
177
|
-
body: comment.body,
|
|
211
|
+
body: cleanBody(comment.body),
|
|
178
212
|
createdAt: comment.created_at,
|
|
179
213
|
updatedAt: comment.updated_at,
|
|
180
214
|
url: comment.html_url,
|
|
@@ -197,7 +231,7 @@ function processComments(data, options = {}) {
|
|
|
197
231
|
path: null,
|
|
198
232
|
line: null,
|
|
199
233
|
diffHunk: null,
|
|
200
|
-
body: comment.body,
|
|
234
|
+
body: cleanBody(comment.body),
|
|
201
235
|
createdAt: comment.created_at,
|
|
202
236
|
updatedAt: comment.updated_at,
|
|
203
237
|
url: comment.html_url,
|
|
@@ -221,7 +255,7 @@ function processComments(data, options = {}) {
|
|
|
221
255
|
path: null,
|
|
222
256
|
line: null,
|
|
223
257
|
diffHunk: null,
|
|
224
|
-
body: review.body,
|
|
258
|
+
body: cleanBody(review.body),
|
|
225
259
|
state: review.state,
|
|
226
260
|
createdAt: review.submitted_at,
|
|
227
261
|
updatedAt: review.submitted_at,
|
|
@@ -330,5 +364,6 @@ module.exports = {
|
|
|
330
364
|
replyToComment,
|
|
331
365
|
isBot,
|
|
332
366
|
isMetaComment,
|
|
367
|
+
cleanBody,
|
|
333
368
|
DEFAULT_META_FILTERS,
|
|
334
369
|
};
|