@xbghc/warden 0.11.1 → 0.13.0

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/README.md CHANGED
@@ -43,13 +43,20 @@ or install globally:
43
43
 
44
44
  ```sh
45
45
  npm i -g @xbghc/warden
46
- warden [repoPath] [--port <n>] [--no-open]
46
+ warden [repoPath] [--port <n>] [--no-open] [--no-update-check]
47
47
  ```
48
48
 
49
49
  The server picks the first free port from 4100 (or `--port`), prints the URL and tries to open a
50
50
  browser via `wslview`, `explorer.exe`, then `xdg-open`. If none of those exist it only prints the URL.
51
51
  Several instances on the same repository can run at the same time.
52
52
 
53
+ On start warden asks the npm registry whether a newer release exists, at most once a day (the answer
54
+ is cached in `~/.local/share/warden/update-check.json`). When there is one, a line in the terminal
55
+ and a chip beside the wordmark say so; clicking the chip copies the command — `npx @xbghc/warden@latest`
56
+ for an npx run, whose cache otherwise keeps serving the old copy, `npm i -g @xbghc/warden@latest`
57
+ for a global install. The check never delays startup and fails silently. `--no-update-check`,
58
+ `WARDEN_NO_UPDATE_CHECK=1`, `NO_UPDATE_NOTIFIER=1` or `CI` turn it off.
59
+
53
60
  ## Targets (what is being reviewed)
54
61
 
55
62
  | Target | Key | Git equivalent |
@@ -89,6 +96,10 @@ has no control of its own (a saved `lastTarget` can still restore it; *审阅整
89
96
  the same diff). Commit, range and `base` targets keep the single tree, and their figure counts 已读
90
97
  instead, since nothing can be staged there.
91
98
 
99
+ So there is one mark of "done" per kind of target, never two. In the local views it is staging and
100
+ nothing else: a row has no 已读 box, and which block a file sits in is the whole of its review state.
101
+ Everywhere else it is the [已读 mark](#viewed-files).
102
+
92
103
  `base:<ref>` is for a branch a coding agent has been working on, committing as it goes: one tree with
93
104
  everything since the branch forked off `<ref>` — the commits plus whatever is still uncommitted or
94
105
  untracked. The diff runs against the merge base, so commits that landed on `<ref>` after the fork are
@@ -175,8 +186,7 @@ A partial pick is turned into the patch `git add -p`'s edit mode would want —
175
186
  stay as context and the unpicked additions are left out (the mirror image when unstaging) — and applied
176
187
  with `git apply --cached`. It never touches the working tree, so what you did not pick is still
177
188
  there to stage next. Comments on the lines you staged follow them into the Staged view (see
178
- [Re-anchoring](#re-anchoring)); the file's *viewed* flag is dropped because its diff changed. Every
179
- page open on the worktree reloads at once.
189
+ [Re-anchoring](#re-anchoring)). Every page open on the worktree reloads at once.
180
190
 
181
191
  Limits, each reported as a plain error rather than a half-applied patch:
182
192
 
@@ -251,9 +261,13 @@ them deletes on a moved HEAD.
251
261
  Comment markers in the diff belong to one view; the rail's *全部* tab lists the whole pool and
252
262
  *此文件* lists every comment on the open file regardless of which view it currently sits in.
253
263
 
254
- *已读* is per view, so a half-staged file can be marked read on one side and not the other. It is
255
- bound to a hash of the file's diff; when the diff changes the flag is dropped and the file is marked
256
- *已变化*.
264
+ ## Viewed files
265
+
266
+ Commit, range and `base` targets cannot be staged from, so a file there is ticked *已读* instead — the
267
+ box beside it in the sidebar, or the one in the file header. A directory whose files are all read
268
+ recedes with a check. The mark is bound to a hash of the file's diff: when the diff changes (a `base`
269
+ target reads the working tree, so the agent's next edit does that) the mark is dropped and the file
270
+ is flagged *已变化*. The local views keep no such mark — see [Targets](#targets-what-is-being-reviewed).
257
271
 
258
272
  ## Auto-refresh
259
273
 
@@ -325,9 +339,10 @@ can share it. Delete the directory to reset.
325
339
 
326
340
  `targets` is keyed by target key, plus one *comment scope* per worktree — `local`, or
327
341
  `worktree:<path>:local` — holding the comments the three local views share and the HEAD sha the last
328
- re-anchor saw. `viewed` stays on the individual view keys. Issues and todos are top level. State
329
- written by an older version is migrated on load: comments filed under `working` / `staged` / `all`
330
- move into the matching scope the first time the file is read.
342
+ re-anchor saw. `viewed` sits on the key of the commit, range or `base` target it was ticked in; the
343
+ local view keys hold nothing. Issues and todos are top level. State written by an older version is
344
+ migrated on load: comments filed under `working` / `staged` / `all` move into the matching scope the
345
+ first time the file is read, and the 已读 marks those views used to keep are dropped.
331
346
 
332
347
  ## WSL2 notes
333
348
 
@@ -362,6 +377,11 @@ the repository. A mutating request the
362
377
  browser labels as coming from another site (`Sec-Fetch-Site: cross-site`) is refused with 403, so a
363
378
  page from elsewhere cannot drive the server through the browser it is open in.
364
379
 
380
+ The only request warden makes off the machine is the update check: a `GET` of
381
+ `https://registry.npmjs.org/@xbghc%2fwarden/latest`, no more than once a day, carrying nothing about
382
+ the repository or the review. `--no-update-check` (or the environment switches under *Install / run*)
383
+ removes it.
384
+
365
385
  ## Development
366
386
 
367
387
  ```sh