@invariant.guru/cli 0.6.4 → 0.6.7
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 +60 -8
- package/dist/main.js +640 -621
- package/dist/ui/assets/{Editor-Cya-m8Oi.js → Editor-BLf9CSPA.js} +1 -1
- package/dist/ui/assets/{MarkdownBody-7E9TxxNU.js → MarkdownBody-DDvmJfDv.js} +1 -1
- package/dist/ui/assets/{Preview-DgbYAJAm.js → Preview-DhM7_6Ab.js} +1 -1
- package/dist/ui/assets/index-ChnSpLez.css +1 -0
- package/dist/ui/assets/index-DJ_LUfui.js +247 -0
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/index-C4CtBm6k.js +0 -246
- package/dist/ui/assets/index-CIbv0dIa.css +0 -1
package/README.md
CHANGED
|
@@ -166,15 +166,20 @@ invariant plan:complete <session-id> --summary "Booking command + tests"
|
|
|
166
166
|
Composes a *review session*: a second session whose job is to review the branch
|
|
167
167
|
and write the result into `doc/review/<branch>.xml`.
|
|
168
168
|
|
|
169
|
-
A review
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
A review says what it is about, and one of the two forms is required. Without
|
|
170
|
+
either the command refuses and lists the sessions it could have reviewed —
|
|
171
|
+
which is what stops a review ending up attached to nothing by accident.
|
|
172
172
|
|
|
173
173
|
```bash
|
|
174
174
|
invariant review --session <session-id> # review the work that session produced
|
|
175
|
-
invariant review --
|
|
175
|
+
invariant review --standalone # review this branch on its own
|
|
176
|
+
invariant review --standalone --base origin/develop # diff against something else
|
|
176
177
|
```
|
|
177
178
|
|
|
179
|
+
`--standalone` is for work no session of yours covers: pull a colleague's
|
|
180
|
+
branch, review it, and get the same triage flow with nothing of your own behind
|
|
181
|
+
it.
|
|
182
|
+
|
|
178
183
|
Paste its execute line into a **new** agent conversation. That is the point: a
|
|
179
184
|
fresh one has not seen the plan, so it reads the diff as evidence rather than as
|
|
180
185
|
confirmation. It reviews exactly `git diff --cached $(git merge-base <base> HEAD)`
|
|
@@ -191,10 +196,23 @@ writes the comments you accepted into that same session's `## Plan` and moves it
|
|
|
191
196
|
to `planned`. Executing it implements them. Nothing is ever committed or pushed —
|
|
192
197
|
you stage and commit when you are happy.
|
|
193
198
|
|
|
199
|
+
Or send them to the people who will read the merge request instead:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
invariant review publish <branch> --dry-run # what would go where
|
|
203
|
+
invariant review publish <branch>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Each accepted comment becomes a **draft (pending)** comment on the branch's
|
|
207
|
+
GitLab merge request, anchored on its file and line. Nothing is submitted for
|
|
208
|
+
you and nobody is notified — you read the drafts in GitLab and press *Submit
|
|
209
|
+
review*. The token is per project: see [docs/spec-review.md](docs/spec-review.md) §9.
|
|
210
|
+
|
|
194
211
|
### 7. `invariant ui` — see and manage your sessions
|
|
195
212
|
|
|
196
|
-
Opens a local dashboard for this project
|
|
197
|
-
rendered markdown, a rich editor, review triage, and a
|
|
213
|
+
Opens a local dashboard for this project: a session board grouped by status,
|
|
214
|
+
rendered markdown, a rich editor, review triage, package management, and a
|
|
215
|
+
command palette.
|
|
198
216
|
|
|
199
217
|
```bash
|
|
200
218
|
invariant ui # start on 4200 (or the next free port) and open a browser
|
|
@@ -399,6 +417,8 @@ invariant inspect nest-clean-architecture
|
|
|
399
417
|
|--------|-------------|
|
|
400
418
|
| `-d, --details` | Show all items including inactive ones |
|
|
401
419
|
|
|
420
|
+
The **Packages** page in `invariant ui` is this same tree, with checkboxes.
|
|
421
|
+
|
|
402
422
|
### `invariant list`
|
|
403
423
|
|
|
404
424
|
List installed or available packages.
|
|
@@ -453,11 +473,14 @@ waits for you to rule on every comment, and then implements the ones you
|
|
|
453
473
|
accepted — one file, one conversation.
|
|
454
474
|
|
|
455
475
|
```bash
|
|
456
|
-
invariant review --session <session-id> # the session whose work is reviewed
|
|
476
|
+
invariant review --session <session-id> # the session whose work is reviewed
|
|
477
|
+
invariant review --standalone # a branch tied to no session
|
|
457
478
|
invariant review --session <id> --base origin/develop # diff against another ref
|
|
458
479
|
invariant review list # every review document
|
|
459
480
|
invariant review show <branch> --open # what still needs a decision
|
|
460
481
|
invariant review plan-changes <branch> # accepted comments → the session's Plan
|
|
482
|
+
invariant review publish <branch> --dry-run # what would go where on the merge request
|
|
483
|
+
invariant review publish <branch> # accepted comments → draft MR comments
|
|
461
484
|
```
|
|
462
485
|
|
|
463
486
|
| Subcommand | Description |
|
|
@@ -466,10 +489,12 @@ invariant review plan-changes <branch> # accepted comments → the sessi
|
|
|
466
489
|
| `list` | Every review document in the project (`--json`) |
|
|
467
490
|
| `show <review>` | Print a review's comments (`--staged`, `--open`, `--json`) |
|
|
468
491
|
| `plan-changes <review>` | Write the accepted comments into the session's `## Plan` |
|
|
492
|
+
| `publish <review>` | Create draft GitLab merge-request comments (`--dry-run`, `--mr <iid>`) |
|
|
469
493
|
|
|
470
494
|
| Option | Description |
|
|
471
495
|
|--------|-------------|
|
|
472
|
-
| `-s, --session <session>` | The plan session whose work is under review
|
|
496
|
+
| `-s, --session <session>` | The plan session whose work is under review |
|
|
497
|
+
| `--standalone` | Review this branch on its own, tied to no session |
|
|
473
498
|
| `-b, --base <ref>` | Ref to diff against (default: `origin/main`, then `origin/master`, `main`, `master`) |
|
|
474
499
|
|
|
475
500
|
Reviews land in `doc/review/<branch>.xml`, one file per branch, appended to on
|
|
@@ -478,6 +503,11 @@ partial triage silently drops the comments nobody looked at, so it is not
|
|
|
478
503
|
allowed. Nothing here touches the index or a remote: the git commands this tool
|
|
479
504
|
may run are allowlisted to read-only ones.
|
|
480
505
|
|
|
506
|
+
`publish` has the same gate, and one of its own: it writes **draft notes and
|
|
507
|
+
nothing else**. There is no call in this tool that submits a review, so the
|
|
508
|
+
comments stay pending until a human presses *Submit review* in GitLab. Only
|
|
509
|
+
staged comments are sent; a discarded one never leaves your machine.
|
|
510
|
+
|
|
481
511
|
Configure it under `review` in `invariant.json`:
|
|
482
512
|
|
|
483
513
|
```jsonc
|
|
@@ -521,6 +551,28 @@ In the UI: `⌘K` opens the command palette, `⇧⌘V` toggles rendered preview
|
|
|
521
551
|
editing, `N` starts a session, `?` lists every shortcut. On a review session,
|
|
522
552
|
`j`/`k` move between comments and `s` / `d` / `e` stage, discard, or edit one.
|
|
523
553
|
|
|
554
|
+
#### The Packages page
|
|
555
|
+
|
|
556
|
+
The **Packages** section of the UI is a view over the package commands — it runs
|
|
557
|
+
the same `invariant install`, `add`, `remove`, `uninstall` and `sync` you would
|
|
558
|
+
type, in the directory the UI was started in, and shows you the command before it
|
|
559
|
+
runs. It never writes `invariant.json` itself.
|
|
560
|
+
|
|
561
|
+
- **The tree is `invariant inspect`.** Selecting a package lists everything it
|
|
562
|
+
ships, grouped by type, with the active items ticked.
|
|
563
|
+
- **Toggling stages, it does not fire.** Tick and untick as many items as you
|
|
564
|
+
like; the bar at the bottom shows what will run, and **Apply** issues one
|
|
565
|
+
`remove` and one `add` for the whole batch. Optionally a `sync` after.
|
|
566
|
+
- **Install** takes a GitHub repository (the default — `owner/repo`, or a pasted
|
|
567
|
+
URL, plus an optional ref) or a registry name, and previews the exact
|
|
568
|
+
`invariant install …` line including `--no-add` and `--sync`.
|
|
569
|
+
- **Sync** runs from the top bar, with a **Check only** dry run that reports
|
|
570
|
+
drift the way CI does.
|
|
571
|
+
- **A package the config declares but this checkout never installed** shows as
|
|
572
|
+
*not installed*, with a button that fetches it from its recorded source.
|
|
573
|
+
|
|
574
|
+
A change made in a terminal shows up in an open page within a couple of seconds.
|
|
575
|
+
|
|
524
576
|
To work on the UI itself: start a daemon (`invariant ui --no-open`), then run
|
|
525
577
|
`yarn dev:ui` for Vite with hot reload against it — `INVARIANT_UI_PORT=<port>`
|
|
526
578
|
when the daemon landed on something other than 4200.
|