git-reviewer 2.14.1 → 2.16.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/README.md +122 -4
- package/bin/reviewer.js +286 -7
- package/lib/agent.js +25 -5
- package/lib/answerer.js +191 -0
- package/lib/changes.js +83 -4
- package/lib/channel.js +286 -0
- package/lib/claude-background.js +316 -0
- package/lib/claude-command.js +90 -0
- package/lib/claude-sessions.js +229 -0
- package/lib/cli.js +197 -20
- package/lib/comments.js +175 -10
- package/lib/export.js +2 -2
- package/lib/presence.js +223 -0
- package/lib/review.js +3 -1
- package/lib/sessions.js +8 -4
- package/lib/store.js +290 -7
- package/lib/threads.js +180 -0
- package/lib/watch.js +131 -0
- package/man/git-reviewer.1 +58 -0
- package/package.json +1 -1
- package/public/app.js +811 -119
- package/public/index.html +33 -0
- package/public/style.css +277 -0
- package/server.js +338 -43
package/public/index.html
CHANGED
|
@@ -19,6 +19,12 @@
|
|
|
19
19
|
<span id="repoButtonLabel">Open a repository</span>
|
|
20
20
|
</button>
|
|
21
21
|
|
|
22
|
+
<button id="agentButton" class="agent-button hidden" onclick="openAgentDialog()"
|
|
23
|
+
title="Have the Claude Code session that wrote this code answer your comments">
|
|
24
|
+
<span class="agent-dot" aria-hidden="true"></span>
|
|
25
|
+
<span id="agentButtonLabel">Ask Claude Code</span>
|
|
26
|
+
</button>
|
|
27
|
+
|
|
22
28
|
<button id="helpButton" class="icon-button" onclick="openHelp()"
|
|
23
29
|
title="How to review" aria-label="How to review">
|
|
24
30
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
@@ -202,6 +208,33 @@
|
|
|
202
208
|
</div>
|
|
203
209
|
</div>
|
|
204
210
|
|
|
211
|
+
<!-- Connecting a Claude Code session to answer comments in their threads. -->
|
|
212
|
+
<div id="agentModal" class="help-modal hidden" onclick="if (event.target.id === 'agentModal') closeAgentDialog()">
|
|
213
|
+
<div class="help-card agent-card" role="dialog" aria-modal="true" aria-labelledby="agentTitle">
|
|
214
|
+
<div class="help-head">
|
|
215
|
+
<h2 id="agentTitle">Ask the session that wrote this code</h2>
|
|
216
|
+
<button class="icon-button" onclick="closeAgentDialog()" aria-label="Close">
|
|
217
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
218
|
+
<path d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path>
|
|
219
|
+
</svg>
|
|
220
|
+
</button>
|
|
221
|
+
</div>
|
|
222
|
+
<div class="agent-body">
|
|
223
|
+
<div id="agentConnected" class="agent-connected hidden"></div>
|
|
224
|
+
<p class="agent-intro">Pick the Claude Code session that worked on this repository. Every comment you
|
|
225
|
+
write, and every reply you add, goes to it, and its answer appears in the thread as it is written.</p>
|
|
226
|
+
<div id="agentSessions" class="agent-sessions"></div>
|
|
227
|
+
<label class="agent-fork">
|
|
228
|
+
<input type="checkbox" id="agentFork" checked>
|
|
229
|
+
Answer in a copy of the session, so the original stays exactly as it was
|
|
230
|
+
</label>
|
|
231
|
+
<p class="agent-note">In the background the session can read the repository and nothing else.
|
|
232
|
+
To have it answer live in your terminal instead, copy its command and run it there:
|
|
233
|
+
your session, your permissions, and every comment arrives as it is written.</p>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
205
238
|
<aside id="sidebar" class="sidebar hidden">
|
|
206
239
|
<!-- The commits a review is made of, when it is made of commits. Click
|
|
207
240
|
one to review it on its own; shift-click a second to review the run
|
package/public/style.css
CHANGED
|
@@ -211,6 +211,12 @@ button:disabled {
|
|
|
211
211
|
flex-shrink: 0;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
.file-fold-count {
|
|
215
|
+
flex-shrink: 0;
|
|
216
|
+
font-size: 11px;
|
|
217
|
+
color: #6a737d;
|
|
218
|
+
}
|
|
219
|
+
|
|
214
220
|
.file-status-added {
|
|
215
221
|
background: #28a745;
|
|
216
222
|
color: white;
|
|
@@ -645,6 +651,13 @@ button:disabled {
|
|
|
645
651
|
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
646
652
|
}
|
|
647
653
|
|
|
654
|
+
/* The box keeps its right edge clear for the action buttons, which sit at
|
|
655
|
+
the top. A thread starts below them, so it can have the full width --
|
|
656
|
+
which an answer of a few paragraphs needs. */
|
|
657
|
+
.comment-box .comment-followups {
|
|
658
|
+
margin-right: -194px;
|
|
659
|
+
}
|
|
660
|
+
|
|
648
661
|
.comment-followup-item {
|
|
649
662
|
margin-bottom: 8px;
|
|
650
663
|
padding: 8px 12px;
|
|
@@ -2216,3 +2229,267 @@ button:disabled {
|
|
|
2216
2229
|
max-height: 8.5em;
|
|
2217
2230
|
overflow-y: auto;
|
|
2218
2231
|
}
|
|
2232
|
+
|
|
2233
|
+
/* Agents answering in threads
|
|
2234
|
+
*
|
|
2235
|
+
* An answer from the session that wrote the code sits in the thread like any
|
|
2236
|
+
* reply, marked with who wrote it so it is never mistaken for the reviewer's
|
|
2237
|
+
* own note. The orange is the same family Claude Code uses for itself.
|
|
2238
|
+
*/
|
|
2239
|
+
.agent-button {
|
|
2240
|
+
display: flex;
|
|
2241
|
+
align-items: center;
|
|
2242
|
+
gap: 8px;
|
|
2243
|
+
padding: 7px 12px;
|
|
2244
|
+
border: 1px solid #d1d5da;
|
|
2245
|
+
border-radius: 6px;
|
|
2246
|
+
background: white;
|
|
2247
|
+
font: inherit;
|
|
2248
|
+
font-size: 13px;
|
|
2249
|
+
font-weight: 500;
|
|
2250
|
+
color: #24292e;
|
|
2251
|
+
cursor: pointer;
|
|
2252
|
+
white-space: nowrap;
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
.agent-button:hover {
|
|
2256
|
+
background: #f6f8fa;
|
|
2257
|
+
border-color: #c6cbd1;
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
.agent-dot {
|
|
2261
|
+
flex: none;
|
|
2262
|
+
width: 8px;
|
|
2263
|
+
height: 8px;
|
|
2264
|
+
border-radius: 50%;
|
|
2265
|
+
background: #c9ced6;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
.agent-button.connected .agent-dot,
|
|
2269
|
+
.agent-connection .agent-dot {
|
|
2270
|
+
background: #2da44e;
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
.agent-button.working .agent-dot {
|
|
2274
|
+
background: #d97757;
|
|
2275
|
+
animation: agent-pulse 1.2s ease-in-out infinite;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
@keyframes agent-pulse {
|
|
2279
|
+
0%, 100% { opacity: 1; }
|
|
2280
|
+
50% { opacity: 0.35; }
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2284
|
+
.agent-button.working .agent-dot { animation: none; }
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
.comment-followup-item.followup-agent {
|
|
2288
|
+
border-left-color: #d97757;
|
|
2289
|
+
background: rgba(217, 119, 87, 0.08);
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
.followup-author {
|
|
2293
|
+
display: block;
|
|
2294
|
+
margin-bottom: 4px;
|
|
2295
|
+
font-size: 11px;
|
|
2296
|
+
font-weight: 600;
|
|
2297
|
+
color: #b0532e;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
.followup-markdown code {
|
|
2301
|
+
padding: 1px 4px;
|
|
2302
|
+
border-radius: 3px;
|
|
2303
|
+
background: rgba(27, 31, 35, 0.07);
|
|
2304
|
+
font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
|
|
2305
|
+
font-size: 11.5px;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
.followup-code {
|
|
2309
|
+
margin: 6px 0;
|
|
2310
|
+
padding: 8px 10px;
|
|
2311
|
+
border-radius: 4px;
|
|
2312
|
+
background: rgba(27, 31, 35, 0.06);
|
|
2313
|
+
overflow-x: auto;
|
|
2314
|
+
white-space: pre;
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2317
|
+
.followup-code code {
|
|
2318
|
+
padding: 0;
|
|
2319
|
+
background: none;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
.agent-typing {
|
|
2323
|
+
color: #8a6d5f;
|
|
2324
|
+
font-style: italic;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
.followup-queued {
|
|
2328
|
+
margin-top: 4px;
|
|
2329
|
+
font-size: 11px;
|
|
2330
|
+
color: #8a6d5f;
|
|
2331
|
+
font-style: italic;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
.comment-item-thread {
|
|
2335
|
+
margin-top: 4px;
|
|
2336
|
+
font-size: 11px;
|
|
2337
|
+
color: #6a737d;
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
.comment-item-answering {
|
|
2341
|
+
color: #b0532e;
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
.agent-card {
|
|
2345
|
+
max-width: 640px;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
.agent-body {
|
|
2349
|
+
padding: 18px 22px 22px;
|
|
2350
|
+
overflow-y: auto;
|
|
2351
|
+
font-size: 13px;
|
|
2352
|
+
color: #24292e;
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
.agent-intro,
|
|
2356
|
+
.agent-note {
|
|
2357
|
+
line-height: 1.5;
|
|
2358
|
+
color: #57606a;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
.agent-note {
|
|
2362
|
+
margin-top: 12px;
|
|
2363
|
+
font-size: 12px;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
.agent-sessions {
|
|
2367
|
+
display: flex;
|
|
2368
|
+
flex-direction: column;
|
|
2369
|
+
gap: 8px;
|
|
2370
|
+
margin: 14px 0;
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
.agent-session {
|
|
2374
|
+
display: flex;
|
|
2375
|
+
align-items: center;
|
|
2376
|
+
gap: 12px;
|
|
2377
|
+
padding: 10px 12px;
|
|
2378
|
+
border: 1px solid #e1e4e8;
|
|
2379
|
+
border-radius: 6px;
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
.agent-session-copy {
|
|
2383
|
+
opacity: 0.75;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
.agent-session-text {
|
|
2387
|
+
flex: 1;
|
|
2388
|
+
min-width: 0;
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
.agent-session-title {
|
|
2392
|
+
font-weight: 500;
|
|
2393
|
+
overflow: hidden;
|
|
2394
|
+
display: -webkit-box;
|
|
2395
|
+
-webkit-line-clamp: 2;
|
|
2396
|
+
-webkit-box-orient: vertical;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
.agent-session-meta,
|
|
2400
|
+
.agent-connection-meta {
|
|
2401
|
+
margin-top: 2px;
|
|
2402
|
+
font-size: 11.5px;
|
|
2403
|
+
color: #6a737d;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
.agent-session-actions {
|
|
2407
|
+
display: flex;
|
|
2408
|
+
flex-direction: column;
|
|
2409
|
+
gap: 6px;
|
|
2410
|
+
flex: none;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
.agent-connect,
|
|
2414
|
+
.agent-copy,
|
|
2415
|
+
.agent-disconnect {
|
|
2416
|
+
padding: 5px 10px;
|
|
2417
|
+
border-radius: 6px;
|
|
2418
|
+
font: inherit;
|
|
2419
|
+
font-size: 12px;
|
|
2420
|
+
cursor: pointer;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
.agent-connect {
|
|
2424
|
+
border: none;
|
|
2425
|
+
background: #d97757;
|
|
2426
|
+
color: white;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
.agent-connect:hover {
|
|
2430
|
+
background: #c4643f;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
.agent-copy,
|
|
2434
|
+
.agent-disconnect {
|
|
2435
|
+
border: 1px solid #d1d5da;
|
|
2436
|
+
background: white;
|
|
2437
|
+
color: #24292e;
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
.agent-copy:hover,
|
|
2441
|
+
.agent-disconnect:hover {
|
|
2442
|
+
background: #f6f8fa;
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
.agent-connected {
|
|
2446
|
+
display: flex;
|
|
2447
|
+
flex-direction: column;
|
|
2448
|
+
gap: 8px;
|
|
2449
|
+
margin-bottom: 14px;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
.agent-connection {
|
|
2453
|
+
display: flex;
|
|
2454
|
+
align-items: flex-start;
|
|
2455
|
+
gap: 10px;
|
|
2456
|
+
padding: 10px 12px;
|
|
2457
|
+
border-radius: 6px;
|
|
2458
|
+
background: #f0faf3;
|
|
2459
|
+
border: 1px solid #c8e6d0;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
.agent-connection .agent-dot {
|
|
2463
|
+
margin-top: 5px;
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
.agent-connection > div {
|
|
2467
|
+
flex: 1;
|
|
2468
|
+
min-width: 0;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
.agent-connection-title {
|
|
2472
|
+
margin-top: 2px;
|
|
2473
|
+
overflow: hidden;
|
|
2474
|
+
text-overflow: ellipsis;
|
|
2475
|
+
white-space: nowrap;
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
.agent-fork {
|
|
2479
|
+
display: flex;
|
|
2480
|
+
align-items: center;
|
|
2481
|
+
gap: 8px;
|
|
2482
|
+
font-size: 12.5px;
|
|
2483
|
+
color: #24292e;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
.agent-empty {
|
|
2487
|
+
padding: 12px 0;
|
|
2488
|
+
color: #6a737d;
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
@media (max-width: 640px) {
|
|
2492
|
+
.agent-session { flex-direction: column; align-items: stretch; }
|
|
2493
|
+
.agent-session-actions { flex-direction: row; }
|
|
2494
|
+
.agent-button { padding: 7px 9px; }
|
|
2495
|
+
}
|