revdeck 0.16.1 → 0.18.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/CHANGELOG.md CHANGED
@@ -4,6 +4,78 @@ All notable changes to this project are documented here. The format is based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.18.0] - 2026-11-28
8
+
9
+ ### Added
10
+
11
+ - A branded reconnect page replaces the bare `401` page after a daemon restart or an expired launch
12
+ token. It explains the rotated token/port, copies
13
+ `revdeck daemon start && revdeck ui --open` and reloads itself as soon as a fresh link authorizes
14
+ the browser. The page follows the browser language and the system theme.
15
+ - The UI shows a full-screen “daemon unreachable / session expired” card instead of raw
16
+ `Failed to fetch` and `нет авторизации` errors. It probes `/api/health`, listens to browser
17
+ `online`/visibility changes and recovers by itself; the copy button and focus handling work on
18
+ plain-HTTP LAN origins too.
19
+ - The daemon reuses its last port on restart when the port is free (`daemon.port` in the state
20
+ directory) and falls back to a random port when it is busy, so an open UI tab keeps its origin.
21
+ - `revdeck daemon logs --follow` and `--json`; log rotation at 1 MiB (`daemon.log.1`).
22
+ - `revdeck daemon start|restart --port <N>` and `revdeck daemon status --json` with a `/api/health`
23
+ probe and a CLI/daemon version-mismatch warning.
24
+ - Unsaved replies and finding comments are backed up in `localStorage` and restored after a lost
25
+ connection; they are saved to the daemon once it is reachable again.
26
+ - Tests for daemon report formatting, the launch page/CSP and the port hint.
27
+ - `revdeck tools status|install [glab|gh|all]` with `--dry-run` and `--json`: shows the detected
28
+ versions and package manager, then installs only through user-level managers (Homebrew/winget) after
29
+ `--yes` or a TTY prompt. pacman plans are printed for manual sudo execution; the daemon, MCP and the
30
+ devcontainer bridge have no access to the command.
31
+ - `revdeck daemon logs --lines N` and the tail of the rotated `daemon.log.1` when the current log is
32
+ short.
33
+ - `--json` for `revdeck daemon start/stop/restart`.
34
+ - Tests for install plans and rotated log tails.
35
+ - The Settings access card now detects a missing `glab`/`gh` and shows an install banner: an official
36
+ installation link plus a copyable package-manager command when the host has Homebrew, pacman or
37
+ winget. Nothing is installed or executed automatically; the banner reminds you to run
38
+ `revdeck daemon restart`. `auth.status` returns this `install` guidance for humans only.
39
+
40
+ ### Changed
41
+
42
+ - `revdeck daemon start|restart|status|logs|stop` and the foreground daemon banner print one compact,
43
+ aligned summary (pid, UI link, socket, state, health, log); ANSI colors appear only in a TTY.
44
+ A delayed “starting the daemon…” hint covers slow starts. `revdeck doctor` colors its checks and
45
+ truncates tool errors at word boundaries.
46
+ - `npm run build:server` no longer deletes `dist/ui`, so the daemon cannot end up without the UI by
47
+ accident.
48
+ - README and capabilities docs reflect that settings live in SQLite and the port is usually reused.
49
+
50
+ ### Fixed
51
+
52
+ - A valid launch link (`/?t=…&review=…`) keeps non-token query parameters through the redirect; the
53
+ previous `new URL('/', url)` dropped them.
54
+ - The UI URL in `daemon.json` and `/api/health` now use the host passed to `--host`, and the HTTP
55
+ `Host` allow-list accepts that interface instead of always reporting `127.0.0.1`.
56
+
57
+ ## [0.17.0] - 2026-11-27
58
+
59
+ ### Added
60
+
61
+ - Settings has a **GitLab and GitHub access** card: it shows the `glab`/`gh` state for every platform
62
+ host in the project registry and lets you paste a personal access token. The daemon checks the token
63
+ with `GET /user` and passes it to the CLI on stdin, so `glab`/`gh` store it and revdeck keeps no copy;
64
+ the form is disabled when the UI is not served from `127.0.0.1`.
65
+ - RPC methods `auth.status` and `auth.login` (human-only; the devcontainer bridge returns `CAPABILITY`).
66
+ `auth.status` never returns a token, only the host, the account and a hint.
67
+ - `revdeck doctor` checks only the CLI of the project's platform and points to Settings when access is
68
+ missing.
69
+ - Settings persist across daemon restarts: theme, interface language, hidden sections, auto-refresh and
70
+ notifications are stored by the daemon in SQLite (`settings.get`/`settings.put`, human-only) instead
71
+ of the browser's `localStorage`. The UI applies them before the first paint, so there is no theme or
72
+ language flash.
73
+
74
+ ### Fixed
75
+
76
+ - The access card has a gap between the token input and the buttons, and the host input uses the same
77
+ style as the token input.
78
+
7
79
  ## [0.16.1] - 2026-11-27
