@eliya-oss/agent-diff 0.1.0-alpha.6 → 0.1.0-alpha.61

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.
@@ -15,6 +15,9 @@ the way it is, why it is tested the way it is. ADRs explain choices that outlive
15
15
  | [ADR-002](ADR-002-effect-v4-and-module-boundaries.md) | Effect v4, and modules sealed behind `index.ts` |
16
16
  | [ADR-003](ADR-003-blackbox-testdriver.md) | Black-box tests through a TestDriver, and no unit tests |
17
17
  | [ADR-004](ADR-004-pnpm-native-releases.md) | pnpm's own release tooling instead of Changesets |
18
+ | [ADR-005](ADR-005-a-mechanical-style-contract.md) | Style is a lint rule, not a document |
19
+ | [ADR-006](ADR-006-the-terminal-runs-on-effect.md) | The terminal runs on Effect |
20
+ | [ADR-007](ADR-007-model-with-effect-not-only-run-on-it.md) | Model with Effect, not only run on it |
18
21
 
19
22
  ## Writing one
20
23
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,371 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.61
4
+
5
+ ### Patch Changes
6
+
7
+ - Scrolling reaches the end of a file whose comments fill the screen. The wheel counted lines of code and a long answer is one line of code however tall it is drawn, so anything below it was out of reach. Opening a comment from the panel also leaves the panel where you left it.
8
+
9
+ ## 0.1.0-alpha.60
10
+
11
+ ### Patch Changes
12
+
13
+ - Typing `adiff` opens the review on the repository you are standing in, rather than printing the help you have already read. Piped output and agents still get the help, so nothing that reads adiff's answers is left waiting on a terminal.
14
+
15
+ ## 0.1.0-alpha.59
16
+
17
+ ### Patch Changes
18
+
19
+ - An answer stays unread until you open it, and the count survives reloading the branch. Keys work on a keyboard that is not English: a binding matches the key the letter sits on. Bug reports carry the last twenty moves, and `ctrl+t` sends only the words you typed.
20
+
21
+ ## 0.1.0-alpha.58
22
+
23
+ ### Patch Changes
24
+
25
+ - Syntax colour is read from the file now, not from the diff. The visible rows were handed to the parser as if they were a document, so a hunk starting inside a JSX block or an object literal gave it no opening to find, and the gap and comment rows between hunks were fed to it as code — which is why colour looked right in some files and wrong in others. Both sides of the file are parsed whole and the colours laid onto the rows that show them.
26
+
27
+ Three things around the diff were fixed with it. The pinned scope no longer keeps the previous file's line: the memo that skips redrawing an unchanged pin was reset without the pin being cleared, so an empty chain skipped the redraw and left the old scope on screen. Scrolling a deeply indented file no longer jumps, because the rows available to scroll through no longer shrink and grow with the pinned scope under the cursor. And `option` and `command` with backspace take back a word and a line while writing a comment, rather than one character like a bare backspace.
28
+
29
+ `}` and `{` walk changes rather than hunks. They jumped to the top of a hunk, which is its leading context, so the cursor landed three lines short of the thing it was jumping to — and with the whole file shown there was only ever one hunk, so they stopped working entirely. They now step from one run of changed lines to the next, which works at any width and lands on the change.
30
+
31
+ Opening a comment from the review panel brings the diff to it. The row was worked out from the diff before its gap and comment rows were counted in, so it landed somewhere else in the file — often the end. A comment whose line is not in the diff at all says so rather than moving you somewhere arbitrary.
32
+
33
+ The review screen also uses the two rows it was leaving empty above and below itself.
34
+
35
+ ## 0.1.0-alpha.57
36
+
37
+ ### Patch Changes
38
+
39
+ - Installing without naming a tag gets this version rather than one from weeks ago. The release moves the `latest` dist-tag itself now: the step used to throw away the credential the publish had just used successfully and go straight to an exchange that returns nothing, so the tag sat on `0.1.0-alpha.20` while releases ran on ahead, and moving it meant someone typing the command by hand every time. Opening the GitHub release retries too, so a refused API call no longer leaves a published version with no binaries and no Homebrew formula behind it.
40
+
41
+ ## 0.1.0-alpha.56
42
+
43
+ ### Patch Changes
44
+
45
+ - A branch stacked on another branch shows the work it adds, not its parent's as well. The diff was always taken against the default branch, so branch B built on branch A reported A's files as B's and the reviewer walked files they had already reviewed on A. The base is now whichever local branch this one was started from, found by looking for the closest ancestor branch among the local tips, and every command that resolves a diff takes `--base <ref>` to override the guess. `branch list` reports the base and how it was chosen on each row, so a non-default base is visible rather than surprising, and the review screen says `on <branch>` beside a branch that is not on the default. `adiff base set` remembers a base for a branch and `adiff base clear` goes back to detection. A base that names no ref, or one with no shared history, fails with exit 3 and a suggestion rather than quietly falling back to the default and reporting a file count that looks right.
46
+
47
+ ## 0.1.0-alpha.55
48
+
49
+ ### Patch Changes
50
+
51
+ - The review screen says which pane you are in. It was one frame around everything with rules between the panes, which drew the seams but never told you which side of them your next keystroke was going to land on — and `tab` moves between three panes where most keys mean something different. Each pane is its own bordered box now, and the one holding the focus is lit in the accent colour while the others stay dim, so exactly one border is bright at any time. `tab` also walks the panes left to right now, the way they are drawn, rather than starting in the middle and jumping to the left pane before crossing to the right; `shift+tab` walks back.
52
+
53
+ ## 0.1.0-alpha.54
54
+
55
+ ### Patch Changes
56
+
57
+ - A review now follows its branch instead of the folder it was read in. State was keyed on the worktree path, so renaming a worktree — or checking the same branch out somewhere else — left the entire review behind with nothing on screen to say it had happened. The key is the repository and the branch now, where the repository is the common git directory every worktree of it shares, so all the worktrees of one repo agree on where a review lives and different branches still keep their own. A store written under the old key is adopted the first time the branch is opened, so nothing already written is stranded.
58
+
59
+ - Comments handed to an agent that never answered them are no longer lost. The cursor advanced the moment `comment take` read a comment, so an agent that collected five and answered three left two that nothing would ever hand over again — and the terminal went on showing them as sent, with no sign anything was wrong. An answer is what retires a comment now, so one the agent dropped comes back on its next take and keeps coming back until it is answered. Settling or removing retires it too, since both are the reviewer saying they no longer need one. The branch list counts what the agent still owes rather than what it has yet to read, which is the number that was missing when a comment went quietly missing.
60
+
61
+ ## 0.1.0-alpha.53
62
+
63
+ ### Patch Changes
64
+
65
+ - Three places where the screen did something and said nothing about it. `}` and `{` now name the edge they hit instead of absorbing the keystroke, and when a file has been widened into a single change they name the context ladder as the reason — `+` quietly trades the changes you were stepping between for the lines around them. The review panel settles and removes the comment it is standing on, so a comment the diff cannot reach — its file deleted since, or just not the file on screen — stops being one you can see but not answer. And `… N more` counts what is below it rather than every row outside the window, so scrolling to the last file no longer promises seventeen more that are not there.
66
+
67
+ ## 0.1.0-alpha.52
68
+
69
+ ### Patch Changes
70
+
71
+ - Pasting into a comment works. The terminal hands a paste over in one piece rather than replaying it as keystrokes, and adiff was only listening for keystrokes, so every paste was read correctly and then thrown away — nothing appeared, and quoting a stack trace or an error message meant retyping it. A paste now lands at the caret in one move. Line breaks survive in a draft and become spaces in the palette, whose query is one line; tabs become two spaces so pasted code keeps its shape; escape sequences and control characters are stripped, because a comment is prose an agent reads back rather than a channel to the screen.
72
+
73
+ ## 0.1.0-alpha.51
74
+
75
+ ### Patch Changes
76
+
77
+ - The file list stops ending without saying so. It reserved a row for `… N more` whether or not one was needed, and that row paid for the pane's padding instead, so the count was clipped and the list just stopped. `h` now closes the folder the cursor's file is in and then walks outward one folder per press, with `l` opening them again from the outside in, so a deep tree can be folded down to something that fits.
78
+
79
+ ## 0.1.0-alpha.50
80
+
81
+ ### Patch Changes
82
+
83
+ - `adiff upgrade` says the command it ran and the version it landed on, and stops there. It used to open with which package manager installed the build, which registry tag mattered and what it was about to do, which is four paragraphs standing between you and the one fact you asked for. Upgrading now also rewrites the adiff skill wherever it is already installed, so an agent is not left reading last month's instructions; `adiff skill refresh` does that on its own, and neither installs a skill that was not already there.
84
+
85
+ ## 0.1.0-alpha.49
86
+
87
+ ### Patch Changes
88
+
89
+ - `z` gives the diff the whole window: it clears the review panel as well as the file list, and pressing it again brings back whatever was there before. The key that hides the panel on its own, `a`, is named in the footer instead of only in the sheet of keys.
90
+
91
+ ## 0.1.0-alpha.48
92
+
93
+ ### Patch Changes
94
+
95
+ - `review open` and `review pane` take `--branch`, so an agent handing over a review can name the branch and land the reviewer on its diff rather than on the worktree list. `F` shows the whole file the change sits in and `F` again gives the diff back, returning to whatever context width you had chosen.
96
+
97
+ - A wide terminal now carries the whole review beside the diff: what you have staged, what the agent already has, and what it has answered, in one panel you can walk with `tab` and open with `enter`. When an answer lands while you are reading, the panel names the comment it answers instead of only counting it, so you can tell whether pulling is worth doing before you press `r`.
98
+
99
+ - The wheel scrolls the sheet of keys you are looking at rather than the diff behind it. Reading the branch again with `r` keeps the lines you were looking at where they were, instead of moving them to an edge of the pane.
100
+
101
+ - Writing a comment has a caret: `left` and `right` move it, `alt` with either moves a word, `home` and `end` reach the ends of the line, and typing, `backspace` and `delete` all act where it stands, so fixing a typo near the start of a sentence no longer costs the rest of it.
102
+
103
+ ## 0.1.0-alpha.47
104
+
105
+ ### Minor Changes
106
+
107
+ - `adiff upgrade` upgrades. It runs the command for the install it found instead of printing it, shows the package manager working, and ends by naming the version you now have. `--check` reports without running, `--run` still works and does nothing, and a route adiff cannot do for you, a downloaded binary or a checkout, explains why and exits 1.
108
+
109
+ ## 0.1.0-alpha.46
110
+
111
+ ### Patch Changes
112
+
113
+ - Make the pull request reachable: p opens it from the review as well as the worktree list, the footer names the key where there is one to open, the review header says which state it is in, and a list that could not ask says so instead of looking like nobody has a pull request.
114
+
115
+ ## 0.1.0-alpha.45
116
+
117
+ ### Patch Changes
118
+
119
+ - Use the room a wide terminal has: panels keep a whole command title and a whole match, a tall screen lists more keys, and a long worktree name is read to its end.
120
+
121
+ ## 0.1.0-alpha.44
122
+
123
+ ### Patch Changes
124
+
125
+ - A file buried deep in a nested tree can be read: the file list keeps both ends of a name that does not fit, so two files whose names end the same way no longer draw as one row, and the header names the file you are on instead of letting the path run off the edge of the terminal.
126
+
127
+ ## 0.1.0-alpha.43
128
+
129
+ ### Patch Changes
130
+
131
+ - Build the Linux release binaries again. The terminal library ships one native package per platform and libc, and pnpm skips the musl ones on a glibc runner, so the compiler could not find the musl library it still has to bundle and both Linux builds stopped there. Installs now take both libc flavours, and every pull request compiles all four binaries and checks they answer with no runtime on PATH, so a broken binary shows up before a release does. The release also tracks the newest Bun rather than a pinned one.
132
+
133
+ ## 0.1.0-alpha.42
134
+
135
+ ### Minor Changes
136
+
137
+ - Renames on the merits, now that nothing depends on the old names: `comment threads` is `comment list`, `comment add` is `comment send`, `review submit` is `review send`, `file vouch` is `file review`, and `--asks` is `--question`. `comment drop` is gone, folded into `comment remove`. Every command that acts on a review now takes either `--worktree`, or `--repo` with `--branch`.
138
+
139
+ ### Patch Changes
140
+
141
+ - `--help` works on every command and every noun, the top-level list is grouped by what you are trying to do, a mistyped command names the one you meant, and a missing option says which command wanted it.
142
+
143
+ ## 0.1.0-alpha.41
144
+
145
+ ### Patch Changes
146
+
147
+ - Build the release binaries with a version of Bun that exists. The workflow asked for 1.4.0, which was never published, so every binary download answered 404. No release since the workflow landed has carried binaries or updated the Homebrew formula.
148
+
149
+ ## 0.1.0-alpha.40
150
+
151
+ ### Patch Changes
152
+
153
+ - `adiff upgrade` answers in plain english, starting with what happened: already the newest build, a newer one is out, or the registry never answered. `--json` gives the envelope back to a caller.
154
+
155
+ ## 0.1.0-alpha.39
156
+
157
+ ### Patch Changes
158
+
159
+ - `adiff upgrade` works out how this copy was installed and names the one command that updates it, and the terminal mentions a newer version once in the footer without ever checking on a command's path.
160
+
161
+ ## 0.1.0-alpha.38
162
+
163
+ ### Patch Changes
164
+
165
+ - adiff --version answers from a version built into the bundle rather than a package.json found beside it, and a Bun runtime opens the terminal itself instead of going looking for a Node it does not need.
166
+
167
+ ## 0.1.0-alpha.37
168
+
169
+ ### Patch Changes
170
+
171
+ - The footer carries the keys a review is made of, and ? lists every key the screen answers to.
172
+
173
+ ## 0.1.0-alpha.36
174
+
175
+ ### Patch Changes
176
+
177
+ - A review belongs to the branch it describes, the worktree list names the repository it opened and marks where you are, and the pull request opens from the list.
178
+
179
+ ## 0.1.0-alpha.35
180
+
181
+ ### Patch Changes
182
+
183
+ - A comment can be removed from the review and restored, and the record keeps it either way.
184
+
185
+ ## 0.1.0-alpha.34
186
+
187
+ ### Patch Changes
188
+
189
+ - A file name too long for the tree keeps its end, where the extension and the distinguishing word live.
190
+
191
+ ## 0.1.0-alpha.33
192
+
193
+ ### Patch Changes
194
+
195
+ - The store reports a damaged file instead of failing unexpectedly.
196
+
197
+ ## 0.1.0-alpha.32
198
+
199
+ ### Patch Changes
200
+
201
+ - The skill publishes a reading order on request, and tells the reviewer how to open the review.
202
+
203
+ ## 0.1.0-alpha.31
204
+
205
+ ### Patch Changes
206
+
207
+ - Coverage counts the changed lines a layer claims, not the hunks a span touches.
208
+
209
+ ## 0.1.0-alpha.30
210
+
211
+ ### Patch Changes
212
+
213
+ - The palette keeps a command's name clear of its category.
214
+
215
+ ## 0.1.0-alpha.29
216
+
217
+ ### Patch Changes
218
+
219
+ - First contact teaches the loop, an empty collection says what to do next, and a worktree error explains the path.
220
+
221
+ ## 0.1.0-alpha.28
222
+
223
+ ### Patch Changes
224
+
225
+ - An agent can open the review in a split pane beside the conversation.
226
+
227
+ ## 0.1.0-alpha.27
228
+
229
+ ### Minor Changes
230
+
231
+ - adiff init writes the review loop into a repository's agent instructions.
232
+
233
+ ## 0.1.0-alpha.26
234
+
235
+ ### Patch Changes
236
+
237
+ - A branch with no files left to read says so.
238
+
239
+ ## 0.1.0-alpha.25
240
+
241
+ ### Patch Changes
242
+
243
+ - The terminal names the key that sends a review, and counts what is waiting.
244
+
245
+ - The repository's own working tree is reviewable and marked here.
246
+
247
+ ## 0.1.0-alpha.24
248
+
249
+ ### Patch Changes
250
+
251
+ - A selection can be copied, or searched for across the branch's worktree with the matches listed and peeked at.
252
+
253
+ ## 0.1.0-alpha.23
254
+
255
+ ### Patch Changes
256
+
257
+ - A pinned scope wider than the pane can be panned into view, and the command palette opens over the review list.
258
+
259
+ ## 0.1.0-alpha.22
260
+
261
+ ### Patch Changes
262
+
263
+ - A selection reaching over hidden lines reports the range it will actually comment on.
264
+
265
+ - Composing on a row that carries no line says so instead of opening a panel that cannot send.
266
+
267
+ - The stale mark on the layer rail reads in full at any width.
268
+
269
+ ## 0.1.0-alpha.21
270
+
271
+ ### Patch Changes
272
+
273
+ - The store answers with the settings effect directly.
274
+
275
+ ## 0.1.0-alpha.20
276
+
277
+ ### Patch Changes
278
+
279
+ - Homebrew tracks each release.
280
+
281
+ ## 0.1.0-alpha.19
282
+
283
+ ### Patch Changes
284
+
285
+ - The house style lives in the linter, and a thread can be settled and folded from the terminal.
286
+
287
+ ## 0.1.0-alpha.18
288
+
289
+ ### Patch Changes
290
+
291
+ - The cursor stops on a thread so it can be settled directly, and a settled thread folds to one row.
292
+
293
+ ## 0.1.0-alpha.17
294
+
295
+ ### Patch Changes
296
+
297
+ - Say when an agent answers, settle a thread with d, and hold the comments still while the code pans.
298
+
299
+ ## 0.1.0-alpha.16
300
+
301
+ ### Patch Changes
302
+
303
+ - r reads the worktree list again, and notices reach the home screen.
304
+
305
+ ## 0.1.0-alpha.15
306
+
307
+ ### Patch Changes
308
+
309
+ - Pan the diff sideways to read past the right edge.
310
+
311
+ - The footer keeps the way out visible on a narrow terminal.
312
+
313
+ - Wrapping keeps every character and is remembered between sessions.
314
+
315
+ ## 0.1.0-alpha.14
316
+
317
+ ### Patch Changes
318
+
319
+ - V selects the change under the cursor, o grows a selection from its other end, and g and G reach the ends of the worktree list.
320
+
321
+ - w wraps long lines in the diff, and the cursor gutter stops at the last line.
322
+
323
+ ## 0.1.0-alpha.13
324
+
325
+ ### Patch Changes
326
+
327
+ - Reword or withdraw a staged comment, and see when a thread describes an older commit.
328
+
329
+ ## 0.1.0-alpha.12
330
+
331
+ ### Patch Changes
332
+
333
+ - An agent can answer a comment, and a reviewer can settle the thread.
334
+
335
+ ## 0.1.0-alpha.11
336
+
337
+ ### Patch Changes
338
+
339
+ - r reads the branch again, so the agent's newest work appears without leaving the review.
340
+
341
+ ## 0.1.0-alpha.10
342
+
343
+ ### Patch Changes
344
+
345
+ - The rail shows a layer's prose block by block, each above the file it introduces.
346
+
347
+ - layers show says a stale layer set needs a new revision.
348
+
349
+ ## 0.1.0-alpha.9
350
+
351
+ ### Patch Changes
352
+
353
+ - A seeded layer covers two files, so the demo shows what a layer spanning files looks like.
354
+
355
+ ## 0.1.0-alpha.8
356
+
357
+ ### Patch Changes
358
+
359
+ - The simulator seeds layers, so a demo run shows them.
360
+
361
+ - The worktree list says whether a branch already has a pull request.
362
+
363
+ ## 0.1.0-alpha.7
364
+
365
+ ### Patch Changes
366
+
367
+ - A layer's prose reads in the diff, above the code it introduces.
368
+
3
369
  ## 0.1.0-alpha.6
