@eliya-oss/agent-diff 0.1.0-alpha.200 → 0.1.0-alpha.201

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.
@@ -19,8 +19,10 @@ pnpm record
19
19
 
20
20
  It reads the test files this branch changed against `origin/main`, runs them with tracing on, and for
21
21
  each test builds its world into a real repository, boots adiff in a real terminal, replays the keys
22
- the test pressed, encodes an mp4 and uploads it. It prints a finished `## Recorded tests` section.
23
- Paste that under the body.
22
+ the test pressed, and encodes an mp4 into `shots/`. It uploads nothing. It prints a finished
23
+ `## Recorded tests` section whose films point at their local paths, and the `--attach` flags that
24
+ upload them. Paste the section under the body and pass the flags to `gh pr create` or `gh pr edit`
25
+ (see **Upload**).
24
26
 
25
27
  `pnpm record --test <path>` records one file instead of the whole branch. `pnpm record --base
26
28
  <branch>` reads the branch against something other than `origin/main`, which is what a PR stacked on
@@ -70,9 +72,8 @@ So a test that needs one of those things has two honest endings, and no third:
70
72
  pnpm shot --trace <trace.jsonl> --test-name "<when> > <then>" --local
71
73
  ```
72
74
 
73
- `--local` writes the frame to `shots/` and uploads nothing, so reading it first publishes nothing.
74
- Leave `--local` off once the frame is the one you meant, and the capture uploads and prints the
75
- markdown to paste.
75
+ `--local` writes the frame to `shots/` and prints its path. Nothing a capture makes is published
76
+ until `gh --attach` uploads it, so read every still and film before it goes on a pull request.
76
77
 
77
78
  The still is the last frame of the film. If it does not show the behavior the test names, the film
78
79
  does not either — and a film that shows the wrong screen is worse than no film, because a reviewer
@@ -81,7 +82,7 @@ output; to keep one, run the tests yourself with `ADIFF_TRACE=<path>` set.
81
82
 
82
83
  A run appends to that file rather than replacing it, so running the same test into it twice leaves
83
84
  two traces under one name. The capture takes the newest, so a re-run shows the re-run. A trace the
84
- test marked unreplayable is refused, naming the route the test took, so nothing is uploaded from it.
85
+ test marked unreplayable is refused, naming the route the test took, so nothing is made from it.
85
86
 
86
87
  ## What gets recorded
87
88
 
@@ -101,18 +102,39 @@ test. Do not invent keystrokes to make one.
101
102
  <details>
102
103
  <summary><code>then the keys are already on the comments</code></summary>
103
104
 
104
- <bare user-attachments URL>
105
+ ![then the keys are already on the comments](./shots/when-the-review-panel-is-opened-then-the-keys-are-already-on-the-comments.mp4)
105
106
 
106
107
  </details>
107
108
  ```
108
109
 
109
110
  The `describe` is the plain-text list item and the `test` is the summary of a `<details>` nested
110
111
  under it, indented two spaces so it stays inside the item. Two tests under one `when` share the list
111
- item.
112
+ item. The summary is the test title only — no duration, no dimensions, no file size.
112
113
 