8
80
 
9
81
  ### Fixed
package/README.md CHANGED
@@ -50,10 +50,20 @@ and a web UI. Platform tokens stay on the host.
50
50
  text, author, target and draft filters; each row can be previewed read-only or opened as a review.
51
51
  Opening from the list keeps a clickable breadcrumb, and returning restores the filters and scroll.
52
52
  - **Settings page.** Theme (system/light/dark), interface language, command reference, the
53
- Features-section visibility and the auto-refresh interval live on a separate Settings page; the
54
- choices are stored locally. Auto-refresh repeats the header “Refresh” action
53
+ Features-section visibility and the auto-refresh interval live on a separate Settings page. The
54
+ daemon stores the choices in SQLite, so they survive a restart; `localStorage` is just a cache for
55
+ the first paint. Auto-refresh repeats the header “Refresh” action
55
56
  (off/10/30/60 min, default 10 min) while a review or preview is open and skips background tabs,
56
57
  typing and open dialogs.
58
+ - **Restart-friendly shell.** A restart rotates the launch token but reuses the last port when it is
59
+ free, so the open tab keeps its origin. The tab and the login page explain what happened and offer
60
+ `revdeck daemon start && revdeck ui --open`; the tab reconnects by itself once a fresh link is
61
+ opened. Unsaved replies and finding comments are kept in `localStorage`; raw `Failed to fetch` and
62
+ 401 text is no longer shown.
63
+ - **Readable daemon output.** `revdeck daemon start|restart|status|stop` prints one aligned block with
64
+ the UI link, socket, state and health. `daemon logs` renders local timestamps and supports `--follow`
65
+ and `--json`; the log rotates at 1 MiB. `daemon start/restart` accept `--port`. Colors appear only in
66
+ a TTY, so pipes, CI and journald stay clean.
57
67
  - **Update notice.** The sidebar shows the running version and, when a newer npm release exists, a
58
68
  badge; review pages show a dismissible banner with the release link and update command. The About
59
69
  card in Settings checks npm manually. The daemon checks at most once per day; set
@@ -84,10 +94,16 @@ agent (MCP/CLI) ──unix socket──▶ revdeck daemon ──glab/gh──▶
84
94
 
85
95
  ## Install
86
96
 
87
- Requirements: Node.js ≥ 22.13 (Node 24 LTS recommended — `node:sqlite` is experimental in 22.x), `git`, and an authenticated platform CLI
88
- (`glab auth login` or `gh auth login`). The CLI must be in the daemon's `PATH`; set `REVDECK_GLAB` or
89
- `REVDECK_GH` to an absolute path if it lives in a mise/asdf/homebrew shim or a custom location. revdeck
90
- never reads or stores their tokens.
97
+ Requirements: Node.js ≥ 22.13 (Node 24 LTS recommended — `node:sqlite` is experimental in 22.x), `git`, and the platform CLI
98
+ (`glab` or `gh`) in the daemon's `PATH`. Sign in on the host (`glab auth login` / `gh auth login`), or
99
+ paste a personal access token in the UI: **Settings → GitLab and GitHub access**. The daemon verifies the
100
+ token and hands it to the CLI, which stores it; revdeck never keeps a copy. The access card also lists a
101
+ missing CLI with an install link and, when a package manager is available on the host, a copyable
102
+ command. Set `REVDECK_GLAB` or `REVDECK_GH` to an absolute path if the CLI lives in a
103
+ mise/asdf/homebrew shim or a custom location.
104
+ `revdeck tools status` shows what the daemon sees; `revdeck tools install gh --dry-run` prints the exact
105
+ plan, manager and version before anything runs. `revdeck tools install gh --yes` installs only through a
106
+ user-level manager (Homebrew/winget); pacman plans stay manual because they need sudo.
91
107
 