4
370
 
5
371
  ### Patch Changes
package/README.md CHANGED
@@ -2,76 +2,143 @@
2
2
 
3
3
  # adiff
4
4
 
5
- Review the work an agent did in a git worktree, in your terminal, and hand your comments back to
6
- the agent still sitting in that worktree. You select lines the way you would on GitHub, write a
7
- comment, and the agent picks it up.
5
+ An agent finishes a piece of work and leaves you a diff. You read it without knowing why any of it
6
+ was written that way, and asking means describing a line back in prose and reading the reply
7
+ somewhere far from the code it concerns. On a large change you carry the whole review in your head,
8
+ and it ends when your patience does.
8
9
 
9
- <pre align="center">brew install Newbie012/tap/adiff
10
- npm i -g @eliya-oss/agent-diff@alpha</pre>
10
+ adiff puts the conversation on the code. You comment on the lines in a terminal, the agent that
11
+ wrote them answers under your words, and a point stays open until you settle it.
12
+
13
+ The agent can also hand you a reading order: its own diff in layers, a note on each, and a coverage
14
+ check so nothing is quietly left out of the story.
15
+
16
+ <pre align="center">npm i -g @eliya-oss/agent-diff@alpha</pre>
17
+
18
+ <p align="center"><a href="docs/install.md">Other ways to install</a></p>
19
+
20
+ <img src="assets/terminal.webp" alt="The adiff worktree list, showing seven branches with their sizes, layers and review state" width="820">
11
21
 