113
- Leave the URL bare. GitHub wraps a player around a user-attachments URL on its own line; image
114
- markdown (`![…](…)`) around a video renders nothing. The summary is the test title only — no
115
- duration, no dimensions, no file size.
114
+ ## Upload
115
+
116
+ gh uploads the films itself, with its own sign-in: no extension and no browser cookie. From the
117
+ repository root, so the paths in the body and in the flags match:
118
+
119
+ ```bash
120
+ gh pr create --base main --title "…" --body-file body.md \
121
+ --attach ./shots/<one>.mp4 --attach ./shots/<two>.mp4
122
+ gh pr edit <n> --body-file body.md --attach ./shots/<one>.mp4 # a PR that already exists
123
+ ```
124
+
125
+ gh uploads each file and rewrites its `![…](./shots/…)` reference in place. A film becomes the bare
126
+ user-attachments URL on its own line, which GitHub wraps in a player; an image stays an image. A file
127
+ named in `--attach` that the body never references is appended to the end instead. Pass one
128
+ `--attach` per file, each its own word: zsh does not split an unquoted variable, so flags built into
129
+ one string reach gh as one bad argument.
130
+
131
+ Check the render rather than the markdown, since nesting inside a list is where the player is lost:
132
+
133
+ ```bash
134
+ gh api repos/Newbie012/agent-diff/pulls/<n> -H "Accept: application/vnd.github.html+json" --jq .body_html | grep -c "<video"
135
+ ```
136
+
137
+ The count must equal the number of films.
116
138
 
117
139
  ## Where it goes
118
140
 
@@ -158,7 +180,7 @@ An attachment cannot be deleted once uploaded.
158
180
 
159
181
  ```bash
160
182
  cargo install --locked terminal-control # once
161
- gh extension install drogers0/gh-image # once, then `gh image check-token`
183
+ gh --version # 2.99 or later, for --attach
162
184
  ```
163
185
 
164
186
  `termctrl` lives in `~/.cargo/bin`, which is not always on the PATH of a non-interactive shell.
@@ -265,12 +265,14 @@ user-attachments, so a leak is permanent.
265
265
  ### Showing a screen
266
266
 
267
267
  adiff is a terminal, so a screenshot is a real PNG of a real terminal, captured with