92
108
  ```bash
93
109
  # one-off
@@ -174,7 +190,8 @@ Russian READMEs live in this repository; translation fixes are welcome.
174
190
  | `revdeck checks <N> [--run --yes]` | project checks |
175
191
  | `revdeck export/import <N>` | legacy file exchange |
176
192
  | `revdeck ui [N]` | local web UI |
177
- | `revdeck daemon <start\|stop\|restart\|status\|logs\|install\|uninstall>` | daemon lifecycle |
193
+ | `revdeck daemon <start\|stop\|restart\|status\|logs\|install\|uninstall>` | daemon lifecycle; `--port`, `logs --follow`, `status/logs --json` |
194
+ | `revdeck tools [status\|install <glab\|gh\|all>] [--dry-run] [--yes] [--json]` | check/install platform CLIs without sudo |
178
195
  | `revdeck mcp` | MCP server over stdio |
179
196
 
180
197
  Common flags: `--json`, `--root`, `--review`, `--platform`, `--project`, `--host`, `--all`, `--lang ru|en`.
@@ -446,6 +463,11 @@ found. Full schema: [docs/configuration.md](docs/configuration.md).
446
463
  `Host`/`Origin` checks and CSP.
447
464
  - `glab`/`gh` run without a shell, with `cwd` outside the working copy and a scrubbed environment;
448
465
  secrets are redacted from logs and errors.
466
+ - A token pasted in the UI is checked with a `GET /user` request, then passed to `glab`/`gh` on stdin
467
+ (never in argv) and stored by the CLI. revdeck does not keep a copy, `auth.status` returns only the
468
+ host, the account and install guidance, and `auth.*` is human-only: the bridge answers `CAPABILITY`.
469
+ The form is disabled when the UI is not opened via `127.0.0.1`, because the token would travel over
470
+ the network.
449
471
  - Rule/profile documents must be git-tracked, have a safe extension and are denied for local secrets
450
472
  (`.env*`, `.git/**`, `.npmrc`, `.revdeck.local.*`, keys); `.revdeck.local.yml` tracked by git is
451
473
  ignored as a repository file. Reads use an opened-fd realpath check to close symlink TOCTOU.
@@ -456,8 +478,9 @@ found. Full schema: [docs/configuration.md](docs/configuration.md).
456
478
  - Review text is untrusted data; agent instructions say so explicitly.
457
479
 
458
480
  Details: [docs/threat-model.md](docs/threat-model.md). The guarantee is: the token does not cross the
459
- sandbox boundary and is not returned over RPC. If a process can read the user's home directory, it can
460
- read the CLI configuration — isolate the agent.
481
+ sandbox boundary and is not returned over RPC. A token entered in the UI is passed straight to the CLI
482
+ and is not kept by revdeck. If a process can read the user's home directory, it can read the CLI
483
+ configuration — isolate the agent.
461
484
 
462
485
  ## Architecture
463
486
 
package/README.ru.md CHANGED
@@ -49,10 +49,20 @@
49
49
  read-only или открыть как ревью. При открытии из списка появляются кликабельные хлебные крошки,
50
50
  а возврат сохраняет фильтры и позицию скролла.
51
51
  - **Страница настроек.** Тема (системная/светлая/тёмная), язык интерфейса, справка, видимость
52
- раздела «Фичи» и интервал автообновления вынесены на отдельную страницу; выбор сохраняется
53
- локально. Автообновление повторяет «Обновить» в шапке (выкл/10/30/60 мин, по умолчанию 10 мин),
52
+ раздела «Фичи» и интервал автообновления вынесены на отдельную страницу. Выбор хранит демон в
53
+ SQLite, поэтому он переживает перезапуск; `localStorage` — только кеш для первого кадра.
54
+ Автообновление повторяет «Обновить» в шапке (выкл/10/30/60 мин, по умолчанию 10 мин),
54
55
  пока открыто ревью или preview, и пропускает тики в фоновой вкладке, во время ввода и при
55
56
  открытых диалогах.
57
+ - **Переживает перезапуск демона.** Перезапуск меняет launch-токен, но переиспользует прошлый
58
+ порт, если он свободен, поэтому у открытой вкладки остаётся тот же origin. Вкладка и страница
59
+ входа объясняют, что произошло, и предлагают `revdeck daemon start && revdeck ui --open`;
60
+ вкладка сама переподключается после свежей ссылки. Несохранённые ответы и комментарии к
61
+ замечаниям хранятся в `localStorage`. Сырые `Failed to fetch` и текст 401 больше не показываются.
62
+ - **Читаемый вывод демона.** `revdeck daemon start|restart|status|stop` печатает один выровненный
63
+ блок со ссылкой на UI, сокетом, состоянием и здоровьем. `daemon logs` показывает локальное время
64
+ и поддерживает `--follow` и `--json`; лог ротируется на 1 МиБ. `daemon start/restart` принимают
65
+ `--port`. Цвет — только в TTY, поэтому pipe, CI и journald остаются чистыми.
56
66
  - **Уведомление об обновлении.** В сайдбаре видны текущая версия и бейдж, если в npm вышла новая;
57
67
  на страницах ревью появляется закрываемый баннер со ссылкой на релиз и командой обновления. В
58
68
  настройках карточка «О программе» проверяет npm вручную. Демон проверяет не чаще раза в сутки;
@@ -82,10 +92,16 @@ npm install -g revdeck
82
92
  npx revdeck@latest init
83
93
  ```
84
94
 
85
- Требования: Node.js ≥ 22.13 (рекомендуется Node 24 LTS: в 22.x `node:sqlite` экспериментален), `git`, для GitLab — `glab` с выполненным `glab auth login`, для
86
- GitHub — `gh` с `gh auth login`. CLI должен быть в `PATH` демона; если это mise/asdf/homebrew shim или
87
- нестандартное место, задайте `REVDECK_GLAB` или `REVDECK_GH` с абсолютным путём. Токены revdeck не
88
- читает и не хранит.
95
+ Требования: Node.js ≥ 22.13 (рекомендуется Node 24 LTS: в 22.x `node:sqlite` экспериментален), `git` и
96
+ CLI платформы (`glab` или `gh`) в `PATH` демона. Войдите на хосте (`glab auth login` / `gh auth login`)
97
+ или вставьте personal access token в UI: **Настройки → Доступ к GitLab и GitHub**. Демон проверит токен
98
+ и передаст его CLI, который сохранит его у себя; revdeck копию не хранит. Если CLI не найден, карточка
99
+ доступа покажет ссылку на установку и — когда на хосте есть пакетный менеджер — команду для копирования.
100
+ Если CLI стоит в mise/asdf/homebrew shim или нестандартном месте, задайте `REVDECK_GLAB` или
101
+ `REVDECK_GH` с абсолютным путём.
102
+ `revdeck tools status` покажет, что видит демон; `revdeck tools install gh --dry-run` напечатает точный
103
+ план, менеджер и версию до запуска. `revdeck tools install gh --yes` ставит только через
104
+ пользовательский менеджер (Homebrew/winget); план pacman остаётся ручным, потому что требует sudo.
89
105
 
90
106
  В проекте:
91
107
 
@@ -160,7 +176,8 @@ self-hosted GitLab), по умолчанию выбирается `gitlab`. Пе
160
176
  | `revdeck checks <N> [--run --yes]` | проверки проекта |
161
177
  | `revdeck export/import <N>` | обмен с файловым форматом |
162
178
  | `revdeck ui [N]` | локальный интерфейс |
163
- | `revdeck daemon <start│stop│restart│status│logs│install│uninstall>` | управление демоном |
179
+ | `revdeck daemon <start│stop│restart│status│logs│install│uninstall>` | управление демоном; `--port`, `logs --follow`, `status/logs --json` |
180
+ | `revdeck tools [status│install <glab│gh│all>] [--dry-run] [--yes] [--json]` | проверка/установка CLI платформ без sudo |
164
181
  | `revdeck mcp` | MCP-сервер (stdio) |
165
182
 
166
183
  Общие флаги: `--json`, `--root`, `--review`, `--platform`, `--project`, `--host`, `--all`, `--lang ru|en`.
@@ -432,6 +449,11 @@ revdeck ищет `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md` и `docs/*` и пр
432
449
  проверку `Host`/`Origin` и CSP.
433
450
  - `glab`/`gh` вызываются без shell, с `cwd` вне рабочей копии и вычищенным окружением; секреты
434
451
  редактируются в логах и ошибках.
452
+ - Токен, вставленный в UI, проверяется запросом `GET /user`, затем уходит в `glab`/`gh` через stdin
453
+ (никогда в argv) и сохраняется самим CLI. revdeck копию не держит, `auth.status` возвращает только
454
+ хост, аккаунт и инструкцию по установке отсутствующего CLI, а `auth.*` доступен только человеку:
455
+ мост отвечает `CAPABILITY`. Форма отключена, если UI открыт не по `127.0.0.1`, — иначе токен пойдёт
456
+ по сети.
435
457
  - Документы правил/профилей должны быть отслеживаемы git, иметь безопасное расширение и не быть
436
458
  локальным секретом (`.env*`, `.git/**`, `.npmrc`, `.revdeck.local.*`, ключи); `.revdeck.local.yml`,
437
459
  отслеживаемый git, игнорируется как файл репозитория. Чтение проверяет realpath уже открытого fd,
@@ -443,8 +465,9 @@ revdeck ищет `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md` и `docs/*` и пр
443
465
  - Текст MR — недоверенные данные; агентские инструкции это оговаривают.
444
466
 
445
467
  Подробно: [docs/ru/threat-model.md](docs/ru/threat-model.md). Гарантия формулируется так: токен не
446
- пересекает границу песочницы и не отдаётся по RPC. Если у процесса есть чтение домашнего каталога
447
- пользователя, он может прочитать конфигурацию `glab`/`gh` — для этого и нужна изоляция агента.
468
+ пересекает границу песочницы и не отдаётся по RPC. Токен, введённый в UI, передаётся сразу CLI и не
469
+ остаётся в revdeck. Если у процесса есть чтение домашнего каталога пользователя, он может прочитать
470
+ конфигурацию `glab`/`gh` — для этого и нужна изоляция агента.
448
471
 
449
472
  ## Архитектура
450
473