12
22
  </div>
13
23
 
14
- ## Usage
24
+ ## The loop
25
+
26
+ You comment on a line:
15
27
 
16
28
  ```bash
17
- adiff review open --repo .
18
- adiff branch list --repo . --fields branch,files
19
- adiff comment add --repo . --branch add-teammate-invitations --file src/api/invitations.ts --start 4 --end 5 --body "why"
20
- adiff comment stage --repo . --branch add-teammate-invitations --file src/api/invitations.ts --start 4 --end 5 --body "why"
21
- adiff review submit --repo . --branch add-teammate-invitations
22
- adiff file vouch --repo . --branch add-teammate-invitations --file src/api/invitations.ts
23
- adiff layers show --worktree . --fields covered,total,uncovered
24
- adiff describe
29
+ adiff comment send --repo . --branch add-teammate-invitations \
30
+ --file src/api/invitations.ts --start 12 --end 13 \
31
+ --body "Three status checks in a row. One error shape would do."
25
32
  ```
26
33
 
27
- `comment add` reaches the agent right away. `comment stage` holds a comment until `review submit`
28
- sends the whole set as one wake-up, so the agent reads a review rather than a stream of remarks.
34
+ The agent in that worktree collects it, carrying the code it was written against:
29
35
 
30
- ## Reviewing
36
+ ```bash
37
+ adiff comment take --worktree .
38
+ {"ok":true,"comments":[{"id":"1c43cb55-6a09-406d-95ad-f048c43e05f5","file":"src/api/invitations.ts",
39
+ "side":"new","start":12,"end":13,"head":"63c11ce3",
40
+ "snippet":" if (res.status === 409) throw new AlreadyInvited(email)\n ...",
41
+ "body":"Three status checks in a row. One error shape would do."}]}
42
+ ```
43
+
44
+ It does the work, then answers the comment it was handed:
45
+
46
+ ```bash
47
+ adiff comment answer --worktree . --id 1c43cb55-6a09-406d-95ad-f048c43e05f5 \
48
+ --body "Folded them into one InviteRejected carrying the reason."
49
+ {"ok":true,"answered":1}
50
+ ```
51
+
52
+ You see that answer under your own words the next time you read the branch, and the thread waits
53
+ there until you settle it with `d`:
54
+
55
+ ```bash
56
+ adiff comment list --repo . --branch add-teammate-invitations
57
+ {"ok":true,"comments":[{"id":"1c43cb55-6a09-406d-95ad-f048c43e05f5","state":"answered",
58
+ "stale":false,"answers":[{"body":"Folded them into one InviteRejected carrying the reason.",
59
+ "asks":false}]}]}
60
+ ```
61
+
62
+ `--question` on an answer marks the thread as waiting on you, for a decision the agent needs before
63
+ it can carry on. Settling is yours alone: the agent that raised the answer cannot close the point.
31
64
 