268
- [terminal-control](https://github.com/anomalyco/terminal-control) and uploaded to GitHub's
269
- attachment store.
268
+ [terminal-control](https://github.com/anomalyco/terminal-control) into `shots/`. A capture uploads
269
+ nothing: it prints markdown pointing at the file and the `--attach` flag, and `gh pr create` or `gh
270
+ pr edit` with `--attach` (gh 2.99 or later) uploads it to GitHub's attachment store with gh's own
271
+ sign-in, rewriting the reference in place.
270
272
 
271
273
  ```bash
272
274
  cargo install --locked terminal-control # once
273
- gh extension install drogers0/gh-image # once, then `gh image check-token`
275
+ gh --version # 2.99 or later, for --attach
274
276
  ```
275
277
 
276
278
  **Something new** gets one image:
@@ -287,8 +289,8 @@ pnpm shot --keys "enter text:l" --label "the layers rail" --against origin/main
287
289
  ```
288
290
 
289
291
  `--against` builds a worktree at the merge base, captures the same keystrokes on the code as it was,
290
- and prints the finished `<table>` with both images uploaded. Paste it under the section it belongs
291
- to. If the two frames come out identical the script says so and stops — those keys do not reach the
292
+ and prints a two-column markdown table of both frames. Paste it under the section it belongs to, and
293
+ pass both `--attach` flags it prints. If the two frames come out identical the script says so and stops — those keys do not reach the
292
294
  screen you changed.
293
295
 
294
296
  **Something about motion** — scroll feel, focus moving, a gap opening ten lines at a time — gets a
@@ -298,12 +300,12 @@ recording, because a still frame cannot show it:
298
300
  pnpm shot --keys "enter text:l text:l text:l" --label "the gap opening" --video
299
301
  ```
300
302
 
301
- That prints a bare URL. Leave it bare: GitHub wraps a player around a user-attachments URL on its
302
- own line, and `![…](…)` image markdown around a video renders nothing.
303
+ That prints `![…](./shots/….mp4)`. Paste it as it is: `--attach` rewrites it to the bare
304
+ user-attachments URL, which GitHub wraps in a player on its own line.
303
305
 
304
306
  Keys are termctrl's: `enter`, `escape`, `tab`, `up`, `down`, `page-up`, `ctrl-a` through `ctrl-z`,
305
- and `text:<value>` for anything typed, including single letters like `text:l`. Add `--keep` to leave
306
- the files in `shots/` instead of deleting them after upload.
307
+ and `text:<value>` for anything typed, including single letters like `text:l`. Every capture stays
308
+ in `shots/` until you delete it.
307
309
 
308
310
  ## Before you open the PR
309
311
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.201
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(file tree): a comment the branch moved past no longer marks its file or its layer part, since no line in the diff draws it.
8
+
9
+ <details><summary>What was wrong</summary>
10
+
11
+ A file whose only open comment was on code the branch had since rewritten still showed that comment's mark in the file tree and in the layers rail. Opening the file showed no comment anywhere, because a comment the branch moved past is read in the review panel.
12
+
13
+ </details>
14
+
15
+ - fix(reading order): asking for a reading order while an earlier request is still open adds to that request instead of filing a second one.
16
+
17
+ <details><summary>What was wrong</summary>
18
+
19
+ Each press of `L`, and each `layers ask`, filed a new comment about the branch, so the review panel listed the same request several times.
20
+
21
+ </details>
22
+
23
+ - feat(CLI): `comment list` counts the comments waiting on your answer and the ones holding an answer you have not read.
24
+
3
25
  ## 0.1.0-alpha.200
4
26
 
5
27
  ### Patch Changes
package/dist/main.js CHANGED
@@ -10083,7 +10083,7 @@ var init_config = __esmMin((() => {
10083
10083
  //#region package.json
10084
10084
  init_pane();
10085
10085
  init_config();
10086
- var version$1 = "0.1.0-alpha.200";
10086
+ var version$1 = "0.1.0-alpha.201";
10087
10087
  //#endregion
10088
10088
  //#region src/cli/error.ts
10089
10089
  var UnknownCommand, MissingOption, UnknownField, UnknownOption, BadOption, RegistryUnanswered, NotServed, BadRequest;
@@ -14393,7 +14393,7 @@ var init_review$1 = __esmMin((() => {
14393
14393
  }));
14394
14394
  //#endregion
14395
14395
  //#region src/review/threads.ts
14396
- var ASK_LEAD, stateOf$2, choicesOf, answerOf, turnsOf, judged, factsOf, threadOf, threadsIn$1, idsIn, rootIn, rootOf, isKnown, known, list$3, clearDoing, doing, answer$3, repliesTo, settle, without$1, unsettle, remove, restore$1, settleRead, loudestOf, settledOnALine, fileThreads, byFile$1, drawnOnALine, lineThreads, byLine;
14396
+ var ASK_LEAD, stateOf$2, choicesOf, answerOf, turnsOf, judged, factsOf, threadOf, threadsIn$1, idsIn, rootIn, rootOf, isKnown, known, list$3, clearDoing, doing, answer$3, repliesTo, settle, without$1, unsettle, remove, restore$1, settleRead, countsOf, loudestOf, drawnOnALine, settledOnALine, fileThreads, byFile$1, lineThreads, byLine;
14397
14397
  var init_threads$1 = __esmMin((() => {
14398
14398
  init_dist();
14399
14399
  init_store();
@@ -14684,7 +14684,12 @@ var init_threads$1 = __esmMin((() => {
14684
14684
  }));
14685
14685
  return { settled: ripe.length };
14686
14686
  });
14687
+ countsOf = (threads) => ({
14688
+ asked: threads.filter((thread) => thread.stand === "asked").length,
14689
+ unread: threads.filter((thread) => isOpen(thread.stand) && thread.stand !== "asked" && thread.unread > 0).length
14690
+ });
14687
14691
  loudestOf = (threads) => threads.reduce((stand, one) => louderOf(stand, one.stand), "gone");
14692
+ drawnOnALine = (thread) => thread.about === "line" && !thread.movedPast && thread.stand !== "gone";
14688
14693
  settledOnALine = (thread) => thread.stand === "settled" && !thread.movedPast;
14689
14694
  fileThreads = (path, threads) => {
14690
14695
  const here = threads.filter((thread) => thread.file === path);
@@ -14697,10 +14702,9 @@ var init_threads$1 = __esmMin((() => {
14697
14702
  };
14698
14703
  };
14699
14704
  byFile$1 = (threads) => {
14700
- const counted = threads.filter((thread) => thread.about === "line" && (isOpen(thread.stand) || settledOnALine(thread)));
14705
+ const counted = threads.filter((thread) => drawnOnALine(thread) && (isOpen(thread.stand) || thread.stand === "settled"));
14701
14706
  return [...new Set(counted.map((thread) => thread.file))].map((path) => fileThreads(path, counted));
14702
14707
  };
14703
- drawnOnALine = (thread) => thread.about === "line" && !thread.movedPast && thread.stand !== "gone";
14704
14708
  lineThreads = (here, first) => ({
14705
14709
  path: first.file,
14706
14710
  side: first.side,
@@ -15821,7 +15825,7 @@ var init_preferences = __esmMin((() => {
15821
15825
  }));
15822
15826
  //#endregion
15823
15827
  //#region src/review/layers.ts
15824
- var STALE_ADVICE, unique, spansOfLayer, tidyPath, spanFault, blockFault, codeBlockOf, tidyBlock, blocksOf, layerFault, layerOf, parsed, readLayers, fromStored, toStored, partIn, reportedLayers, reportOf, storedLayers, set, readInLayer, withRead, coversThread, readsFile, lastHolding, layersHolding$1, loudest, partWithThreads, withThreads, readReport, view, show$1, placeThreads, spansIn, layersAt, taggedRow, nearestNew, lineNow, taggedHunk, taggedFile, tagSince, tagRows, read, partsOfFile, vouchPart, askingFor, ask, claims, vouchIn;
15828
+ var STALE_ADVICE, unique, spansOfLayer, tidyPath, spanFault, blockFault, codeBlockOf, tidyBlock, blocksOf, layerFault, layerOf, parsed, readLayers, fromStored, toStored, partIn, reportedLayers, reportOf, storedLayers, set, readInLayer, withRead, coversThread, readsFile, lastHolding, layersHolding$1, loudest, partWithThreads, withThreads, readReport, view, show$1, placeThreads, spansIn, layersAt, taggedRow, nearestNew, lineNow, taggedHunk, taggedFile, tagSince, tagRows, read, partsOfFile, vouchPart, askingFor, openAskOf, askIn, seenOf, ask, claims, vouchIn;
15825
15829
  var init_layers = __esmMin((() => {
15826
15830
  init_dist();
15827
15831
  init_layers$1();
@@ -16037,7 +16041,7 @@ var init_layers = __esmMin((() => {
16037
16041
  });
16038
16042
  };
16039
16043
  withThreads = (report, threads) => {
16040
- const open = threads.filter((thread) => isOpen(thread.stand)).map((thread) => ({
16044
+ const open = threads.filter((thread) => isOpen(thread.stand) && !thread.movedPast).map((thread) => ({
16041
16045
  thread,
16042
16046
  layers: layersHolding$1(report.layers, thread)
16043
16047
  }));
@@ -16191,6 +16195,30 @@ var init_layers = __esmMin((() => {
16191
16195
  if (told.stale) return `${ASK_LEAD} The reading order on it describes an older commit — please read the diff again and write a new one with \`adiff layers set\`.`;
16192
16196
  return `${ASK_LEAD} Please revise its reading order with \`adiff layers set\`.`;
16193
16197
  };
16198
+ openAskOf = (comments) => comments.find((one) => one.body.startsWith("About this branch, not about this line.") && one.settled !== true && one.removed !== true)?.id;
16199
+ askIn = fn("Review.Layers.askIn")(function* (worktree, asking) {
16200
+ if (asking.open !== void 0) return yield* reply(worktree, {
16201
+ to: asking.open,
16202
+ body: asking.body,
16203
+ id: asking.id,
16204
+ at: asking.at
16205
+ });
16206
+ return yield* submit(worktree, {
16207
+ file: asking.file,
16208
+ side: "new",
16209
+ start: 1,
16210
+ end: 1,
16211
+ body: asking.body,
16212
+ id: asking.id,
16213
+ at: asking.at
16214
+ });
16215
+ });
16216
+ seenOf = (thread) => ({
16217
+ id: thread.id,
16218
+ body: thread.body,
16219
+ settled: thread.settled,
16220
+ removed: thread.stand === "gone"
16221
+ });
16194
16222
  ask = fn("Review.Layers.ask")(function* (reading, request) {
16195
16223
  const first = reading.patches[0];
16196
16224
  if (first === void 0) return yield* new UnknownFile({
@@ -16202,14 +16230,13 @@ var init_layers = __esmMin((() => {
16202
16230
  count: told.layers.length,
16203
16231
  stale: told.stale
16204
16232
  });
16205
- yield* submit(reading.worktree, {
16233
+ const open = openAskOf((yield* list$3(reading)).map(seenOf));
16234
+ yield* askIn(reading.worktree, {
16206
16235
  file: first.path,
16207
- side: "new",
16208
- start: 1,
16209
- end: 1,
16210
16236
  body,
16211
16237
  id: request.id,
16212
- at: request.at
16238
+ at: request.at,
16239
+ open
16213
16240
  });
16214
16241
  return { asked: body };
16215
16242
  });
@@ -19060,7 +19087,7 @@ var init_notes = __esmMin((() => {
19060
19087
  init_words();
19061
19088
  threadsOn = (state, fileIndex) => {
19062
19089
  const patch = state.patches[fileIndex];
19063
- const stands = patch === void 0 ? [] : state.sent.filter((entry) => entry.file === patch.path && entry.removed !== true && entry.settled !== true).map((entry) => threadStand(entry));
19090
+ const stands = patch === void 0 ? [] : state.sent.filter((entry) => entry.file === patch.path && entry.removed !== true && entry.settled !== true && !movedPast(entry)).map((entry) => threadStand(entry));
19064
19091
  return {
19065
19092
  open: stands.length,
19066
19093
  stand: stands.reduce(louderOf, "gone")
@@ -24657,14 +24684,12 @@ var init_comments = __esmMin((() => {
24657
24684
  const patch = app.state.patches[0];
24658
24685
  const branch = selectedBranch(app.state);
24659
24686
  if (patch === void 0 || branch === void 0) return;
24660
- yield* submit(yield* worktreeOf(app, branch.branch), {
24687
+ yield* askIn(yield* worktreeOf(app, branch.branch), {
24661
24688
  file: patch.path,
24662
- side: "new",
24663
- start: 1,
24664
- end: 1,
24665
24689
  body: layersAsk$1(app.state),
24666
24690
  id: randomUUID(),
24667
- at: (/* @__PURE__ */ new Date()).toISOString()
24691
+ at: (/* @__PURE__ */ new Date()).toISOString(),
24692
+ open: openAskOf(app.state.sent)
24668
24693
  });
24669
24694
  const sent = yield* loadSent(app, branch.branch);
24670
24695
  app.commit(withNotice(withSent(app.state, sent), askedFor(app.state)));
@@ -26540,6 +26565,7 @@ const commentList = fn("Main.commentList")(function* (options) {
26540
26565
  const comments = yield* placeThreads(reading, yield* list$3(reading));
26541
26566
  yield* answer(options, {
26542
26567
  comments,
26568
+ counts: countsOf(comments),
26543
26569
  files: byFile$1(comments),
26544
26570
  lines: byLine(comments)
26545
26571
  });
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.200",
26
+ "version": "0.1.0-alpha.201",
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": {