@eliya-oss/agent-diff 0.1.0-alpha.145 → 0.1.0-alpha.146
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 +38 -0
- package/README.md +8 -3
- package/dist/main.js +365 -24
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.146
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix(CLI): `adiff skill refresh` works on the Homebrew install, where it used to fail every time.
|
|
8
|
+
|
|
9
|
+
<details><summary>What was wrong</summary>
|
|
10
|
+
|
|
11
|
+
`skill refresh` found the skill it ships by walking up from its own module until it saw
|
|
12
|
+
`skills/adiff/SKILL.md` on disk. That file is in the npm package and in a checkout, and it is not in
|
|
13
|
+
the compiled binary Homebrew installs, so the command failed with "not found beside this build" and
|
|
14
|
+
a suggestion that blamed the directory it was writing to. The skill now travels inside the build.
|
|
15
|
+
|
|
16
|
+
This was the mechanism that answers a skill drifting from the adiff beside it, and it did not work on
|
|
17
|
+
the route the README leads with.
|
|
18
|
+
|
|
19
|
+
</details>
|
|
20
|
+
|
|
21
|
+
fix(upgrade): `adiff upgrade` says when it could not rewrite the installed skill.
|
|
22
|
+
|
|
23
|
+
<details><summary>What was wrong</summary>
|
|
24
|
+
|
|
25
|
+
`upgrade` ran `skill refresh` and mapped any failure to "nothing was refreshed", so an upgrade whose
|
|
26
|
+
skill refresh failed read exactly like one with no skill installed. That is why the Homebrew failure
|
|
27
|
+
above went unnoticed.
|
|
28
|
+
|
|
29
|
+
</details>
|
|
30
|
+
|
|
31
|
+
fix(CLI): `skill refresh` leaves a skill the skills CLI owns alone, and reports it as linked.
|
|
32
|
+
|
|
33
|
+
<details><summary>What was wrong</summary>
|
|
34
|
+
|
|
35
|
+
`npx skills add` installs a symlink by default. `skill refresh` wrote straight through it, editing a
|
|
36
|
+
clone inside that tool's cache — which the next `npx skills update` silently reverted. Two tools were
|
|
37
|
+
overwriting one file in turn. A link is now reported and left as it is.
|
|
38
|
+
|
|
39
|
+
</details>
|
|
40
|
+
|
|
3
41
|
## 0.1.0-alpha.145
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,11 +21,16 @@ pick up your comments:
|
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
brew install Newbie012/tap/adiff
|
|
24
|
-
npx skills add Newbie012/agent-diff --skill adiff
|
|
24
|
+
npx skills add Newbie012/agent-diff --skill adiff -g -y -a claude-code
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
The flags matter. `-g` puts the skill in your home directory rather than in the repository you are
|
|
28
|
+
standing in, which is what reaches an agent working in a worktree; `-y` and `-a claude-code` answer
|
|
29
|
+
the questions the skills CLI asks otherwise. Nothing lands in the repository, so there is nothing to
|
|
30
|
+
commit and nothing a teammate inherits — drop `-g` if your team has adopted adiff and wants the skill
|
|
31
|
+
in the repo.
|
|
32
|
+
|
|
33
|
+
Your agent finds the skill on its own from there.
|
|
29
34
|
|
|
30
35
|
Then ask it to walk you through it:
|
|
31
36
|
|
package/dist/main.js
CHANGED
|
@@ -5,7 +5,7 @@ import { text } from "node:stream/consumers";
|
|
|
5
5
|
import { execFile, spawn } from "node:child_process";
|
|
6
6
|
import { dirname, join, resolve } from "node:path";
|
|
7
7
|
import { promisify } from "node:util";
|
|
8
|
-
import { existsSync,
|
|
8
|
+
import { existsSync, lstatSync, mkdirSync, realpathSync, watch } from "node:fs";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, LineNumberRenderable, RGBA, StyledText, SyntaxStyle, TextRenderable, TextareaRenderable, bg, createCliRenderer, defaultTextareaKeyBindings, fg, getTreeSitterClient, pathToFiletype, stripAnsiSequences, t } from "@opentui/core";
|
|
11
11
|
//#region \0rolldown/runtime.js
|
|
@@ -10936,12 +10936,339 @@ var init_drafts = __esmMin((() => {
|
|
|
10936
10936
|
});
|
|
10937
10937
|
}));
|
|
10938
10938
|
//#endregion
|
|
10939
|
+
//#region src/cli/shipped-skill.ts
|
|
10940
|
+
var SHIPPED_SKILL;
|
|
10941
|
+
var init_shipped_skill = __esmMin((() => {
|
|
10942
|
+
SHIPPED_SKILL = [
|
|
10943
|
+
"---",
|
|
10944
|
+
"name: adiff",
|
|
10945
|
+
"description: Pick up review comments left on this worktree's diff in the adiff terminal, act on them, and answer them by id. Use when the user says they left comments, asks you to check adiff, asks you to watch for review feedback, or asks you to hand work over for review.",
|
|
10946
|
+
"---",
|
|
10947
|
+
"",
|
|
10948
|
+
"# adiff",
|
|
10949
|
+
"",
|
|
10950
|
+
"A human is reviewing your work in the adiff terminal. When they select lines and comment, the",
|
|
10951
|
+
"comment is filed against this worktree. This skill is how you collect those comments.",
|
|
10952
|
+
"",
|
|
10953
|
+
"## Collect what is waiting",
|
|
10954
|
+
"",
|
|
10955
|
+
"```bash",
|
|
10956
|
+
"adiff comment take --worktree .",
|
|
10957
|
+
"```",
|
|
10958
|
+
"",
|
|
10959
|
+
"Returns one JSON line:",
|
|
10960
|
+
"",
|
|
10961
|
+
"```json",
|
|
10962
|
+
"{\"ok\":true,\"comments\":[{\"at\":\"2026-07-30T09:12:04.881Z\",\"head\":\"8e67f663\",\"file\":\"src/api.ts\",\"side\":\"new\",\"start\":4,\"end\":5,\"snippet\":\" const third = 3\\n return first + second + third\",\"body\":\"third is unused outside this sum\"}]}",
|
|
10963
|
+
"```",
|
|
10964
|
+
"",
|
|
10965
|
+
"Each comment carries the code it is about. `snippet` is the exact text the reviewer had selected,",
|
|
10966
|
+
"`side` says whether the line numbers are in the new file (`new`) or the version being replaced",
|
|
10967
|
+
"(`old`), and `head` is the commit the diff was read at.",
|
|
10968
|
+
"",
|
|
10969
|
+
"A comment keeps coming back until it is answered. A second `take` returns it again, so answer what",
|
|
10970
|
+
"you take. Settling or removing it also retires it: those are the reviewer saying they no longer",
|
|
10971
|
+
"need one.",
|
|
10972
|
+
"",
|
|
10973
|
+
"## Wait for the next one",
|
|
10974
|
+
"",
|
|
10975
|
+
"```bash",
|
|
10976
|
+
"adiff comment take --worktree . --wait 300",
|
|
10977
|
+
"```",
|
|
10978
|
+
"",
|
|
10979
|
+
"Blocks until a comment arrives or the timeout in seconds elapses, then returns the same envelope.",
|
|
10980
|
+
"An empty `comments` array means the wait expired with nothing new — that is not an error.",
|
|
10981
|
+
"",
|
|
10982
|
+
"`--wait` takes a whole number of seconds from 1 to 86400. A value outside that is refused on",
|
|
10983
|
+
"stderr with exit 2, because an instant empty answer would read exactly like a wait that expired:",
|
|
10984
|
+
"if a wait comes back at once, you are not waiting.",
|
|
10985
|
+
"",
|
|
10986
|
+
"Arm the wait as the first thing you do in a turn, before the work. A turn that is interrupted",
|
|
10987
|
+
"half-way then still leaves a listener running, and a wait armed at the end of a turn is a wait that",
|
|
10988
|
+
"often never gets armed.",
|
|
10989
|
+
"",
|
|
10990
|
+
"Run the wait in the background, not in the foreground. A foreground wait holds the turn, so you",
|
|
10991
|
+
"cannot do anything else and the person you are working with cannot talk to you. Backgrounded, the",
|
|
10992
|
+
"harness brings you back the moment a comment lands.",
|
|
10993
|
+
"",
|
|
10994
|
+
"Keep one wait per worktree. A second wait returns the same comments as the first, so two of them",
|
|
10995
|
+
"running at once is two of you answering the same comment. Before starting one, check whether one is",
|
|
10996
|
+
"already running.",
|
|
10997
|
+
"",
|
|
10998
|
+
"Re-arm it after each comment you handle, and keep it running while you work. A reviewer reads at",
|
|
10999
|
+
"their own pace, so comments arrive minutes apart, and the whole point is that they reach you as",
|
|
11000
|
+
"events rather than by you asking. When you finish a piece of work, say you are still listening.",
|
|
11001
|
+
"",
|
|
11002
|
+
"A backgrounded wait that is killed rather than expiring is not the reviewer going quiet, and not a",
|
|
11003
|
+
"reason to stop listening. A kill loses whatever the wait would have handed you, so take once",
|
|
11004
|
+
"without `--wait` to collect what landed, then arm a new wait.",
|
|
11005
|
+
"",
|
|
11006
|
+
"## Answering a comment",
|
|
11007
|
+
"",
|
|
11008
|
+
"Say what you did, against the comment you were handed:",
|
|
11009
|
+
"",
|
|
11010
|
+
"```bash",
|
|
11011
|
+
"adiff comment answer --worktree . --id <id> --body \"Dropped it, and the import with it.\"",
|
|
11012
|
+
"```",
|
|
11013
|
+
"",
|
|
11014
|
+
"The id comes from `comment take`. The reviewer sees the answer under their own words the next time",
|
|
11015
|
+
"they read the branch, so this is how they learn a point was addressed rather than ignored.",
|
|
11016
|
+
"",
|
|
11017
|
+
"Answer when the change alone does not carry the reasoning: what you did instead of what was asked,",
|
|
11018
|
+
"what you found while doing it, or why the comment does not apply. A comment that asked a question",
|
|
11019
|
+
"deserves an answer even when nothing changed.",
|
|
11020
|
+
"",
|
|
11021
|
+
"Add `--question` when you need the reviewer to decide before you continue:",
|
|
11022
|
+
"",
|
|
11023
|
+
"```bash",
|
|
11024
|
+
"adiff comment answer --worktree . --id <id> --question --body \"Drop it, or keep it and map the error?\"",
|
|
11025
|
+
"```",
|
|
11026
|
+
"",
|
|
11027
|
+
"That marks the thread as waiting on them rather than on you. Do not use it to check in; use it when",
|
|
11028
|
+
"the work genuinely stops without an answer.",
|
|
11029
|
+
"",
|
|
11030
|
+
"## When the reviewer writes back",
|
|
11031
|
+
"",
|
|
11032
|
+
"A reviewer can reply to an answer, and the reply arrives through `comment take` like any other",
|
|
11033
|
+
"comment — with an `id` of its own that you answer against, and a `thread` carrying what was said",
|
|
11034
|
+
"before it, oldest first:",
|
|
11035
|
+
"",
|
|
11036
|
+
"```json",
|
|
11037
|
+
"{\"body\":\"the imports\",\"replyTo\":\"c1\",\"thread\":[{\"voice\":\"reviewer\",\"body\":\"why two of these\"},{\"voice\":\"agent\",\"body\":\"which two did you mean\"}]}",
|
|
11038
|
+
"```",
|
|
11039
|
+
"",
|
|
11040
|
+
"Read the thread before answering. A reply is usually short because it is the rest of a sentence you",
|
|
11041
|
+
"already have: \"the imports\" only means something next to the question it answers. Answer it against",
|
|
11042
|
+
"its own id, not the id of the comment that started the thread.",
|
|
11043
|
+
"",
|
|
11044
|
+
"Settling a thread is the reviewer's to do, not yours. They raised the point, so they decide it is",
|
|
11045
|
+
"closed.",
|
|
11046
|
+
"",
|
|
11047
|
+
"## Acting on a comment",
|
|
11048
|
+
"",
|
|
11049
|
+
"Read `snippet` before opening the file: the reviewer commented on the diff, and the file may have",
|
|
11050
|
+
"moved on since. If `head` no longer matches `git rev-parse --short HEAD`, the change you are being",
|
|
11051
|
+
"asked about may already be gone — say so rather than guessing at what they meant.",
|
|
11052
|
+
"",
|
|
11053
|
+
"Answer the comment by doing the work, not by replying. The reviewer is watching the diff; your",
|
|
11054
|
+
"next commit is the reply. When a comment is a question rather than a request, answer it in the",
|
|
11055
|
+
"commit message of the change it concerns, or plainly in chat if no change is needed.",
|
|
11056
|
+
"",
|
|
11057
|
+
"Handle every comment in the batch before taking again.",
|
|
11058
|
+
"",
|
|
11059
|
+
"## Failure",
|
|
11060
|
+
"",
|
|
11061
|
+
"Failures go to **stderr**, never stdout, so stdout is always safe to parse. The shape is",
|
|
11062
|
+
"`{\"ok\":false,\"error\":{\"type\":\"...\",\"retriable\":false,\"suggestion\":\"...\"}}`, and the exit code says",
|
|
11063
|
+
"what kind of problem it is: `2` the request was malformed, `3` the branch or file does not exist,",
|
|
11064
|
+
"`1` something unexpected.",
|
|
11065
|
+
"",
|
|
11066
|
+
"Every command that acts on a review takes either `--worktree <path>` or `--repo <path>` with",
|
|
11067
|
+
"`--branch <name>`. Standing in the worktree, `--worktree .` is always enough.",
|
|
11068
|
+
"",
|
|
11069
|
+
"Read `suggestion` before doing anything else — it names the command that resolves the failure.",
|
|
11070
|
+
"Retry only when `retriable` is true. `UnknownBranch` means this worktree is not one adiff knows",
|
|
11071
|
+
"about, because the reviewer has not opened it; report that rather than looping.",
|
|
11072
|
+
"",
|
|
11073
|
+
"## Handing work over",
|
|
11074
|
+
"",
|
|
11075
|
+
"Finishing is not a reason to publish anything. Say the work is ready, put the review in front of",
|
|
11076
|
+
"them if they asked for one, and say how to read it. That is the whole handover. A reading order is",
|
|
11077
|
+
"extra work you do on request, and it has its own section further down.",
|
|
11078
|
+
"",
|
|
11079
|
+
"## Put the review in front of them",
|
|
11080
|
+
"",
|
|
11081
|
+
"When someone asks you for a review, open it rather than describing how:",
|
|
11082
|
+
"",
|
|
11083
|
+
"```bash",
|
|
11084
|
+
"adiff review pane --repo <repo> --branch <branch>",
|
|
11085
|
+
"```",
|
|
11086
|
+
"",
|
|
11087
|
+
"It splits the pane they are already looking at, so their next move is to look right rather than to",
|
|
11088
|
+
"type. The answer says what happened:",
|
|
11089
|
+
"",
|
|
11090
|
+
"```json",
|
|
11091
|
+
"{\"ok\":true,\"opened\":true,\"pane\":\"tmux\",\"command\":\"adiff review open --repo /work/api --branch add-invitations\"}",
|
|
11092
|
+
"```",
|
|
11093
|
+
"",
|
|
11094
|
+
"`opened:false` means nothing could be split, which is ordinary: a terminal without tmux, Zellij,",
|
|
11095
|
+
"WezTerm or kitty has nowhere to put a pane. The answer carries `command` either way, so quote that",
|
|
11096
|
+
"line and let them run it.",
|
|
11097
|
+
"",
|
|
11098
|
+
"Open a pane when a review was asked for. Finishing work is not a reason on its own, and taking over",
|
|
11099
|
+
"someone's screen uninvited is worse than a line they have to copy.",
|
|
11100
|
+
"",
|
|
11101
|
+
"## Tell the reviewer how to read it",
|
|
11102
|
+
"",
|
|
11103
|
+
"Whether or not a pane opened, say what to do with it. Name the repository they should point at,",
|
|
11104
|
+
"which is the repository the worktree belongs to:",
|
|
11105
|
+
"",
|
|
11106
|
+
"> Open it with `adiff review open --repo <repo> --branch <branch>`, which lands on this branch's",
|
|
11107
|
+
"> diff. The sidebar lists the files; `j` and `k` move down the diff, `]` and `[` walk between",
|
|
11108
|
+
"> files, `}` and `{` jump to the next and previous change, `G` goes to the end. Select lines with",
|
|
11109
|
+
"> `v`, write a comment with `c`, and send it with `ctrl+s`. Press `?` for the rest.",
|
|
11110
|
+
"",
|
|
11111
|
+
"Fill the repository path and the branch in yourself, so nobody has to compose the command or find",
|
|
11112
|
+
"the branch in a list. `--branch` takes the name `branch list` reports; without it the review opens",
|
|
11113
|
+
"on the worktree list.",
|
|
11114
|
+
"",
|
|
11115
|
+
"Say what you want looked at hardest, and where you are unsure. A reviewer who knows which part you",
|
|
11116
|
+
"doubt spends their attention there. Offer a reading order rather than writing one: if the change is",
|
|
11117
|
+
"long enough that the order matters, say you can publish one and let them decide.",
|
|
11118
|
+
"",
|
|
11119
|
+
"## Publishing a reading order, when you are asked for one",
|
|
11120
|
+
"",
|
|
11121
|
+
"Only when the reviewer asks. A reading order is a real piece of work, it can be wrong, and one",
|
|
11122
|
+
"nobody wanted spends their attention on your summary rather than on the code.",
|
|
11123
|
+
"",
|
|
11124
|
+
"The ask often arrives as a comment. Pressing `L` in the review sends you one of these:",
|
|
11125
|
+
"",
|
|
11126
|
+
"- \"Please write a reading order for this branch with `adiff layers set` …\" — there is none yet.",
|
|
11127
|
+
"- \"The reading order on this branch describes an older commit …\" — read the diff again from",
|
|
11128
|
+
" scratch. Do not patch the old layers; line numbers have moved.",
|
|
11129
|
+
"- \"Please revise the reading order …\" — there is one and the reviewer wants it different. Ask what",
|
|
11130
|
+
" is wrong with it if the comment does not say.",
|
|
11131
|
+
"",
|
|
11132
|
+
"Answer it like any other comment when you are done.",
|
|
11133
|
+
"",
|
|
11134
|
+
"When they do ask, write **layers**: an ordered set over the diff, each one a claim about a span of",
|
|
11135
|
+
"code. The reviewer then walks the argument instead of the filesystem.",
|
|
11136
|
+
"",
|
|
11137
|
+
"```bash",
|
|
11138
|
+
"adiff layers set --worktree . --json - <<'JSON'",
|
|
11139
|
+
"{",
|
|
11140
|
+
" \"summary\": \"Team invitations, end to end\",",
|
|
11141
|
+
" \"layers\": [",
|
|
11142
|
+
" {",
|
|
11143
|
+
" \"title\": \"Add the invitation data model\",",
|
|
11144
|
+
" \"note\": \"The record every later layer leans on\",",
|
|
11145
|
+
" \"spans\": [{ \"path\": \"src/db/invites.ts\", \"start\": 1, \"end\": 48 }]",
|
|
11146
|
+
" },",
|
|
11147
|
+
" {",
|
|
11148
|
+
" \"title\": \"Add the invitation API\",",
|
|
11149
|
+
" \"spans\": [",
|
|
11150
|
+
" { \"path\": \"src/api/invites.ts\", \"start\": 1, \"end\": 96 },",
|
|
11151
|
+
" { \"path\": \"src/api/router.ts\", \"start\": 12, \"end\": 14 }",
|
|
11152
|
+
" ]",
|
|
11153
|
+
" },",
|
|
11154
|
+
" {",
|
|
11155
|
+
" \"title\": \"Build the invite & members UI\",",
|
|
11156
|
+
" \"spans\": [{ \"path\": \"src/ui/Members.tsx\", \"start\": 1, \"end\": 210 }]",
|
|
11157
|
+
" }",
|
|
11158
|
+
" ]",
|
|
11159
|
+
"}",
|
|
11160
|
+
"JSON",
|
|
11161
|
+
"```",
|
|
11162
|
+
"",
|
|
11163
|
+
"Rules that make a layers worth reading:",
|
|
11164
|
+
"",
|
|
11165
|
+
"- **Order is the point.** Layer 1 is what the reader must understand before layer 2 makes sense.",
|
|
11166
|
+
" Data model, then the code that uses it, then the surface, then the mechanical bits last.",
|
|
11167
|
+
"- **A title is a claim, not a file name.** \"Add the invitation API\", never \"changes to",
|
|
11168
|
+
" src/api/invites.ts\".",
|
|
11169
|
+
"- **Line numbers are the new side of the diff**, the same numbers `adiff comment take` reports.",
|
|
11170
|
+
"- **Cover everything.** adiff computes coverage itself and answers with the changed lines no layer",
|
|
11171
|
+
" claims; those show up for the reviewer under \"not in any layer\" whatever you do. A layer set that",
|
|
11172
|
+
" quietly skips a third of the diff is worse than none, so put the leftovers in a final layer and",
|
|
11173
|
+
" say they are mechanical. Claim the lines you actually read: a span reaching past them counts only",
|
|
11174
|
+
" the changed lines inside it, so padding the range buys nothing.",
|
|
11175
|
+
"",
|
|
11176
|
+
"The answer to `layers set` is the honest report — check it before you claim to be done:",
|
|
11177
|
+
"",
|
|
11178
|
+
"```json",
|
|
11179
|
+
"{\"ok\":true,\"layers\":{\"version\":1,\"stale\":false,\"covered\":7,\"partial\":1,\"total\":9,\"uncovered\":[{\"path\":\"src/api/router.ts\",\"start\":40,\"end\":52}],\"vanished\":[],\"layers\":[{\"title\":\"Add the invitation data model\",\"files\":[\"src/db/invites.ts\"],\"covered\":1,\"partial\":0,\"vanished\":[]}]}}",
|
|
11180
|
+
"",
|
|
11181
|
+
"`covered`, `partial` and `vanished` appear per layer as well as for the document, so you can tell",
|
|
11182
|
+
"which of your own layers is the thin one. `vanished` on a layer names paths it claims that are not",
|
|
11183
|
+
"in the diff — usually a typo or a file that moved.",
|
|
11184
|
+
"",
|
|
11185
|
+
"`layers set` refuses a document it cannot use and says which layer is wrong and why: a span that",
|
|
11186
|
+
"ends before it starts, a span starting below line 1, a start or end that is not a whole number, a",
|
|
11187
|
+
"block with no `kind`, a layer with no title. It no longer drops a bad span quietly, so a layer that",
|
|
11188
|
+
"used to cover less than you thought now fails loudly instead.",
|
|
11189
|
+
"```",
|
|
11190
|
+
"",
|
|
11191
|
+
"`total` counts hunks. `covered` counts the ones where every changed line sits inside a layer, and",
|
|
11192
|
+
"`partial` the ones a layer explains only some of. `uncovered` names the runs of changed lines no",
|
|
11193
|
+
"layer claims, so it reads as line numbers a reviewer would otherwise have to find alone: claim them",
|
|
11194
|
+
"and set the layers again. Done means `uncovered` is empty. `vanished` names paths a layer points at",
|
|
11195
|
+
"that this branch does not change, which usually means a typo in a path. Read it back at any time",
|
|
11196
|
+
"with:",
|
|
11197
|
+
"",
|
|
11198
|
+
"```bash",
|
|
11199
|
+
"adiff layers show --worktree . --fields covered,partial,total,uncovered",
|
|
11200
|
+
"```",
|
|
11201
|
+
"",
|
|
11202
|
+
"`uncovered` does not always empty out by claiming lines you can see. A deleted line is counted at",
|
|
11203
|
+
"the number it had in the old file, so a branch that cuts a file from 409 lines to 394 reports an",
|
|
11204
|
+
"uncovered run at 395-409 — line numbers past the end of the file as it now stands. A span over the",
|
|
11205
|
+
"new file cannot reach them; only a span whose `end` runs past the end of the file can. Write one, or",
|
|
11206
|
+
"say the run is unreachable, rather than reading the leftover as a layer you forgot.",
|
|
11207
|
+
"",
|
|
11208
|
+
"That is also the case for spans generally: `start` 1 to past the last line covers a file whatever",
|
|
11209
|
+
"happens to it, while a tight range goes stale on the next push that moves the lines under it.",
|
|
11210
|
+
"",
|
|
11211
|
+
"Setting layers again supersedes the previous set and bumps `version`; the set records the commit it",
|
|
11212
|
+
"was written for, and adiff reports it as `stale` once the branch moves past that commit. Once a",
|
|
11213
|
+
"reviewer has a reading order, keep it true: write it again after you address their comments.",
|
|
11214
|
+
"",
|
|
11215
|
+
"When you have published one, tell them the sidebar now holds it: `s` swaps between the layers and",
|
|
11216
|
+
"the files, each layer shows the files it covers with the ones already reviewed ticked off, and `]`",
|
|
11217
|
+
"and `[` walk those files in the order you put them in — from the last file of one layer into the",
|
|
11218
|
+
"first of the next.",
|
|
11219
|
+
"",
|
|
11220
|
+
"## Helping draft a review of somebody else's pull request",
|
|
11221
|
+
"",
|
|
11222
|
+
"Sometimes the reviewer is not reading your work — they are reading a stranger's pull request and",
|
|
11223
|
+
"want you to think it through with them before they say anything on it. There, a comment is not an",
|
|
11224
|
+
"instruction to you. It is a draft of what the reviewer will say, in the reviewer's name.",
|
|
11225
|
+
"",
|
|
11226
|
+
"Comments on a pull request are **held**. Nothing reaches the forge until the reviewer sends them.",
|
|
11227
|
+
"",
|
|
11228
|
+
"```bash",
|
|
11229
|
+
"adiff draft list --repo . --branch their-change",
|
|
11230
|
+
"adiff draft add --repo . --branch their-change --file src/api.ts --start 40 --end 52 --body \"…\"",
|
|
11231
|
+
"adiff draft edit --repo . --branch their-change --id d1 --body \"…\"",
|
|
11232
|
+
"adiff draft drop --repo . --branch their-change --id d1",
|
|
11233
|
+
"```",
|
|
11234
|
+
"",
|
|
11235
|
+
"`draft add` anchors the same way `comment send` does, so `--side old` is the version being replaced.",
|
|
11236
|
+
"",
|
|
11237
|
+
"Rules for drafting on somebody else's behalf:",
|
|
11238
|
+
"",
|
|
11239
|
+
"- **You never send.** There is no command that dispatches, on purpose. The reviewer signs the",
|
|
11240
|
+
" review, so the reviewer sends it.",
|
|
11241
|
+
"- **Write what the reviewer meant, not what you would say.** They told you the point; your job is",
|
|
11242
|
+
" the wording. If you are not sure what the point is, ask rather than inventing one.",
|
|
11243
|
+
"- **One draft per point.** A held comment that covers three things cannot be dropped in part.",
|
|
11244
|
+
"- **Say what you drafted.** List the drafts back after you write them, so the reviewer can read",
|
|
11245
|
+
" them over rather than discovering them at the moment of sending.",
|
|
11246
|
+
"- **A draft is not a review of the reviewer.** Do not soften a point they meant sharply, or sharpen",
|
|
11247
|
+
" one they meant gently.",
|
|
11248
|
+
"",
|
|
11249
|
+
"## Discovering the rest",
|
|
11250
|
+
"",
|
|
11251
|
+
"```bash",
|
|
11252
|
+
"adiff describe",
|
|
11253
|
+
"```",
|
|
11254
|
+
"",
|
|
11255
|
+
"Returns every command with its options, which are required, which part of the loop it belongs to,",
|
|
11256
|
+
"and where its payload sits. `adiff <command> --help` says the same for one command in plain text.",
|
|
11257
|
+
"Use either instead of guessing, and use `--fields` to keep answers small:",
|
|
11258
|
+
"",
|
|
11259
|
+
"```bash",
|
|
11260
|
+
"adiff branch list --repo . --fields branch,files",
|
|
11261
|
+
"```",
|
|
11262
|
+
""
|
|
11263
|
+
].join("\n");
|
|
11264
|
+
}));
|
|
11265
|
+
//#endregion
|
|
10939
11266
|
//#region src/cli/skill.ts
|
|
10940
|
-
var
|
|
11267
|
+
var readAt, writeAt, SKILL_AT, isLink, refreshAt, settledRoot, refreshSkill;
|
|
10941
11268
|
var init_skill = __esmMin((() => {
|
|
10942
11269
|
init_dist();
|
|
10943
11270
|
init_error();
|
|
10944
|
-
|
|
11271
|
+
init_shipped_skill();
|
|
10945
11272
|
readAt = fn("Cli.readAt")(function* (path) {
|
|
10946
11273
|
return yield* tryPromise({
|
|
10947
11274
|
try: () => readFile(path, "utf8"),
|
|
@@ -10960,21 +11287,21 @@ var init_skill = __esmMin((() => {
|
|
|
10960
11287
|
})
|
|
10961
11288
|
});
|
|
10962
11289
|
});
|
|
10963
|
-
skillSource = () => {
|
|
10964
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
10965
|
-
return Array.from({ length: REACH }, (_, layer) => join(here, ...Array(layer).fill(".."))).map((at) => join(at, "skills", "adiff", "SKILL.md")).find((path) => existsSync(path));
|
|
10966
|
-
};
|
|
10967
|
-
shippedSkill = fn("Cli.shippedSkill")(function* () {
|
|
10968
|
-
const source = skillSource();
|
|
10969
|
-
return yield* source === void 0 ? new InitUnwritable({
|
|
10970
|
-
path: "skills/adiff/SKILL.md",
|
|
10971
|
-
reason: "not found beside this build"
|
|
10972
|
-
}) : sync(() => readFileSync(source, "utf8"));
|
|
10973
|
-
});
|
|
10974
11290
|
SKILL_AT = join(".claude", "skills", "adiff", "SKILL.md");
|
|
11291
|
+
isLink = (path) => {
|
|
11292
|
+
try {
|
|
11293
|
+
return lstatSync(path).isSymbolicLink();
|
|
11294
|
+
} catch {
|
|
11295
|
+
return false;
|
|
11296
|
+
}
|
|
11297
|
+
};
|
|
10975
11298
|
refreshAt = fn("Cli.refreshAt")(function* (root, wanted) {
|
|
10976
11299
|
const path = join(root, SKILL_AT);
|
|
10977
11300
|
if (!existsSync(path)) return [];
|
|
11301
|
+
if (isLink(path)) return [{
|
|
11302
|
+
path,
|
|
11303
|
+
action: "linked"
|
|
11304
|
+
}];
|
|
10978
11305
|
const current = yield* readAt(path);
|
|
10979
11306
|
if (getOrUndefined$1(current) === wanted) return [{
|
|
10980
11307
|
path,
|
|
@@ -10994,10 +11321,9 @@ var init_skill = __esmMin((() => {
|
|
|
10994
11321
|
}
|
|
10995
11322
|
};
|
|
10996
11323
|
refreshSkill = fn("Cli.refreshSkill")(function* (roots) {
|
|
10997
|
-
const wanted = yield* shippedSkill();
|
|
10998
11324
|
const seen = [...new Set(roots.map(settledRoot))];
|
|
10999
11325
|
const found = [];
|
|
11000
|
-
for (const root of seen) found.push(...yield* refreshAt(root,
|
|
11326
|
+
for (const root of seen) found.push(...yield* refreshAt(root, SHIPPED_SKILL));
|
|
11001
11327
|
return { changes: found };
|
|
11002
11328
|
});
|
|
11003
11329
|
}));
|
|
@@ -11109,10 +11435,10 @@ var init_pane = __esmMin((() => {
|
|
|
11109
11435
|
init_drafts();
|
|
11110
11436
|
init_skill();
|
|
11111
11437
|
init_pane();
|
|
11112
|
-
var version$1 = "0.1.0-alpha.
|
|
11438
|
+
var version$1 = "0.1.0-alpha.146";
|
|
11113
11439
|
//#endregion
|
|
11114
11440
|
//#region src/cli/upgrade.ts
|
|
11115
|
-
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, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
|
|
11441
|
+
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, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, NOT_ASKED, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
|
|
11116
11442
|
var init_upgrade$1 = __esmMin((() => {
|
|
11117
11443
|
init_dist();
|
|
11118
11444
|
PACKAGE = "@eliya-oss/agent-diff";
|
|
@@ -11270,6 +11596,10 @@ var init_upgrade$1 = __esmMin((() => {
|
|
|
11270
11596
|
return `Ran \`${found.command}\`, and adiff ${found.latest} is installed now.`;
|
|
11271
11597
|
};
|
|
11272
11598
|
REFRESH_MS = 1e4;
|
|
11599
|
+
NOT_ASKED = {
|
|
11600
|
+
updated: [],
|
|
11601
|
+
failed: false
|
|
11602
|
+
};
|
|
11273
11603
|
refreshSkills = ranChild({
|
|
11274
11604
|
command: "adiff",
|
|
11275
11605
|
args: [
|
|
@@ -11283,14 +11613,21 @@ var init_upgrade$1 = __esmMin((() => {
|
|
|
11283
11613
|
"pipe",
|
|
11284
11614
|
"ignore"
|
|
11285
11615
|
]
|
|
11286
|
-
}, (code, said) => code === 0 ?
|
|
11616
|
+
}, (code, said) => code === 0 ? {
|
|
11617
|
+
updated: updatedIn(said),
|
|
11618
|
+
failed: false
|
|
11619
|
+
} : {
|
|
11620
|
+
updated: [],
|
|
11621
|
+
failed: true
|
|
11622
|
+
}, NOT_ASKED).pipe(withSpan("Cli.refreshedSkill"));
|
|
11287
11623
|
updatedIn = (said) => {
|
|
11288
11624
|
return (runSync(try_(() => JSON.parse(said)).pipe(orElseSucceed(() => ({})))).changes ?? []).filter((change) => change.action === "update").flatMap((change) => change.path === void 0 ? [] : [change.path]);
|
|
11289
11625
|
};
|
|
11290
|
-
sayRefreshed = (
|
|
11291
|
-
|
|
11626
|
+
sayRefreshed = (refreshed) => {
|
|
11627
|
+
if (refreshed.failed) return "The skill installed beside this could not be rewritten, so it still describes the older adiff. Run `adiff skill refresh` to see why.";
|
|
11628
|
+
const first = refreshed.updated[0];
|
|
11292
11629
|
if (first === void 0) return void 0;
|
|
11293
|
-
const rest =
|
|
11630
|
+
const rest = refreshed.updated.length - 1;
|
|
11294
11631
|
return rest === 0 ? `The skill at ${first} is the newest one too.` : `The skill at ${first} and ${rest} more is the newest one too.`;
|
|
11295
11632
|
};
|
|
11296
11633
|
upgradeReport = (found, ran, check) => {
|
|
@@ -20071,6 +20408,10 @@ const reviewPane = fn("Main.reviewPane")(function* (options) {
|
|
|
20071
20408
|
});
|
|
20072
20409
|
});
|
|
20073
20410
|
const say = (line) => sync(() => process.stdout.write(line));
|
|
20411
|
+
const NOTHING_REFRESHED = {
|
|
20412
|
+
updated: [],
|
|
20413
|
+
failed: false
|
|
20414
|
+
};
|
|
20074
20415
|
const settledUpgrade = (found, check, ran) => sync(() => {
|
|
20075
20416
|
if (check || found.current === true || ran) return;
|
|
20076
20417
|
process.exitCode = 1;
|
|
@@ -20112,9 +20453,9 @@ const routes = {
|
|
|
20112
20453
|
const upgrading = willUpgrade(found, check);
|
|
20113
20454
|
if (!quiet) yield* say(`${sayFound(found, check)}\n${upgrading ? "\n" : ""}`);
|
|
20114
20455
|
const ran = upgrading ? yield* runUpgrade(found, quiet) : false;
|
|
20115
|
-
const skills = ran ? yield* refreshSkills :
|
|
20456
|
+
const skills = ran ? yield* refreshSkills : NOTHING_REFRESHED;
|
|
20116
20457
|
if (quiet) {
|
|
20117
|
-
const also = skills.length === 0 ? {} : { skills };
|
|
20458
|
+
const also = skills.updated.length === 0 ? {} : { skills: skills.updated };
|
|
20118
20459
|
return yield* answer(options, {
|
|
20119
20460
|
upgrade: upgradeReport(found, ran, check),
|
|
20120
20461
|
...also
|
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.146",
|
|
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": {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"check": "pnpm run typecheck && pnpm run lint && pnpm run build && pnpm test",
|
|
44
44
|
"build": "rolldown -c rolldown.config.ts",
|
|
45
|
+
"embed-skill": "node --experimental-ffi --disable-warning=ExperimentalWarning scripts/embed-skill.ts",
|
|
45
46
|
"typecheck": "tsc --noEmit",
|
|
46
47
|
"lint": "oxlint && node scripts/check-rules.ts",
|
|
47
48
|
"test": "NODE_OPTIONS=--experimental-ffi vitest run",
|