32
- `adiff review open --repo .` lists the worktrees that have something to review. Enter opens one,
33
- `j` and `k` move down the diff, `[` and `]` move between files, `v` starts a selection, `c` writes
34
- a comment, `ctrl+s` sends it and `ctrl+a` adds it to the review instead. `m` marks a file reviewed,
35
- `ctrl+p` finds any command by name, and the footer lists the keys for wherever you are.
65
+ Every command that acts on a review takes either `--worktree <path>` or `--repo <path>` with
66
+ `--branch <name>`, so the same command works from your checkout and from the agent's worktree.
36
67
 
37
- Where the diff leaves lines out, a row says how many. Put the cursor on it and `l` brings ten of
38
- them back where you are standing, `h` puts them away again, and the rest of the file stays as small
39
- as it was. Opened lines are ordinary lines: you can select them and comment on them.
68
+ A comment is handed over exactly once, so a second `take` returns only what was written since. Add
69
+ `--wait 300` and it blocks until something arrives, which costs nothing while it waits.
40
70
 
41
- ## The agent side
71
+ ## The reading order
42
72
 
43
- In the worktree being reviewed:
73
+ An agent knows the order it built a change in. Rebuilding that order by reading forty files is the
74
+ expensive way to learn something it already has, so it can publish the reading itself when you ask
75
+ for one:
44
76
 
