@levistudio/redline 0.4.0 → 0.4.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.
- package/CHANGELOG.md +7 -1
- package/package.json +1 -1
- package/skills/redline-review/SKILL.md +8 -10
- package/src/agent.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to Redline are documented here. The format follows [Keep a C
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.4.1] - 2026-05-15
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- `redline-review` now launches Redline with `--open` so agent sessions open the review in the user's real browser instead of relying on clickable localhost links that some agent UIs capture in an embedded preview panel.
|
|
11
|
+
|
|
7
12
|
## [0.4.0] - 2026-05-15
|
|
8
13
|
|
|
9
14
|
### Added
|
|
@@ -60,7 +65,8 @@ Initial public release on npm as `@levistudio/redline`.
|
|
|
60
65
|
- Auto-installs missing dependencies on first CLI run.
|
|
61
66
|
- Initial test suite: server, sidecar, parsing, model-picking, rendering, diff, SSE, integration, happy-dom client.
|
|
62
67
|
|
|
63
|
-
[Unreleased]: https://github.com/alevi/redline/compare/v0.4.
|
|
68
|
+
[Unreleased]: https://github.com/alevi/redline/compare/v0.4.1...HEAD
|
|
69
|
+
[0.4.1]: https://github.com/alevi/redline/compare/v0.4.0...v0.4.1
|
|
64
70
|
[0.4.0]: https://github.com/alevi/redline/compare/v0.3.0...v0.4.0
|
|
65
71
|
[0.3.0]: https://github.com/alevi/redline/releases/tag/v0.3.0
|
|
66
72
|
[0.2.0]: https://github.com/alevi/redline/releases/tag/v0.2.0
|
package/package.json
CHANGED
|
@@ -20,8 +20,8 @@ STARTUP="$DIR/.review/$BASE.startup.json"
|
|
|
20
20
|
RESULT="$DIR/.review/$BASE.result"
|
|
21
21
|
LOG=/tmp/redline-$BASE.log
|
|
22
22
|
|
|
23
|
-
# Kick off the review in the background.
|
|
24
|
-
__REDLINE_BIN__ "$FILE" > "$LOG" 2>&1 &
|
|
23
|
+
# Kick off the review in the background and open it in the user's real browser.
|
|
24
|
+
__REDLINE_BIN__ "$FILE" --open > "$LOG" 2>&1 &
|
|
25
25
|
|
|
26
26
|
# Step 1: wait for startup, read the URL.
|
|
27
27
|
for i in $(seq 1 60); do [ -f "$STARTUP" ] && break; sleep 0.5; done
|
|
@@ -34,7 +34,7 @@ PID=$(grep -o '"pid": *[0-9]*' "$STARTUP" | grep -o '[0-9]*')
|
|
|
34
34
|
echo "REDLINE_URL: $URL"
|
|
35
35
|
echo "REDLINE_PID: $PID"
|
|
36
36
|
|
|
37
|
-
# Step 2:
|
|
37
|
+
# Step 2: tell the human the browser opened (you do this after the first shell call returns
|
|
38
38
|
# — see the next section), then wait for the redline process to exit. Watching
|
|
39
39
|
# the PID (essentially free) instead of polling for the result file means you
|
|
40
40
|
# wake up within ~0.5s of the human clicking Done, not up to 30s later.
|
|
@@ -46,7 +46,7 @@ The startup file at `.review/<basename>.startup.json` is written synchronously w
|
|
|
46
46
|
|
|
47
47
|
In practice, run the script above as **two separate shell calls** so you can tell the human the URL between steps:
|
|
48
48
|
1. First call: everything through `echo "REDLINE_PID: $PID"`. Returns in ~1s with the URL and PID on stdout.
|
|
49
|
-
2.
|
|
49
|
+
2. Tell the human Redline opened in their browser, and include the URL only as a fallback (see "Surfacing the URL" below).
|
|
50
50
|
3. Second call: just the `while kill -0` loop waiting for the PID, then `cat "$RESULT"`. Long timeout (`timeout: 1800000` = 30 min, or longer).
|
|
51
51
|
|
|
52
52
|
If invocation fails (binary missing, startup file never appears, etc.), surface the error verbatim and stop — do not try to recover. The human will re-run `redline install-skill`.
|
|
@@ -61,11 +61,9 @@ The context string is shown in the reader's header so the human knows what they'
|
|
|
61
61
|
|
|
62
62
|
### Surfacing the URL
|
|
63
63
|
|
|
64
|
-
After the first shell call returns with `REDLINE_URL: http://localhost:NNNN`,
|
|
64
|
+
The `--open` flag launches the review in the user's real browser via the OS opener (`open` on macOS, `xdg-open` on Linux, `start` on Windows). After the first shell call returns with `REDLINE_URL: http://localhost:NNNN`, tell the human the browser opened and include the URL only as a fallback. Do **not** make the URL the primary action; in some agent UIs, clicking localhost opens an embedded preview panel instead of the user's browser.
|
|
65
65
|
|
|
66
|
-
> "
|
|
67
|
-
|
|
68
|
-
(There is an `--open` flag that auto-launches the browser, but prefer leaving it off — the human may not be at the keyboard the moment the session starts, and a stolen-focus browser tab is worse than a URL they click when ready.)
|
|
66
|
+
> "I opened this in Redline in your browser. Fallback URL: http://localhost:NNNN. I'll continue once you click Done."
|
|
69
67
|
|
|
70
68
|
## How to interpret the result
|
|
71
69
|
|
|
@@ -87,8 +85,8 @@ The full loop, when you are the outer agent producing the doc:
|
|
|
87
85
|
|
|
88
86
|
1. Write the markdown file to disk at an absolute path.
|
|
89
87
|
2. Tell the human in one sentence what's about to happen.
|
|
90
|
-
3. First shell call: launch `__REDLINE_BIN__ <abs-path> --context "<one-liner>"` in the background and poll for `.startup.json`. Returns in ~1s with the URL.
|
|
91
|
-
4.
|
|
88
|
+
3. First shell call: launch `__REDLINE_BIN__ <abs-path> --context "<one-liner>" --open` in the background and poll for `.startup.json`. Returns in ~1s with the URL.
|
|
89
|
+
4. Tell the human Redline opened in their browser and include the URL only as a fallback.
|
|
92
90
|
5. Second shell call: wait on the redline PID (`while kill -0 "$PID" 2>/dev/null; do sleep 0.5; done`) then `cat "$RESULT"`, with a long timeout (30+ min). While the session runs, you are idle — do not start unrelated work, do not run other tools.
|
|
93
91
|
6. On `approved`: re-read the file from disk (it may have been revised) and continue with whatever required sign-off.
|
|
94
92
|
7. On `abandoned` or `error`: stop and ask the human how to proceed; do not retry automatically.
|
package/src/agent.ts
CHANGED
|
@@ -91,7 +91,7 @@ const REPLY_SYSTEM_PROMPT_BODY =
|
|
|
91
91
|
"Good: message: \"Got it.\" reason: \"Add a third line to the hard line breaks example\"\n" +
|
|
92
92
|
"When requires_revision is false, leave reason empty (or a very short note about why no edit). The reply IS the answer.\n" +
|
|
93
93
|
"\n" +
|
|
94
|
-
"Separately, decide whether this comment needs the agent that LAUNCHED this review rather than you.
|
|
94
|
+
"Separately, decide whether this comment needs the agent that LAUNCHED this review rather than you. ESCALATE is rare: set ESCALATE: true only when the reviewer explicitly asks for information, tools, authority, or project context you cannot access from the document and comment thread — for example an external style guide, a hidden spec, repo-wide code context, or a decision the launching agent must make. Do NOT escalate ordinary requested edits, reframes, emphasis changes, priority changes, rewrites, or approvals; those are handled by requires_revision. If the comment can be satisfied by editing this document, set ESCALATE: false. When you do escalate, briefly tell the reviewer in your message that you've routed it to the launching agent. Escalating does not change requires_revision — judge that on its own.\n" +
|
|
95
95
|
"\n" +
|
|
96
96
|
"Output exactly this format and nothing else (no prose before/after, no code fences). Use these literal markers — do not escape quotes inside the message:\n" +
|
|
97
97
|
"REQUIRES_REVISION: <true|false>\n" +
|