@eliya-oss/agent-diff 0.1.0-alpha.81 → 0.1.0-alpha.83
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/CHANGELOG.md +12 -0
- package/dist/main.js +241 -38
- package/package.json +1 -1
- package/skills/adiff/SKILL.md +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.83
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- A thread is redrawn when an answer or a reply lands in it, rather than staying as it was until the branch is read again. A thread the reviewer wrote back to now says it is with the agent instead of claiming it was answered.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-alpha.82
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- A reviewer can write back to an answer. Press `R` on a thread, in the diff or in the review panel, and the reply continues that thread rather than opening a second one about the same line. It reaches the agent through `comment take` like any other comment, carrying the conversation so far, and `adiff comment reply --to <id>` does the same from the command line.
|
|
14
|
+
|
|
3
15
|
## 0.1.0-alpha.81
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -8709,7 +8709,8 @@ var init_schema = __esmMin((() => {
|
|
|
8709
8709
|
StoredComment = Struct({
|
|
8710
8710
|
id: String$1,
|
|
8711
8711
|
anchor: Anchor,
|
|
8712
|
-
body: String$1
|
|
8712
|
+
body: String$1,
|
|
8713
|
+
replyTo: optionalKey(String$1)
|
|
8713
8714
|
});
|
|
8714
8715
|
StoredAnswer = Struct({
|
|
8715
8716
|
comment: String$1,
|
|
@@ -9107,7 +9108,7 @@ var init_error$1 = __esmMin((() => {
|
|
|
9107
9108
|
}));
|
|
9108
9109
|
//#endregion
|
|
9109
9110
|
//#region src/cli/commands.ts
|
|
9110
|
-
var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, AT_ONCE, summaryOf, summaryFor, listBranches, blobOf, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, sentOf, sentIn, listSent, submitComment, listPatches, flatten, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, saveWrap, saveSticky, setBase, clearBase, markRead;
|
|
9111
|
+
var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, AT_ONCE, summaryOf, summaryFor, listBranches, blobOf, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, sentIn, listSent, submitComment, without$1, submitReply, listPatches, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, saveWrap, saveSticky, setBase, clearBase, markRead;
|
|
9111
9112
|
var init_commands = __esmMin((() => {
|
|
9112
9113
|
init_dist();
|
|
9113
9114
|
init_patch();
|
|
@@ -9292,9 +9293,25 @@ var init_commands = __esmMin((() => {
|
|
|
9292
9293
|
return yield* progressIn(yield* readingOf(repo, branch, base));
|
|
9293
9294
|
});
|
|
9294
9295
|
bodyOf = (entry) => entry.body;
|
|
9295
|
-
|
|
9296
|
+
saidTo = (spoken, id) => spoken.filter((entry) => entry.comment === id).length;
|
|
9297
|
+
spunOf = (replies, said) => [...replies.map((reply) => ({
|
|
9298
|
+
voice: "reviewer",
|
|
9299
|
+
body: reply.body,
|
|
9300
|
+
at: reply.at,
|
|
9301
|
+
asks: false
|
|
9302
|
+
})), ...said.map((entry) => ({
|
|
9303
|
+
voice: "agent",
|
|
9304
|
+
body: entry.body,
|
|
9305
|
+
at: entry.at,
|
|
9306
|
+
asks: entry.asks
|
|
9307
|
+
}))].toSorted((one, other) => one.at < other.at ? -1 : one.at > other.at ? 1 : 0);
|
|
9308
|
+
sentOf = (comment, replies, reading) => {
|
|
9296
9309
|
const { spoken, settled, head, shown, read } = reading;
|
|
9297
|
-
const
|
|
9310
|
+
const ids = /* @__PURE__ */ new Set([comment.id, ...replies.map((reply) => reply.id)]);
|
|
9311
|
+
const said = spoken.filter((entry) => ids.has(entry.comment));
|
|
9312
|
+
const seen = [...ids].reduce((total, id) => total + (read[id] ?? 0), 0);
|
|
9313
|
+
const spun = spunOf(replies, said);
|
|
9314
|
+
const last = spun.at(-1);
|
|
9298
9315
|
return {
|
|
9299
9316
|
id: comment.id,
|
|
9300
9317
|
file: comment.file,
|
|
@@ -9305,9 +9322,13 @@ var init_commands = __esmMin((() => {
|
|
|
9305
9322
|
settled: Object.hasOwn(settled, comment.id),
|
|
9306
9323
|
stale: comment.head !== head,
|
|
9307
9324
|
outside: !shown.has(comment.file),
|
|
9308
|
-
unread: Math.max(0,
|
|
9309
|
-
asks:
|
|
9310
|
-
answers:
|
|
9325
|
+
unread: Math.max(0, said.length - seen),
|
|
9326
|
+
asks: last?.voice === "agent" && last.asks,
|
|
9327
|
+
answers: said.map(bodyOf),
|
|
9328
|
+
turns: spun.map((turn) => ({
|
|
9329
|
+
voice: turn.voice,
|
|
9330
|
+
body: turn.body
|
|
9331
|
+
}))
|
|
9311
9332
|
};
|
|
9312
9333
|
};
|
|
9313
9334
|
sentIn = fn("Cli.sentIn")(function* (reading) {
|
|
@@ -9316,13 +9337,17 @@ var init_commands = __esmMin((() => {
|
|
|
9316
9337
|
const spoken = yield* store.answers(worktree.path);
|
|
9317
9338
|
const current = yield* store.state(worktree.path);
|
|
9318
9339
|
const shown = new Set(reading.patches.map((patch) => patch.path));
|
|
9319
|
-
|
|
9340
|
+
const held = flatten(yield* store.inbox(worktree.path)).filter((comment) => !Object.hasOwn(current.removed, comment.id));
|
|
9341
|
+
const replies = held.filter((comment) => comment.replyTo !== void 0);
|
|
9342
|
+
const conversation = {
|
|
9320
9343
|
spoken,
|
|
9321
9344
|
settled: current.settled,
|
|
9322
9345
|
head: worktree.head,
|
|
9323
9346
|
shown,
|
|
9324
9347
|
read: current.read
|
|
9325
|
-
}
|
|
9348
|
+
};
|
|
9349
|
+
const under = (comment) => replies.filter((reply) => reply.replyTo === comment.id);
|
|
9350
|
+
return held.filter((comment) => comment.replyTo === void 0).map((comment) => sentOf(comment, under(comment), conversation));
|
|
9326
9351
|
});
|
|
9327
9352
|
listSent = fn("Cli.listSent")(function* (repo, branch, base) {
|
|
9328
9353
|
return yield* sentIn(yield* readingOf(repo, branch, base));
|
|
@@ -9364,6 +9389,32 @@ var init_commands = __esmMin((() => {
|
|
|
9364
9389
|
yield* store.submit(worktree.path, batch);
|
|
9365
9390
|
return batch;
|
|
9366
9391
|
});
|
|
9392
|
+
without$1 = (held, key) => Object.fromEntries(Object.entries(held).filter(([held_]) => held_ !== key));
|
|
9393
|
+
submitReply = fn("Cli.submitReply")(function* (request) {
|
|
9394
|
+
const store = yield* Store;
|
|
9395
|
+
const worktree = yield* findBranch(request.repo, request.branch);
|
|
9396
|
+
const found = (yield* store.inbox(worktree.path)).flatMap((batch) => batch.comments).find((one) => one.id === request.to);
|
|
9397
|
+
if (found === void 0) return yield* new UnknownComment({ id: request.to });
|
|
9398
|
+
const root = found.replyTo ?? found.id;
|
|
9399
|
+
const batch = {
|
|
9400
|
+
id: request.id,
|
|
9401
|
+
at: request.at,
|
|
9402
|
+
head: worktree.head,
|
|
9403
|
+
comments: [{
|
|
9404
|
+
id: request.id,
|
|
9405
|
+
anchor: found.anchor,
|
|
9406
|
+
body: request.body,
|
|
9407
|
+
replyTo: root
|
|
9408
|
+
}]
|
|
9409
|
+
};
|
|
9410
|
+
yield* store.submit(worktree.path, batch);
|
|
9411
|
+
const current = yield* store.state(worktree.path);
|
|
9412
|
+
if (Object.hasOwn(current.settled, root)) yield* store.saveState(worktree.path, {
|
|
9413
|
+
...current,
|
|
9414
|
+
settled: without$1(current.settled, root)
|
|
9415
|
+
});
|
|
9416
|
+
return batch;
|
|
9417
|
+
});
|
|
9367
9418
|
listPatches = fn("Cli.listPatches")(function* (repo, branch, context = CONTEXT) {
|
|
9368
9419
|
const worktree = yield* findBranch(repo, branch);
|
|
9369
9420
|
const git = yield* Git;
|
|
@@ -9378,12 +9429,28 @@ var init_commands = __esmMin((() => {
|
|
|
9378
9429
|
start: comment.anchor.start,
|
|
9379
9430
|
end: comment.anchor.end,
|
|
9380
9431
|
snippet: comment.anchor.snippet,
|
|
9381
|
-
body: comment.body
|
|
9432
|
+
body: comment.body,
|
|
9433
|
+
replyTo: comment.replyTo
|
|
9382
9434
|
})));
|
|
9435
|
+
threadBefore = (reply, held, spoken) => {
|
|
9436
|
+
const root = reply.replyTo;
|
|
9437
|
+
const mine = held.filter((one) => one.id === root || one.replyTo === root);
|
|
9438
|
+
const ids = new Set(mine.map((one) => one.id));
|
|
9439
|
+
const said = spoken.filter((entry) => ids.has(entry.comment));
|
|
9440
|
+
return spunOf(mine.filter((one) => one.at < reply.at), said.filter((entry) => entry.at < reply.at)).map((turn) => ({
|
|
9441
|
+
voice: turn.voice,
|
|
9442
|
+
body: turn.body
|
|
9443
|
+
}));
|
|
9444
|
+
};
|
|
9383
9445
|
takeComments = fn("Cli.takeComments")(function* (worktree) {
|
|
9384
9446
|
const store = yield* Store;
|
|
9385
9447
|
const resolved = yield* promise(() => realpath(worktree));
|
|
9386
|
-
|
|
9448
|
+
const owed = flatten(yield* store.take(resolved));
|
|
9449
|
+
if (owed.every((one) => one.replyTo === void 0)) return owed;
|
|
9450
|
+
const held = flatten(yield* store.inbox(resolved));
|
|
9451
|
+
const spoken = yield* store.answers(resolved);
|
|
9452
|
+
const carried = (one) => one.replyTo === void 0 ? one : Object.assign({}, one, { thread: threadBefore(one, held, spoken) });
|
|
9453
|
+
return owed.map(carried);
|
|
9387
9454
|
});
|
|
9388
9455
|
repoOf$1 = fn("Cli.repoOf")(function* (worktree) {
|
|
9389
9456
|
return yield* (yield* Git).repoOf(worktree);
|
|
@@ -9460,18 +9527,22 @@ var init_commands = __esmMin((() => {
|
|
|
9460
9527
|
markRead = fn("Cli.markRead")(function* (repo, branch, id) {
|
|
9461
9528
|
const store = yield* Store;
|
|
9462
9529
|
const worktree = yield* findBranch(repo, branch);
|
|
9463
|
-
const
|
|
9530
|
+
const spoken = yield* store.answers(worktree.path);
|
|
9531
|
+
const counted = [id, ...flatten(yield* store.inbox(worktree.path)).filter((one) => one.replyTo === id).map((one) => one.id)].map((one) => ({
|
|
9532
|
+
id: one,
|
|
9533
|
+
seen: saidTo(spoken, one)
|
|
9534
|
+
}));
|
|
9464
9535
|
const current = yield* store.state(worktree.path);
|
|
9465
|
-
|
|
9536
|
+
const owed = counted.filter((one) => (current.read[one.id] ?? 0) < one.seen);
|
|
9537
|
+
if (owed.length === 0) return {
|
|
9466
9538
|
id,
|
|
9467
9539
|
unread: 0
|
|
9468
9540
|
};
|
|
9541
|
+
const read = { ...current.read };
|
|
9542
|
+
for (const one of owed) read[one.id] = one.seen;
|
|
9469
9543
|
yield* store.saveState(worktree.path, {
|
|
9470
9544
|
...current,
|
|
9471
|
-
read
|
|
9472
|
-
...current.read,
|
|
9473
|
-
[id]: seen
|
|
9474
|
-
}
|
|
9545
|
+
read
|
|
9475
9546
|
});
|
|
9476
9547
|
return {
|
|
9477
9548
|
id,
|
|
@@ -9733,7 +9804,7 @@ var init_pane = __esmMin((() => {
|
|
|
9733
9804
|
init_commands();
|
|
9734
9805
|
init_init();
|
|
9735
9806
|
init_pane();
|
|
9736
|
-
var version$1 = "0.1.0-alpha.
|
|
9807
|
+
var version$1 = "0.1.0-alpha.83";
|
|
9737
9808
|
//#endregion
|
|
9738
9809
|
//#region src/cli/upgrade.ts
|
|
9739
9810
|
var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
|
|
@@ -10301,27 +10372,41 @@ var init_layers = __esmMin((() => {
|
|
|
10301
10372
|
}));
|
|
10302
10373
|
//#endregion
|
|
10303
10374
|
//#region src/cli/threads.ts
|
|
10304
|
-
var stateOf$1, spoken$1, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleThread, removeComment, without, restoreComment, settleRead;
|
|
10375
|
+
var stateOf$1, spoken$1, turnsOf, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleThread, removeComment, without, restoreComment, settleRead;
|
|
10305
10376
|
var init_threads = __esmMin((() => {
|
|
10306
10377
|
init_dist();
|
|
10307
10378
|
init_store();
|
|
10308
10379
|
init_commands();
|
|
10309
10380
|
init_layers();
|
|
10310
10381
|
init_error$1();
|
|
10311
|
-
stateOf$1 = (
|
|
10382
|
+
stateOf$1 = (turns, asked, isSettled, isRemoved) => {
|
|
10312
10383
|
if (isRemoved) return "removed";
|
|
10313
10384
|
if (isSettled) return "done";
|
|
10314
|
-
const last =
|
|
10315
|
-
if (last === void 0) return "sent";
|
|
10316
|
-
return
|
|
10385
|
+
const last = turns.at(-1);
|
|
10386
|
+
if (last === void 0 || last.voice === "reviewer") return "sent";
|
|
10387
|
+
return asked ? "question" : "answered";
|
|
10317
10388
|
};
|
|
10318
10389
|
spoken$1 = (entry) => ({
|
|
10319
10390
|
body: entry.body,
|
|
10320
10391
|
at: entry.at,
|
|
10321
10392
|
asks: entry.asks
|
|
10322
10393
|
});
|
|
10323
|
-
|
|
10324
|
-
|
|
10394
|
+
turnsOf = (replies, said) => [...replies.map((held) => ({
|
|
10395
|
+
voice: "reviewer",
|
|
10396
|
+
body: held.comment.body,
|
|
10397
|
+
at: held.batch.at
|
|
10398
|
+
})), ...said.map((entry) => ({
|
|
10399
|
+
voice: "agent",
|
|
10400
|
+
body: entry.body,
|
|
10401
|
+
at: entry.at
|
|
10402
|
+
}))].toSorted((one, other) => one.at < other.at ? -1 : one.at > other.at ? 1 : 0);
|
|
10403
|
+
threadOf = (held, replies, reading) => {
|
|
10404
|
+
const { comment, batch } = held;
|
|
10405
|
+
const ids = /* @__PURE__ */ new Set([comment.id, ...replies.map((one) => one.comment.id)]);
|
|
10406
|
+
const mine = reading.answers.filter((entry) => ids.has(entry.comment));
|
|
10407
|
+
const seen = [...ids].reduce((total, id) => total + (reading.read[id] ?? 0), 0);
|
|
10408
|
+
const turns = turnsOf(replies, mine);
|
|
10409
|
+
const settled = Object.hasOwn(reading.settled, comment.id);
|
|
10325
10410
|
return {
|
|
10326
10411
|
id: comment.id,
|
|
10327
10412
|
file: comment.anchor.path,
|
|
@@ -10329,14 +10414,24 @@ var init_threads = __esmMin((() => {
|
|
|
10329
10414
|
start: comment.anchor.start,
|
|
10330
10415
|
end: comment.anchor.end,
|
|
10331
10416
|
body: comment.body,
|
|
10332
|
-
state: stateOf$1(
|
|
10417
|
+
state: stateOf$1(turns, mine.at(-1)?.asks === true, settled, Object.hasOwn(reading.removed, comment.id)),
|
|
10333
10418
|
stale: batch.head !== reading.head,
|
|
10334
10419
|
outside: !reading.shown.has(comment.anchor.path),
|
|
10335
|
-
unread: Math.max(0, mine.length -
|
|
10336
|
-
answers: mine.map(spoken$1)
|
|
10420
|
+
unread: Math.max(0, mine.length - seen),
|
|
10421
|
+
answers: mine.map(spoken$1),
|
|
10422
|
+
turns,
|
|
10423
|
+
settled
|
|
10337
10424
|
};
|
|
10338
10425
|
};
|
|
10339
|
-
threadsIn = (batches, reading) =>
|
|
10426
|
+
threadsIn = (batches, reading) => {
|
|
10427
|
+
const held = batches.flatMap((batch) => batch.comments.map((comment) => ({
|
|
10428
|
+
comment,
|
|
10429
|
+
batch
|
|
10430
|
+
})));
|
|
10431
|
+
const replies = held.filter((one) => one.comment.replyTo !== void 0);
|
|
10432
|
+
const under = (one) => replies.filter((reply) => reply.comment.replyTo === one.comment.id);
|
|
10433
|
+
return held.filter((one) => one.comment.replyTo === void 0).map((one) => threadOf(one, under(one), reading));
|
|
10434
|
+
};
|
|
10340
10435
|
idsIn = (batches) => batches.flatMap((batch) => batch.comments.map((comment) => comment.id));
|
|
10341
10436
|
isKnown = fn("Cli.isKnown")(function* (worktreePath, id) {
|
|
10342
10437
|
const store = yield* Store;
|
|
@@ -10646,6 +10741,30 @@ var init_catalog = __esmMin((() => {
|
|
|
10646
10741
|
dataKey: "batch",
|
|
10647
10742
|
example: "adiff comment send --repo . --branch cdr-1 --file src/api.ts --start 4 --end 5 --body \"why\""
|
|
10648
10743
|
},
|
|
10744
|
+
{
|
|
10745
|
+
name: "comment reply",
|
|
10746
|
+
about: "Write back to a comment already sent, continuing its thread",
|
|
10747
|
+
group: WRITE_COMMENTS,
|
|
10748
|
+
addresses: "review",
|
|
10749
|
+
safety: "write",
|
|
10750
|
+
options: [
|
|
10751
|
+
...addressing,
|
|
10752
|
+
{
|
|
10753
|
+
name: "to",
|
|
10754
|
+
required: true,
|
|
10755
|
+
value: "id",
|
|
10756
|
+
about: "The comment being continued, as `comment list` reports it"
|
|
10757
|
+
},
|
|
10758
|
+
{
|
|
10759
|
+
name: "body",
|
|
10760
|
+
required: true,
|
|
10761
|
+
value: "text",
|
|
10762
|
+
about: "What to tell the agent"
|
|
10763
|
+
}
|
|
10764
|
+
],
|
|
10765
|
+
dataKey: "batch",
|
|
10766
|
+
example: "adiff comment reply --repo . --branch cdr-1 --to c1 --body \"the other one\""
|
|
10767
|
+
},
|
|
10649
10768
|
{
|
|
10650
10769
|
name: "comment take",
|
|
10651
10770
|
about: "Collect the comments this review is still owed an answer on. Repeats until answered",
|
|
@@ -11465,7 +11584,7 @@ var init_tree = __esmMin((() => {
|
|
|
11465
11584
|
return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
|
|
11466
11585
|
};
|
|
11467
11586
|
crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
|
|
11468
|
-
})), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, pickedText, selectedLines, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, sectionOf, sentEntry, panelEntries, panelIndexOf, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
|
|
11587
|
+
})), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, pickedText, selectedLines, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelIndexOf, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
|
|
11469
11588
|
var init_model = __esmMin((() => {
|
|
11470
11589
|
init_dist();
|
|
11471
11590
|
init_patch();
|
|
@@ -11774,6 +11893,7 @@ var init_model = __esmMin((() => {
|
|
|
11774
11893
|
composeRoom$1 = (columns) => Math.max(COMPOSE_LEAST, composeBox(columns) - COMPOSE_PAD);
|
|
11775
11894
|
composeTarget = (state) => {
|
|
11776
11895
|
const patch = selectedPatch(state);
|
|
11896
|
+
if (state.replyTo !== void 0) return replyTarget(state);
|
|
11777
11897
|
if (patch === void 0) return "";
|
|
11778
11898
|
const [from, to] = selectionRange(state);
|
|
11779
11899
|
const anchor = anchorFor(patch, from, to);
|
|
@@ -11783,6 +11903,11 @@ var init_model = __esmMin((() => {
|
|
|
11783
11903
|
});
|
|
11784
11904
|
return span === "" ? `Comment on ${patch.path}` : `Comment on ${patch.path}:${span}`;
|
|
11785
11905
|
};
|
|
11906
|
+
replyTarget = (state) => {
|
|
11907
|
+
const thread = state.sent.find((entry) => entry.id === state.replyTo);
|
|
11908
|
+
if (thread === void 0) return "Reply";
|
|
11909
|
+
return `Reply on ${thread.file}:${thread.end}`;
|
|
11910
|
+
};
|
|
11786
11911
|
pickedText = (state) => {
|
|
11787
11912
|
const picked = state.picked;
|
|
11788
11913
|
const patch = selectedPatch(state);
|
|
@@ -11933,7 +12058,11 @@ var init_model = __esmMin((() => {
|
|
|
11933
12058
|
if (later === void 0) return comment;
|
|
11934
12059
|
return answersIn(later) > answersIn(comment) ? later : comment;
|
|
11935
12060
|
};
|
|
11936
|
-
|
|
12061
|
+
spokeLast = (comment) => comment.turns?.at(-1)?.voice;
|
|
12062
|
+
sectionOf = (comment) => {
|
|
12063
|
+
if (spokeLast(comment) === "reviewer" && comment.settled !== true) return "with";
|
|
12064
|
+
return answersIn(comment) > 0 || comment.settled === true ? "answered" : "with";
|
|
12065
|
+
};
|
|
11937
12066
|
sentEntry = (state, comment) => {
|
|
11938
12067
|
const newer = newerOf(state, comment);
|
|
11939
12068
|
return {
|
|
@@ -12451,6 +12580,17 @@ var init_command = __esmMin((() => {
|
|
|
12451
12580
|
hint: "settle read",
|
|
12452
12581
|
rank: 1
|
|
12453
12582
|
}),
|
|
12583
|
+
command({
|
|
12584
|
+
action: "thread.reply",
|
|
12585
|
+
panes: ["review", "diff"],
|
|
12586
|
+
hint: "reply",
|
|
12587
|
+
rank: 1,
|
|
12588
|
+
title: "Write back to the thread here",
|
|
12589
|
+
category: "Comments",
|
|
12590
|
+
keys: ["R"],
|
|
12591
|
+
screens: ["review"],
|
|
12592
|
+
whenThread: true
|
|
12593
|
+
}),
|
|
12454
12594
|
command({
|
|
12455
12595
|
action: "thread.remove",
|
|
12456
12596
|
panes: ["review"],
|
|
@@ -13045,6 +13185,7 @@ var init_reduce = __esmMin((() => {
|
|
|
13045
13185
|
...state,
|
|
13046
13186
|
screen: "compose",
|
|
13047
13187
|
draft: "",
|
|
13188
|
+
replyTo: void 0,
|
|
13048
13189
|
anchorRow: state.selecting ? state.anchorRow : state.cursor
|
|
13049
13190
|
};
|
|
13050
13191
|
};
|
|
@@ -13073,7 +13214,8 @@ var init_reduce = __esmMin((() => {
|
|
|
13073
13214
|
if (state.screen === "compose") return {
|
|
13074
13215
|
...state,
|
|
13075
13216
|
screen: "review",
|
|
13076
|
-
draft: ""
|
|
13217
|
+
draft: "",
|
|
13218
|
+
replyTo: void 0
|
|
13077
13219
|
};
|
|
13078
13220
|
if (state.selecting) return {
|
|
13079
13221
|
...state,
|
|
@@ -13145,6 +13287,7 @@ var init_reduce = __esmMin((() => {
|
|
|
13145
13287
|
"select.swap": swapEnds,
|
|
13146
13288
|
"compose.open": openCompose,
|
|
13147
13289
|
"compose.submit": (state) => state,
|
|
13290
|
+
"thread.reply": (state) => state,
|
|
13148
13291
|
"focus.toggle": (state) => ({
|
|
13149
13292
|
...state,
|
|
13150
13293
|
focus: focusStepped(state, 1),
|
|
@@ -13595,7 +13738,7 @@ var init_theme = __esmMin((() => {
|
|
|
13595
13738
|
}));
|
|
13596
13739
|
//#endregion
|
|
13597
13740
|
//#region src/tui/diffview.ts
|
|
13598
|
-
var WASH, NOTE_MIN, ANSWER_MARK, OVERSCAN, SIGN_WIDTH, SCROLL_ROWS, PAN_COLUMNS, WAYS, notchesIn, takenOver, wheelTo, SIGNS, numberFor, DiffView, startsOf, bareOf, keyOf, groupOf, isChrome, alike, heldAt, sameLine, NO_SPANS, lineStarts, overLine, shifted, acrossLines, spansByLine, textAt, noteSpans, NOTE_PAINT, wrap, headOf, spokenLines, answerLines, noteLines, noteRows, proseRows, proseAt, notesAt, codeRow, rowsFor, layout, lineNumbers, BARE_SIGN, signFor, lineSigns, sideLineOf;
|
|
13741
|
+
var WASH, NOTE_MIN, ANSWER_MARK, REPLY_MARK, OVERSCAN, SIGN_WIDTH, SCROLL_ROWS, PAN_COLUMNS, WAYS, notchesIn, takenOver, wheelTo, SIGNS, numberFor, DiffView, startsOf, bareOf, noteKey, keyOf, groupOf, isChrome, alike, heldAt, sameLine, NO_SPANS, lineStarts, overLine, shifted, acrossLines, spansByLine, textAt, noteSpans, NOTE_PAINT, wrap, headOf, spokenLines, answerLines, noteLines, noteRows, proseRows, proseAt, notesAt, codeRow, rowsFor, layout, lineNumbers, BARE_SIGN, signFor, lineSigns, sideLineOf;
|
|
13599
13742
|
var init_diffview = __esmMin((() => {
|
|
13600
13743
|
init_dist();
|
|
13601
13744
|
init_patch();
|
|
@@ -13613,6 +13756,7 @@ var init_diffview = __esmMin((() => {
|
|
|
13613
13756
|
};
|
|
13614
13757
|
NOTE_MIN = 24;
|
|
13615
13758
|
ANSWER_MARK = "↳";
|
|
13759
|
+
REPLY_MARK = "»";
|
|
13616
13760
|
OVERSCAN = 2;
|
|
13617
13761
|
SIGN_WIDTH = 2;
|
|
13618
13762
|
SCROLL_ROWS = 1;
|
|
@@ -14035,9 +14179,14 @@ var init_diffview = __esmMin((() => {
|
|
|
14035
14179
|
return starts;
|
|
14036
14180
|
};
|
|
14037
14181
|
bareOf = (display) => new Set(display.flatMap((entry, index) => entry.comment || entry.gap || entry.prose ? [index] : []));
|
|
14182
|
+
noteKey = (note) => [
|
|
14183
|
+
`${note.side}${note.line}:${note.folded ? "-" : "+"}${note.body}`,
|
|
14184
|
+
note.settled ? "settled" : note.asks ? "asked" : "open",
|
|
14185
|
+
...note.turns.length > 0 ? note.turns.map((turn) => `${turn.voice[0] ?? ""}:${turn.body}`) : note.answers.map((body) => `a:${body}`)
|
|
14186
|
+
].join("");
|
|
14038
14187
|
keyOf = (room, notes, prose) => [
|
|
14039
14188
|
room,
|
|
14040
|
-
...notes.map(
|
|
14189
|
+
...notes.map(noteKey),
|
|
14041
14190
|
...prose.map((entry) => `p${entry.line}${entry.after ? ">" : "<"}:${entry.markdown}`)
|
|
14042
14191
|
].join("\0");
|
|
14043
14192
|
groupOf = (entry) => {
|
|
@@ -14144,13 +14293,14 @@ var init_diffview = __esmMin((() => {
|
|
|
14144
14293
|
const moved = note.stale ? ", the branch moved on" : "";
|
|
14145
14294
|
if (note.settled) return `${marks().sent} settled${moved}`;
|
|
14146
14295
|
if (note.asks) return `${marks().comment} asked back${moved}`;
|
|
14296
|
+
if (note.turns.at(-1)?.voice === "reviewer") return `${marks().comment} replied${moved}`;
|
|
14147
14297
|
if (note.answers.length > 0) return `${marks().sent} answered${moved}`;
|
|
14148
14298
|
return `${marks().sent} sent${moved}`;
|
|
14149
14299
|
};
|
|
14150
|
-
spokenLines = (body, room) => {
|
|
14151
|
-
return wrap(body.replaceAll("\n", " "), Math.max(NOTE_MIN, room - 2)).map((text, at) => at === 0 ? `${
|
|
14300
|
+
spokenLines = (body, room, mark) => {
|
|
14301
|
+
return wrap(body.replaceAll("\n", " "), Math.max(NOTE_MIN, room - 2)).map((text, at) => at === 0 ? `${mark} ${text}` : ` ${text}`);
|
|
14152
14302
|
};
|
|
14153
|
-
answerLines = (note, room) => note.answers.flatMap((body) => spokenLines(body, room));
|
|
14303
|
+
answerLines = (note, room) => note.turns.length > 0 ? note.turns.flatMap((turn) => spokenLines(turn.body, room, turn.voice === "agent" ? ANSWER_MARK : REPLY_MARK)) : note.answers.flatMap((body) => spokenLines(body, room, ANSWER_MARK));
|
|
14154
14304
|
noteLines = (note, room) => note.folded ? [`${headOf(note)} · press l`] : [
|
|
14155
14305
|
headOf(note),
|
|
14156
14306
|
...note.body.split("\n").flatMap((line) => wrap(line, room)),
|
|
@@ -14700,7 +14850,8 @@ var init_render = __esmMin((() => {
|
|
|
14700
14850
|
settled: entry.settled === true,
|
|
14701
14851
|
stale: entry.stale === true,
|
|
14702
14852
|
asks: entry.asks === true,
|
|
14703
|
-
answers: entry.answers ?? []
|
|
14853
|
+
answers: entry.answers ?? [],
|
|
14854
|
+
turns: entry.turns ?? []
|
|
14704
14855
|
}));
|
|
14705
14856
|
notesFor = (state, path) => notesOf(state.sent, path, true, state.opened);
|
|
14706
14857
|
paired = (chunks) => {
|
|
@@ -16064,6 +16215,7 @@ var init_app = __esmMin((() => {
|
|
|
16064
16215
|
"thread.settle": () => this.settleHere(),
|
|
16065
16216
|
"thread.settleRead": () => this.settleWhatIsRead(),
|
|
16066
16217
|
"thread.remove": () => this.removeHere(),
|
|
16218
|
+
"thread.reply": () => this.replyHere(),
|
|
16067
16219
|
"selection.copy": () => sync(() => this.copySelection(false)),
|
|
16068
16220
|
"search.open": () => this.findSelection(),
|
|
16069
16221
|
"search.jump": () => this.openMatch(),
|
|
@@ -16346,6 +16498,21 @@ var init_app = __esmMin((() => {
|
|
|
16346
16498
|
this.commit(withNotice(this.staying(held, id), "settled"));
|
|
16347
16499
|
});
|
|
16348
16500
|
}
|
|
16501
|
+
replyHere() {
|
|
16502
|
+
return sync(() => {
|
|
16503
|
+
const thread = threadChosen(this.state) ?? threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor);
|
|
16504
|
+
if (thread?.id === void 0) {
|
|
16505
|
+
this.commit(withNotice(this.state, "no thread here"));
|
|
16506
|
+
return;
|
|
16507
|
+
}
|
|
16508
|
+
this.commit({
|
|
16509
|
+
...this.state,
|
|
16510
|
+
screen: "compose",
|
|
16511
|
+
draft: "",
|
|
16512
|
+
replyTo: thread.id
|
|
16513
|
+
});
|
|
16514
|
+
});
|
|
16515
|
+
}
|
|
16349
16516
|
staying(state, id) {
|
|
16350
16517
|
const at = panelIndexOf(state, id);
|
|
16351
16518
|
const last = Math.max(0, panelEntries(state).length - 1);
|
|
@@ -16600,6 +16767,28 @@ var init_app = __esmMin((() => {
|
|
|
16600
16767
|
});
|
|
16601
16768
|
}
|
|
16602
16769
|
send() {
|
|
16770
|
+
return this.state.replyTo === void 0 ? this.sendComment() : this.sendReply(this.state.replyTo);
|
|
16771
|
+
}
|
|
16772
|
+
sendReply(to) {
|
|
16773
|
+
return gen({ self: this }, function* () {
|
|
16774
|
+
const branch = selectedBranch(this.state);
|
|
16775
|
+
if (branch === void 0 || this.state.draft.length === 0) return;
|
|
16776
|
+
yield* submitReply({
|
|
16777
|
+
repo: this.repo,
|
|
16778
|
+
branch: branch.branch,
|
|
16779
|
+
to,
|
|
16780
|
+
body: yield* this.display.written,
|
|
16781
|
+
id: randomUUID(),
|
|
16782
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
16783
|
+
});
|
|
16784
|
+
const sent = yield* this.loadSent(branch.branch);
|
|
16785
|
+
this.commit(withNotice(withSent({
|
|
16786
|
+
...this.state,
|
|
16787
|
+
replyTo: void 0
|
|
16788
|
+
}, sent), "sent to the agent"));
|
|
16789
|
+
});
|
|
16790
|
+
}
|
|
16791
|
+
sendComment() {
|
|
16603
16792
|
return gen({ self: this }, function* () {
|
|
16604
16793
|
const patch = selectedPatch(this.state);
|
|
16605
16794
|
const branch = selectedBranch(this.state);
|
|
@@ -16735,6 +16924,7 @@ var tui_exports = /* @__PURE__ */ __exportAll({
|
|
|
16735
16924
|
laidDraft: () => laidDraft,
|
|
16736
16925
|
launch: () => launch,
|
|
16737
16926
|
listableFor: () => listableFor,
|
|
16927
|
+
noteKey: () => noteKey,
|
|
16738
16928
|
palette: () => palette,
|
|
16739
16929
|
runOn: () => runOn,
|
|
16740
16930
|
runTui: () => runTui,
|
|
@@ -16746,6 +16936,7 @@ var init_tui = __esmMin((() => {
|
|
|
16746
16936
|
init_command();
|
|
16747
16937
|
init_match();
|
|
16748
16938
|
init_model();
|
|
16939
|
+
init_diffview();
|
|
16749
16940
|
init_render();
|
|
16750
16941
|
init_theme();
|
|
16751
16942
|
}));
|
|
@@ -16791,6 +16982,17 @@ const commentSend = fn("Main.commentSend")(function* (options) {
|
|
|
16791
16982
|
});
|
|
16792
16983
|
yield* answer(options, { batch });
|
|
16793
16984
|
});
|
|
16985
|
+
const commentReply = fn("Main.commentReply")(function* (options) {
|
|
16986
|
+
const batch = yield* submitReply({
|
|
16987
|
+
repo: yield* required(options, "repo"),
|
|
16988
|
+
branch: yield* required(options, "branch"),
|
|
16989
|
+
to: yield* required(options, "to"),
|
|
16990
|
+
body: yield* required(options, "body"),
|
|
16991
|
+
id: options["id"] ?? randomUUID(),
|
|
16992
|
+
at: options["at"] ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
16993
|
+
});
|
|
16994
|
+
yield* answer(options, { batch });
|
|
16995
|
+
});
|
|
16794
16996
|
const NOTHING_WAITING = "No comment is waiting. Pass --wait <seconds> to block until one arrives, and answer what you collect with `adiff comment answer --worktree . --id <id> --body '…'`.";
|
|
16795
16997
|
const commentTake = fn("Main.commentTake")(function* (options) {
|
|
16796
16998
|
const worktree = yield* required(options, "worktree");
|
|
@@ -16900,6 +17102,7 @@ const routes = {
|
|
|
16900
17102
|
"base set": baseSet,
|
|
16901
17103
|
"base clear": baseClear,
|
|
16902
17104
|
"comment send": commentSend,
|
|
17105
|
+
"comment reply": commentReply,
|
|
16903
17106
|
"comment take": commentTake,
|
|
16904
17107
|
"comment answer": commentAnswer,
|
|
16905
17108
|
"comment list": commentList,
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"bin": {
|
|
24
24
|
"adiff": "./bin/adiff.js"
|
|
25
25
|
},
|
|
26
|
-
"version": "0.1.0-alpha.
|
|
26
|
+
"version": "0.1.0-alpha.83",
|
|
27
27
|
"description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"repository": {
|
package/skills/adiff/SKILL.md
CHANGED
|
@@ -73,6 +73,20 @@ adiff comment answer --worktree . --id <id> --question --body "Drop it, or keep
|
|
|
73
73
|
That marks the thread as waiting on them rather than on you. Do not use it to check in; use it when
|
|
74
74
|
the work genuinely stops without an answer.
|
|
75
75
|
|
|
76
|
+
## When the reviewer writes back
|
|
77
|
+
|
|
78
|
+
A reviewer can reply to an answer, and the reply arrives through `comment take` like any other
|
|
79
|
+
comment — with an `id` of its own that you answer against, and a `thread` carrying what was said
|
|
80
|
+
before it, oldest first:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{"body":"the imports","replyTo":"c1","thread":[{"voice":"reviewer","body":"why two of these"},{"voice":"agent","body":"which two did you mean"}]}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Read the thread before answering. A reply is usually short because it is the rest of a sentence you
|
|
87
|
+
already have: "the imports" only means something next to the question it answers. Answer it against
|
|
88
|
+
its own id, not the id of the comment that started the thread.
|
|
89
|
+
|
|
76
90
|
Settling a thread is the reviewer's to do, not yours. They raised the point, so they decide it is
|
|
77
91
|
closed.
|
|
78
92
|
|