45
77
  ```bash
46
- adiff comment take --worktree . # everything written since the last take
47
- adiff comment take --worktree . --wait 300 # block until something arrives
78
+ adiff layers set --worktree . --json -
48
79
  ```
49
80
 
50
- Each comment carries the exact snippet it was written against, the side of the diff, and the commit
51
- the diff was read at, so the agent needs no other reference. A comment is handed over once.
81
+ Each layer is a claim over spans of the diff, with a note saying what the layer is for. The terminal
82
+ lists them in the sidebar and scopes the diff to the layer you are on, with the prose sitting above
83
+ the code it describes.
52
84
 
53
- An agent can also record the reading order for its own work as a layers: ordered layers over spans of
54
- files, set with `adiff layers set --worktree . --json -`. Where a branch has one, the terminal lists
55
- its layers and scopes the diff to the layer you are on. adiff computes the coverage itself, so a layers
56
- cannot hide code:
85
+ adiff computes the coverage itself, so the reading cannot hide code:
57
86
 
58
87
  ```bash
59
88
  adiff layers show --worktree . --fields covered,total,uncovered
60
- {"ok":true,"layers":{"covered":1,"total":3,"uncovered":[{"path":"docs/incidents.md","start":1,"end":6},{"path":"src/api/errors.ts","start":1,"end":11}]}}
89
+ {"ok":true,"layers":{"covered":3,"total":3,"uncovered":[]}}
61
90
  ```
