@hyperlogue/r3 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/README.md +124 -26
  2. package/launch.mjs +2 -10
  3. package/package.json +8 -5
package/README.md CHANGED
@@ -1,39 +1,137 @@
1
- # @hyperlogue/r3
1
+ <p align="center">
2
+ <img src="web/favicon.svg" alt="r3 logo" width="120" height="120">
3
+ </p>
2
4
 
3
- **Review. Revise. Resolve.** — a local-first review tool for AI-generated code and docs.
5
+ <h1 align="center">r3: Review. Revise. Resolve.</h1>
4
6
 
5
- ## Try it
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@hyperlogue/r3"><img src="https://img.shields.io/npm/v/@hyperlogue/r3?color=cb3837&amp;logo=npm&amp;label=%40hyperlogue%2Fr3" alt="npm version"></a>
9
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license: MIT"></a>
10
+ <img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey" alt="platforms: macOS, Linux">
11
+ </p>
12
+
13
+ r3 is a review tool for the diffs and docs produced by your coding agents, running
14
+ locally with a web interface. You leave feedback pinned to the exact line or
15
+ quote it's about, and track each comment to resolution.
16
+
17
+ r3 fills a gap the chat box can't. Say your agent writes a long planning doc and
18
+ you want to fix a handful of things. In a chat you copy-paste each passage to
19
+ quote it, type your feedback, then lose track across turns of what's been handled.
20
+ Instead of working in a linear, unstructured chat stream, r3 works like the code
21
+ review tools you're used to, but just for you and your agents, and it runs fully
22
+ locally.
23
+
24
+ <div align="center">
25
+ <video src="https://github.com/user-attachments/assets/0c1aefaf-0229-49e7-a4dc-e660dc0214f6" width="760" muted controls></video>
26
+ </div>
27
+
28
+ ## Workflow
29
+
30
+ The point of r3 is a tight, copy-paste-free review loop between you and an agent.
31
+
32
+ ```mermaid
33
+ sequenceDiagram
34
+ participant A as Agent
35
+ participant S as r3 server
36
+ participant U as You (browser)
37
+
38
+ A->>S: [1] `r3 create` — opens a review, shares the URL
39
+ loop until you Approve or Abandon
40
+ A->>S: [2] `r3 watch` (blocks for feedback)
41
+ U->>S: [3] leave feedback + Submit
42
+ S-->>A: `r3 watch` prints your feedback to stdout and exits
43
+ A->>S: [4] `r3 reply` by feedback id
44
+ S-->>U: [5] web UI updates live
45
+ end
46
+ ```
47
+
48
+ 1. The agent starts a review with **`r3 create`** and shares the URL.
49
+ 2. The agent runs **`r3 watch <id>`**, which registers as a live watcher and
50
+ waits for feedback.
51
+ 3. You leave feedback anchored to the exact lines it's about, then click
52
+ **Submit**. `watch` prints your feedback to stdout that's captured by the agent.
53
+ 4. The agent works each item and **replies by feedback id**
54
+ (`r3 reply <fid> -m "what I changed"`), saying what it changed, or the
55
+ reasoning for why it didn't.
56
+ 5. Every reply lands on the web UI through live updates. The agent `watch`es again
57
+ until you **Approve** or **Abandon** the review.
58
+
59
+ ## Quick start
60
+
61
+ r3 is driven by your coding agent, so the quickest start is to point your agent at
62
+ it. Drop this into your agent's instructions file (`AGENTS.md`, `CLAUDE.md`, or
63
+ your tool's equivalent), or just try it out by pasting it into a new session:
64
+
65
+ ```md
66
+ This project uses r3 for review. Run it with whichever of these you have:
67
+ `npx @hyperlogue/r3@latest`, `bunx @hyperlogue/r3@latest`, or `nix run github:hyperlogue/r3 --`.
68
+ `r3 guide` will show how to use it.
69
+ ```
70
+
71
+ Then just ask: "put your changes up for review." Your agent runs
72
+ `npx @hyperlogue/r3@latest create …`, shares the URL, and waits while you leave feedback in
73
+ the browser. The launcher lazily starts the web server on localhost and opens the
74
+ review.
75
+
76
+ One **web server** spans all your repos on a stable port (default 8791). The first
77
+ call spawns it automatically, so there's nothing to start by hand;
78
+ `r3 start | stop | status | restart` manage it explicitly. Open
79
+ http://127.0.0.1:8791/ to see every project's reviews in one tab.
80
+
81
+ No config needed: reviews live in one global sqlite at `$XDG_STATE_HOME/r3/r3.sqlite`
82
+ keyed by a **projects registry** (so worktrees of one clone are one project and
83
+ copies stay separate), and the web server announces itself in `$XDG_RUNTIME_DIR/r3/daemon.json`
84
+ so the CLI finds it with zero config. Run the CLI from any git repo, and it tells
85
+ the web server which project/worktree the call targets.
86
+
87
+ You rarely type the commands yourself — you ask your agent, and it runs the right
88
+ `r3 create`:
89
+
90
+ ```text
91
+ "Put your working changes up for review."
92
+ → diff review of the working tree
93
+
94
+ "Open a review of the plan doc so I can comment on it."
95
+ → files review of that file, watched live as the agent keeps editing
96
+
97
+ "Let me review the diff between main and this branch."
98
+ → diff review of the range
99
+
100
+ "Start a review with a scratch folder and put your draft design doc there."
101
+ → adhoc scratch review with no git source
102
+ ```
103
+
104
+ To install `r3` permanently — a persistent command instead of `npx`/`bunx` each
105
+ time — add `-g`:
6
106
 
