@eliya-oss/agent-diff 0.1.0-alpha.5 → 0.1.0-alpha.50

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
 
@@ -16,7 +16,7 @@ PRDs are not the place for every implementation detail. Use the split below:
16
16
  - Read `CONTEXT.md` next. The glossary defines the vocabulary every PRD reuses. adiff has a short
17
17
  language on purpose; a synonym invented in a PRD is a defect.
18
18
  - Read the PRD that owns the behavior. Follow its links to ADRs for durable choices and issues for
19
- implementation steps.
19
+ implementation layers.
20
20
 
21
21
  ## How to write a new PRD
22
22
 
@@ -64,7 +64,7 @@ Before treating a PRD as ready:
64
64
 
65
65
  - [ ] Problem stated from the reviewer's or the agent's perspective, not the code's.
66
66
  - [ ] Solution stated as observable behavior, before any implementation choice is named.
67
- - [ ] User stories cover the happy path, the empty result, the refusal, and the stale case.
67
+ - [ ] User layers cover the happy path, the empty result, the refusal, and the stale case.
68
68
  - [ ] Implementation Decisions are concrete enough that two engineers would build interchangeable
69
69
  implementations.
70
70
  - [ ] File paths, helper names, and rollout order live in GitHub issues.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,305 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.50
4
+
5
+ ### Patch Changes
6
+
7
+ - `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.
8
+
9
+ ## 0.1.0-alpha.49
10
+
11
+ ### Patch Changes
12
+
13
+ - `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.
14
+
15
+ ## 0.1.0-alpha.48
16
+
17
+ ### Patch Changes
18
+
19
+ - `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.
20
+
21
+ - 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`.
22
+
23
+ - 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.
24
+
25
+ - 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.
26
+
27
+ ## 0.1.0-alpha.47
28
+
29
+ ### Minor Changes
30
+
31
+ - `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.
32
+
33
+ ## 0.1.0-alpha.46
34
+
35
+ ### Patch Changes
36
+
37
+ - 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.
38
+
39
+ ## 0.1.0-alpha.45
40
+
41
+ ### Patch Changes
42
+
43
+ - 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.
44
+
45
+ ## 0.1.0-alpha.44
46
+
47
+ ### Patch Changes
48
+
49
+ - 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.
50
+
51
+ ## 0.1.0-alpha.43
52
+
53
+ ### Patch Changes
54
+
55
+ - 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.
56
+
57
+ ## 0.1.0-alpha.42
58
+
59
+ ### Minor Changes
60
+
61
+ - 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`.
62
+
63
+ ### Patch Changes
64
+
65
+ - `--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.
66
+
67
+ ## 0.1.0-alpha.41
68
+
69
+ ### Patch Changes
70
+
71
+ - 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.
72
+
73
+ ## 0.1.0-alpha.40
74
+
75
+ ### Patch Changes
76
+
77
+ - `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.
78
+
79
+ ## 0.1.0-alpha.39
80
+
81
+ ### Patch Changes
82
+
83
+ - `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.
84
+
85
+ ## 0.1.0-alpha.38
86
+
87
+ ### Patch Changes
88
+
89
+ - 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.
90
+
91
+ ## 0.1.0-alpha.37
92
+
93
+ ### Patch Changes
94
+
95
+ - The footer carries the keys a review is made of, and ? lists every key the screen answers to.
96
+
97
+ ## 0.1.0-alpha.36
98
+
99
+ ### Patch Changes
100
+
101
+ - 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.
102
+
103
+ ## 0.1.0-alpha.35
104
+
105
+ ### Patch Changes
106
+
107
+ - A comment can be removed from the review and restored, and the record keeps it either way.
108
+
109
+ ## 0.1.0-alpha.34
110
+
111
+ ### Patch Changes
112
+
113
+ - A file name too long for the tree keeps its end, where the extension and the distinguishing word live.
114
+
115
+ ## 0.1.0-alpha.33
116
+
117
+ ### Patch Changes
118
+
119
+ - The store reports a damaged file instead of failing unexpectedly.
120
+
121
+ ## 0.1.0-alpha.32
122
+
123
+ ### Patch Changes
124
+
125
+ - The skill publishes a reading order on request, and tells the reviewer how to open the review.
126
+
127
+ ## 0.1.0-alpha.31
128
+
129
+ ### Patch Changes
130
+
131
+ - Coverage counts the changed lines a layer claims, not the hunks a span touches.
132
+
133
+ ## 0.1.0-alpha.30
134
+
135
+ ### Patch Changes
136
+
137
+ - The palette keeps a command's name clear of its category.
138
+
139
+ ## 0.1.0-alpha.29
140
+
141
+ ### Patch Changes
142
+
143
+ - First contact teaches the loop, an empty collection says what to do next, and a worktree error explains the path.
144
+
145
+ ## 0.1.0-alpha.28
146
+
147
+ ### Patch Changes
148
+
149
+ - An agent can open the review in a split pane beside the conversation.
150
+
151
+ ## 0.1.0-alpha.27
152
+
153
+ ### Minor Changes
154
+
155
+ - adiff init writes the review loop into a repository's agent instructions.
156
+
157
+ ## 0.1.0-alpha.26
158
+
159
+ ### Patch Changes
160
+
161
+ - A branch with no files left to read says so.
162
+
163
+ ## 0.1.0-alpha.25
164
+
165
+ ### Patch Changes
166
+
167
+ - The terminal names the key that sends a review, and counts what is waiting.
168
+
169
+ - The repository's own working tree is reviewable and marked here.
170
+
171
+ ## 0.1.0-alpha.24
172
+
173
+ ### Patch Changes
174
+
175
+ - A selection can be copied, or searched for across the branch's worktree with the matches listed and peeked at.
176
+
177
+ ## 0.1.0-alpha.23
178
+
179
+ ### Patch Changes
180
+
181
+ - A pinned scope wider than the pane can be panned into view, and the command palette opens over the review list.
182
+
183
+ ## 0.1.0-alpha.22
184
+
185
+ ### Patch Changes
186
+
187
+ - A selection reaching over hidden lines reports the range it will actually comment on.
188
+
189
+ - Composing on a row that carries no line says so instead of opening a panel that cannot send.
190
+
191
+ - The stale mark on the layer rail reads in full at any width.
192
+
193
+ ## 0.1.0-alpha.21
194
+
195
+ ### Patch Changes
196
+
197
+ - The store answers with the settings effect directly.
198
+
199
+ ## 0.1.0-alpha.20
200
+
201
+ ### Patch Changes
202
+
203
+ - Homebrew tracks each release.
204
+
205
+ ## 0.1.0-alpha.19
206
+
207
+ ### Patch Changes
208
+
209
+ - The house style lives in the linter, and a thread can be settled and folded from the terminal.
210
+
211
+ ## 0.1.0-alpha.18
212
+
213
+ ### Patch Changes
214
+
215
+ - The cursor stops on a thread so it can be settled directly, and a settled thread folds to one row.
216
+
217
+ ## 0.1.0-alpha.17
218
+
219
+ ### Patch Changes
220
+
221
+ - Say when an agent answers, settle a thread with d, and hold the comments still while the code pans.
222
+
223
+ ## 0.1.0-alpha.16
224
+
225
+ ### Patch Changes
226
+
227
+ - r reads the worktree list again, and notices reach the home screen.
228
+
229
+ ## 0.1.0-alpha.15
230
+
231
+ ### Patch Changes
232
+
233
+ - Pan the diff sideways to read past the right edge.
234
+
235
+ - The footer keeps the way out visible on a narrow terminal.
236
+
237
+ - Wrapping keeps every character and is remembered between sessions.
238
+
239
+ ## 0.1.0-alpha.14
240
+
241
+ ### Patch Changes
242
+
243
+ - 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.
244
+
245
+ - w wraps long lines in the diff, and the cursor gutter stops at the last line.
246
+
247
+ ## 0.1.0-alpha.13
248
+
249
+ ### Patch Changes
250
+
251
+ - Reword or withdraw a staged comment, and see when a thread describes an older commit.
252
+
253
+ ## 0.1.0-alpha.12
254
+
255
+ ### Patch Changes
256
+
257
+ - An agent can answer a comment, and a reviewer can settle the thread.
258
+
259
+ ## 0.1.0-alpha.11
260
+
261
+ ### Patch Changes
262
+
263
+ - r reads the branch again, so the agent's newest work appears without leaving the review.
264
+
265
+ ## 0.1.0-alpha.10
266
+
267
+ ### Patch Changes
268
+
269
+ - The rail shows a layer's prose block by block, each above the file it introduces.
270
+
271
+ - layers show says a stale layer set needs a new revision.
272
+
273
+ ## 0.1.0-alpha.9
274
+
275
+ ### Patch Changes
276
+
277
+ - A seeded layer covers two files, so the demo shows what a layer spanning files looks like.
278
+
279
+ ## 0.1.0-alpha.8
280
+
281
+ ### Patch Changes
282
+
283
+ - The simulator seeds layers, so a demo run shows them.
284
+
285
+ - The worktree list says whether a branch already has a pull request.
286
+
287
+ ## 0.1.0-alpha.7
288
+
289
+ ### Patch Changes
290
+
291
+ - A layer's prose reads in the diff, above the code it introduces.
292
+
293
+ ## 0.1.0-alpha.6
294
+
295
+ ### Patch Changes
296
+
297
+ - The diff holds still when a trackpad gesture drifts sideways.
298
+
299
+ - The reading order an agent writes is called layers. adiff layers set and adiff layers show replace the story verbs, and the JSON carries layers where it carried steps.
300
+
301
+ - A layer lists the files it covers, and the footer says how to switch between layers and files.
302
+
3
303
  ## 0.1.0-alpha.5
4
304
 
5
305
  ### 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 story 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 story: ordered steps over spans of
54
- files, set with `adiff story set --worktree . --json -`. Where a branch has one, the terminal lists
55
- its steps and scopes the diff to the step you are on. adiff computes the coverage itself, so a story
56
- cannot hide code:
85
+ adiff computes the coverage itself, so the reading cannot hide code:
57
86
 
58
87
  ```bash
59
- adiff story show --worktree . --fields covered,total,uncovered
60
- {"ok":true,"story":{"covered":1,"total":3,"uncovered":[{"path":"docs/incidents.md","start":1,"end":6},{"path":"src/api/errors.ts","start":1,"end":11}]}}
88
+ adiff layers show --worktree . --fields covered,total,uncovered
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 story.
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