62
91
 
63
- ## Skill
92
+ Any hunk no layer claims is reported here and shown to you under "not in any layer". The layers
93
+ record the commit they were written for, and adiff marks them stale once the branch moves past it.
94
+
95
+ ## Reviewing
96
+
97
+ `adiff review open --repo .` lists the worktrees with something to review, including the checkout
98
+ you are standing in. Enter opens one.
99
+
100
+ `j` and `k` move down the diff, `[` and `]` between files, `v` starts a selection and `c` writes a
101
+ comment. `ctrl+s` sends it on its own, `ctrl+a` adds it to a review you send in one go with `S`. `m`
102
+ marks a file reviewed, `d` settles the thread you are on, `s` swaps the sidebar between layers and
103
+ files, `w` wraps long lines, `/` searches for what you selected, `r` reads the branch again, and
104
+ `ctrl+p` finds any command by name. The footer lists the keys for wherever you are.
105
+
106
+ Where the diff leaves lines out, a row says how many. Put the cursor on it and `l` brings ten of them
107
+ back where you stand, `h` puts them away, and the rest of the file stays as small as it was. Opened
108
+ lines are ordinary lines: select them and comment on them.
109
+
110
+ ## Setting up a repository
111
+
112
+ ```bash
113
+ adiff init # shows what it would write
114
+ adiff init --write # writes it
115
+ ```
116
+
117
+ Writes a short passage into `AGENTS.md` and a `CLAUDE.md` that imports it, telling any agent working
118
+ in that repository how the handover runs. It sits between `<!-- adiff:begin -->` and
119
+ `<!-- adiff:end -->`, so a second run changes nothing and removing it is deleting a block you can
120
+ see. `--skill` also writes the full skill into `.claude/skills/adiff/`.
121
+
122
+ For a per-machine install instead:
64
123
 