7
107
  ```sh
8
- bunx @hyperlogue/r3 create --working # or: npx @hyperlogue/r3 create --working
108
+ npm install -g @hyperlogue/r3 # or: bun add -g @hyperlogue/r3
9
109
  ```
10
110
 
11
- This package is a tiny launcher. The native `r3` binary for your platform ships
12
- as a per-platform **optional dependency** (`@hyperlogue/r3-darwin-arm64`,
13
- `-linux-x64`, …), so your package manager installs only the one that matches your
14
- OS/CPU — no download at run time, and `npx @hyperlogue/r3@x.y.z` deterministically
15
- runs that version's binary. The launcher just resolves the installed binary and
16
- execs it, forwarding argv, stdio, and the exit code.
111
+ Then run `r3 …` from anywhere.
17
112
 
18
- The binary is fully self-contained (it embeds its runtime, deps, and web UI), so
19
- `bunx` and `npx` behave identically.
113
+ ## Reviews
20
114
 
21
- ## Supported platforms
115
+ Every review is one of two kinds:
22
116
 
23
- macOS and Linux (glibc), `arm64` / `x64`. On anything else the launcher tells you
24
- to [build from source](https://github.com/hyperlogue/r3).
117
+ - A **files review** is a live view of a set of files as they are right now. r3
118
+ watches them and re-renders on every change, so it fits work in progress: a
119
+ design doc your agent is still writing, or a few source files you want to read
120
+ together.
121
+ - A **diff review** is a frozen record of a change: a commit, a branch range, your
122
+ working tree, or any diff. It doesn't move once captured, and follow-up work
123
+ lands as new rounds you can compare against.
25
124
 
26
- ## Environment overrides
125
+ Feedback anchors to a **quote**, not a line number: in a files review your notes
126
+ follow the code as it's edited; in a diff review the rounds are immutable, so
127
+ nothing drifts.
27
128
 
28
- | Variable | Effect |
29
- | --- | --- |
30
- | `R3_BINARY` | Path to a prebuilt `r3` binary to run directly, bypassing package resolution (dev / offline / air-gapped / a platform off the published matrix). |
129
+ ## Remote access
31
130
 
32
- If the launcher reports that the platform package "is not installed," it's almost
33
- always a stale lockfile (a [known npm optional-dependencies
34
- bug](https://github.com/npm/cli/issues/4828)) remove `node_modules` and the
35
- lockfile and reinstall, or grab a binary from
36
- [GitHub Releases](https://github.com/hyperlogue/r3/releases) and point `R3_BINARY`
37
- at it.
131
+ If you work on a remote dev server, r3 listens on loopback there, and you reach
132
+ its web UI from your local device through a tunnel. Set one up however you like: an SSH
133
+ forward (`ssh -L 8791:localhost:8791 devbox`), `tailscale serve`, or a Cloudflare
134
+ tunnel. **Never** bind `0.0.0.0`.
38
135
 
39
- For the full tool docs, see the [project README](https://github.com/hyperlogue/r3#readme).
136
+ Env: `R3_PORT` (default 8791), `R3_BIND` (default `127.0.0.1`), `R3_ALLOWED_HOSTS`
137
+ (comma-separated exact Host names, never `*`), `R3_PUBLIC_URL`.
package/launch.mjs CHANGED
@@ -12,7 +12,7 @@
12
12
  // SPA), so whichever runtime ran this launcher is irrelevant to how r3 itself runs.
13
13
 
14
14
  import { spawn } from "node:child_process";
15
- import { chmodSync, existsSync } from "node:fs";
15
+ import { chmodSync } from "node:fs";
16
16
  import { createRequire } from "node:module";
17
17
  import { constants } from "node:os";
18
18
 
@@ -57,13 +57,6 @@ function muslFail() {
57
57
  }
58
58
 
59
59
  function resolveBinary() {
60
- // Escape hatch first — run a prebuilt binary on ANY platform (dev / testing /
61
- // offline / a target off the published matrix), before the platform guard.
62
- if (process.env.R3_BINARY) {
63
- if (!existsSync(process.env.R3_BINARY)) fail(`R3_BINARY not found: ${process.env.R3_BINARY}`);
64
- return process.env.R3_BINARY;
65
- }
66
-
67
60
  const key = `${process.platform}-${process.arch}`;
68
61
  const pkg = PACKAGES[key];
69
62
  if (!pkg) {
@@ -91,8 +84,7 @@ function resolveBinary() {
91
84
  ` This is usually a stale lockfile (npm optional-dependencies bug). Try:\n` +
92
85
  ` • reinstall: rm -rf node_modules package-lock.json && npm install\n` +
93
86
  ` • clear the npx cache, then retry: npx --yes @hyperlogue/r3 …\n` +
94
- ` • run a prebuilt binary directly: set R3_BINARY=/path/to/r3\n` +
95
- ` • download one from ${REPO}/releases`,
87
+ ` • download a prebuilt binary from ${REPO}/releases`,
96
88
  );
97
89
  }
98
90
  }
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@hyperlogue/r3",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Review. Revise. Resolve. — a local-first review tool for AI-generated code and docs. Runs the matching prebuilt native r3 binary (shipped as a per-platform optional dependency); works with `bunx @hyperlogue/r3` and `npx @hyperlogue/r3`.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
+ "scripts": {
11
+ "prepack": "cp ../README.md ./README.md"
12
+ },
10
13
  "bin": {
11
14
  "r3": "launch.mjs"
12
15
  },
@@ -14,10 +17,10 @@
14
17
  "launch.mjs"
15
18
  ],
16
19
  "optionalDependencies": {
17
- "@hyperlogue/r3-darwin-arm64": "0.1.0",
18
- "@hyperlogue/r3-darwin-x64": "0.1.0",
19
- "@hyperlogue/r3-linux-x64": "0.1.0",
20
- "@hyperlogue/r3-linux-arm64": "0.1.0"
20
+ "@hyperlogue/r3-darwin-arm64": "0.1.1",
21
+ "@hyperlogue/r3-darwin-x64": "0.1.1",
22
+ "@hyperlogue/r3-linux-x64": "0.1.1",
23
+ "@hyperlogue/r3-linux-arm64": "0.1.1"
21
24
  },
22
25
  "engines": {
23
26
  "node": ">=18"