65
124
  ```bash
66
125
  npx skills add Newbie012/agent-diff --skill adiff
67
126
  ```
68
127
 
69
- Teaches an agent the whole loop: collect comments, act on them, write the layers.
128
+ When someone asks for a review, the agent can put it in front of them:
129
+
130
+ ```bash
131
+ adiff review pane --repo .
132
+ {"ok":true,"opened":true,"pane":"tmux","command":"adiff review open --repo /work/api"}
133
+ ```
134
+
135
+ It splits tmux, Zellij, WezTerm or kitty. Anywhere else it answers `opened:false` and carries the
136
+ command to run, so the agent quotes one line rather than a paragraph.
70
137
 
71
138
  ## Requirements
72
139
 
73
- Either install gives you an `adiff` on your PATH. Brew brings a Node 26 along with it, so
74
- everything works the moment it finishes.
140
+ Either install gives you an `adiff` on your PATH. Brew brings a Node 26 along with it, so everything
141
+ works the moment it finishes.
75
142
 
76
143
  The commands run on Node 22 or newer. The terminal is the one part that wants Node 26: it draws
77
144
  through opentui, which reaches its native renderer over `node:ffi`, a module Node exposes behind
@@ -79,6 +146,8 @@ through opentui, which reaches its native renderer over `node:ffi`, a module Nod
79
146
  Node 26 among your fnm, nvm, asdf, volta and Homebrew installs and runs the terminal on that, so a
80
147
  global npm install keeps working across a version switch.
81
148
 
149
+ ## Trying it
150
+
82
151
  pnpm 12 is a Rust rewrite and still in beta, so
83
152
  [corepack cannot install it](https://pnpm.io/installation):
84
153
 
@@ -90,19 +159,21 @@ pnpm install
90
159
 
91
160
  `pnpm simulate` builds a throwaway repository with seven branches an agent has already worked on,
92
161
  from a three-file error type up to a 42-file migration of just over a thousand lines each way, and
93
- opens the terminal on it. Your real repos and `~/.adiff` are untouched, and the workspace is removed
94
- when you quit. `pnpm simulate --probe` runs the whole round trip headless and prints it:
162
+ opens the terminal on it. Your real repos and `~/.adiff` are untouched, and the workspace goes when
163
+ you quit. `pnpm simulate --probe` runs the whole round trip headless and prints it:
95
164
 
96
165
  ```
97
- branches {"ok":true,"branches":[{"branch":"add-teammate-invitations","files":3,"added":27,"removed":2,...
98
- vouch {"ok":true,"vouched":["src/api/incidents.ts"],"total":3}
99
- agent takes {"ok":true,"comments":[{"file":"src/api/incidents.ts","side":"new","start":12,"end":13,
100
- "snippet":" if (res.status === 404) throw new IncidentNotFound(id)\n if (!res.ok) ...",
101
- "body":"Two throws where one union would do."}]}
166
+ branches {"ok":true,"branches":[{"branch":"add-teammate-invitations","files":3,"added":27,"removed":2,"layers":2,...
167
+ reviewed {"ok":true,"reviewed":["src/api/invitations.ts"],"total":3}
168
+ agent takes {"ok":true,"comments":[{"id":"a83fc98c-8397-44f5-9c37-731a1cf3cb4c","file":"src/api/invitations.ts",
169
+ "side":"new","start":12,"end":13,"snippet":" if (res.status === 409) throw new AlreadyInvited(email)...",
170
+ "body":"Three status checks in a row. One error shape would do."}]}
102
171
  ```
103
172
 
104
173
  ## Notes
105
174
 
175
+ adiff is alpha, and one person's tool. Every release goes out under the `alpha` tag.
176
+
106
177
  Everything the terminal does is also a command, so nothing is trapped in the UI. Each command prints
107
178
  one compact JSON line on stdout and exits 0, and `--fields` trims the answer to what you read:
108
179
 
@@ -114,7 +185,7 @@ adiff branch list --repo . --fields branch,files
114
185
  Failures go to stderr as `{"ok":false,"error":{...}}`, so stdout is always parseable, with an exit
115
186
  code saying what to do about it: `2` malformed request, `3` not found, `1` unexpected. Every error
116
187
  carries a `suggestion` naming the command that resolves it, and `adiff describe` returns the whole
117
- catalog as JSON so a caller can discover the commands.
188
+ catalog as JSON so a caller can discover the rest.
118
189
 
119
190
  Project docs live in `.agents/`. `AGENTS.md` covers making a change, `ARCHITECTURE.md` how the code
120
191
  is laid out.
package/bin/adiff.js CHANGED
@@ -33,8 +33,9 @@ const drawsTerminal = (argv) => {
33
33
  }
34
34
 
35
35
  const rendersHere = () =>
36
- typeof process.getBuiltinModule === "function" &&
37
- process.getBuiltinModule("node:ffi") !== undefined
36
+ process.versions.bun !== undefined ||
37
+ (typeof process.getBuiltinModule === "function" &&
38
+ process.getBuiltinModule("node:ffi") !== undefined)
38
39
 
39
40
  const NODE_DIRECTORY = /^(?:v?\d|node)/
40
41