@khanglvm/relay 0.16.0 → 0.17.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
@@ -78,7 +78,7 @@ unchanged; pick whichever surface fits.
78
78
  | "Here's the diff — paste it in your editor" | Side-by-side **diff** blocks, syntax-highlighted **code**, **video** walkthroughs, and **file paths you click to open** in the default app |
79
79
  | "Which commits should I pick? Resolve this conflict manually." | `rly git pick` / `rly git cherry-pick` boards and color-coded `git-conflict` resolvers with ours/theirs/custom hunk choices |
80
80
  | "Type *done* when finished reviewing" | A Submit button; answers, notes, and inline comments returned as JSON |
81
- | Feedback = another wall of text | Click any chart point, diagram node, table cell, or sentence; hold+drag an image area to attach a local crop — the agent replies and the thread grows on the board |
81
+ | Feedback = another wall of text | Click any chart point, diagram node, table cell, or sentence; drag an image region to attach a local crop — the agent replies and the thread grows on the board |
82
82
 
83
83
  Everything autosaves in real time, detached board links keep serving after
84
84
  agent timeouts, multiple boards run at once, and the package has **zero npm
@@ -111,6 +111,25 @@ npm test # smoke tests with no external services (spawns real servers, fake-
111
111
 
112
112
  ## Changelog
113
113
 
114
+ ### 0.16.1 — reliable area-comment zones
115
+
116
+ - Primary drag now draws a comment area directly on image and comparison views;
117
+ **Area** remains as a visible one-shot lock. Image pan uses Space-drag or the
118
+ middle button, while the comparison divider moves only from its handle.
119
+ - The selected rectangle remains visible while its comment is composed. Saved
120
+ zones carry a comment icon plus count, reopen for add/edit/delete, and disappear
121
+ automatically when their final comment is removed.
122
+
123
+ ### 0.17.0 — file reference previews
124
+
125
+ - Local source references now resolve `:line[:column]` and `#Lstart-Lend` and
126
+ open in a keyboard-accessible modal at the cited lines.
127
+ - Preview Markdown, source/config/logs, CSV/TSV, static sandboxed HTML, images,
128
+ PDFs, and browser-compatible audio/video. Text is bounded to 1 MiB/20,000
129
+ lines; unsupported files retain an explicit **Open in app** fallback.
130
+ - Shorter agent skill and installed instructions, with clear display-only,
131
+ feedback, file-preview, and existing-board workflows.
132
+
114
133
  ### 0.16.0 — native viewer chrome, area comments, and durable agent waits
115
134
 
116
135
  - Viewer toolbars now use browser-native sticky positioning instead of a
package/docs/AGENT.md CHANGED
@@ -1,26 +1,15 @@
1
1
  # relay (`rly`) — agent guide
2
2
 
3
- Purpose: ask the human structured questions in a browser tab and/or show them
4
- rich content blocks (markdown, charts, diagrams, tables, code, custom HTML),
5
- then **wait for them to click Submit** and read the answers as JSON from stdout.
6
- No "type 'done' in the terminal", no hand-rolled HTML+server.
7
-
8
- **Match the surface to the content.** You run inside a terminal, an IDE side-panel
9
- (VS Code / JetBrains / Cursor), or a plain-text chat — none of which can render a
10
- markdown file, an image, a chart, a table, a diagram, or a diff. They degrade to
11
- walls of monospace text, or can't show it at all (a terminal can't draw a PNG).
12
- relay renders it in a real browser board. So whenever your output would read better
13
- than monospace — or is a file/visual the user should look at — show it in relay
14
- instead of printing it. Fast paths: `rly view file.md` (or `data.csv`), `rly diff`,
15
- `rly git pick` / `rly git conflict`, or an `image`/`chart`/`table` block on a board.
16
-
17
- **Use relay even in plan mode** — for any clarifying or decision question (Claude
18
- Code / Codex), route it through a relay board, **not** the native
19
- `AskUserQuestion` / ask-user tool: that tool is **not** a substitute, even though
20
- plan-mode guidance suggests it. Do NOT ask in plain terminal text and do NOT
21
- reach for the native ask tool for anything beyond one trivial yes/no — open a
22
- board. Reserve the harness's `ExitPlanMode` strictly for the final plan-approval
23
- gate (it's a mode transition, not a question).
3
+ Use Relay to present files, visuals, substantial plans, diffs, and related user
4
+ questions. Choose purpose-built blocks so users can inspect the content and
5
+ leave precise feedback. Keep short answers and progress updates in chat.
6
+ Respect the user’s existing authorization; boards do not add approval gates.
7
+ For a concise workflow, read the bundled skill (`rly skill path`). This guide is
8
+ a reference for fields and less common operations.
9
+
10
+ Use `rly show --file spec.json --display-only` when no response is needed. Use
11
+ `rly ask --file spec.json --detach` and a waiter for answers or comments.
12
+ Fast paths include `rly view`, `rly diff`, and `rly git`.
24
13
 
25
14
  **Tell the user** at the start of your intro text that they can hover chart
26
15
  points, diagram nodes, table cells, and any element of a custom-HTML block to
@@ -495,15 +484,28 @@ Rules of thumb:
495
484
  // tagTone (optional pill color): warm | cool | neutral | nature | bold | digital
496
485
  ```
497
486
 
498
- ### Local file links — clickable, open in the default app
499
-
500
- Inside any **markdown** (the intro or a `markdown` block) just write a local
501
- file path — `~/clip.mp4`, `./src/app.ts`, `/abs/report.pdf`, a `file://` URL,
502
- or a backtick-wrapped path — and it renders as a click-to-open link. Clicking it
503
- asks relay to open that file in the user's OS default app (video player, editor,
504
- viewer, …); a `[label](~/path)` link works too. Only paths you actually wrote on
505
- the board can be opened (same-origin + allowlist guarded), so prefer surfacing a
506
- real path over telling the user to paste it into a terminal.
487
+ ### Local file links — preview in a board modal
488
+
489
+ Write `[source](/absolute/path/app.js:98)` in the intro or a markdown block.
490
+ Bare/backtick paths, `./`, `../`, `~/`, and `file://` URLs also work. Encode spaces
491
+ in file URLs (`file:///tmp/My%20Report.md`). The browser board previews supported
492
+ files in a modal and restores focus/scroll when closed. `:line`, `:line:column`,
493
+ and `#Lstart-Lend` select source lines; columns are accepted but not highlighted.
494
+
495
+ UTF-8 source/config/log files show numbered source. Markdown renders as a
496
+ document, CSV/TSV as a table, and HTML as a static sandboxed page; these have a
497
+ Source toggle. Images, PDFs, and browser-compatible audio/video render directly.
498
+ HTML scripts, forms, and external resources are disabled. Text previews are
499
+ limited to 1 MiB and 20,000 lines. Unsupported/binary/oversized files and
500
+ folders offer an explicit **Open in app** action; missing files show an error.
501
+
502
+ Preview/open access is restricted to paths explicitly referenced on the board,
503
+ for owner/collaborator browser sessions only. A preview’s nested links do not
504
+ extend the allowlist. These are live disk views without annotations; use content
505
+ blocks for snapshots or feedback. For inline MCP or reviewer/read-only shares,
506
+ embed the file content using `mdFile`, `codeFile`, or media blocks instead.
507
+ Running boards retain their old UI/server snapshot after upgrade; reconnect the
508
+ same board using the upgraded CLI to activate the viewer.
507
509
 
508
510
  ### When to use which block
509
511
 
@@ -536,7 +538,7 @@ the question-types section above.
536
538
  | `diff` | proposed code changes / before-after — a unified diff rendered as a colored git-style comparison (no git needed) |
537
539
  | `video` | demos, screen recordings, walkthroughs — YouTube/Vimeo embeds, a media URL, or a local video file (streamed) |
538
540
  | `pdf` | quotes, reports, exports, forms — local `.pdf` files or PDF URLs rendered inline; local files stream from the board server |
539
- | `image` | screenshots, mockup exports, photos — local files embed and work offline; hold then drag to comment on an exact area |
541
+ | `image` | screenshots, mockup exports, photos — local files embed and work offline; drag to comment on exact pixels |
540
542
  | `palette` | color palettes / themes — swatch cards with hover-hex + click-to-copy; pair with a `color` question to let the user pick |
541
543
  | `kpi` | big-number metric cards (`items:[{label,value,delta?,dir?,sub?}]`) with up/down/flat-tinted deltas — at-a-glance numbers without a chart |
542
544
  | `typography` | type specimens (`specimens:[{label?,size?,weight?,font?,text?}]`) — react to type choices like a palette |
@@ -550,12 +552,18 @@ click-to-drop coordinate pin-comments. `table` blocks take `"rowsFile"` (load
550
552
  rows from .csv/.tsv/.json), `"filterable"`, and `"exportable"` (CSV download).
551
553
 
552
554
  Every interactive `image` and `compare` block also supports area feedback:
553
- hold briefly, then drag a rectangle. Relay saves a pixel crop beside the board
554
- record and returns its local path with the annotation, so the agent can open the
555
- exact pixels instead of inferring from a whole-image comment. In a comparison,
556
- the side visible where the hold began is recorded as `before` or `after` and the
557
- crop comes from that source image. Remote images that prevent browser canvas
558
- access still return coordinates and a `cropUnavailable` marker.
555
+ primary drag draws a rectangle directly; the viewer's **Area** control remains a
556
+ discoverable one-shot lock for the same gesture. On images, Space-drag or the
557
+ middle mouse button pans. In comparisons, only dragging the divider handle moves
558
+ the split. The provisional rectangle remains visible while the comment is
559
+ composed; a saved zone shows a comment icon plus count and reopens for
560
+ add/edit/delete. Removing its final comment removes the zone. Relay saves a pixel
561
+ crop beside the board record and returns its local path with the annotation, so
562
+ the agent can open the exact pixels instead of inferring from a whole-image
563
+ comment. In a comparison, the visible side where drawing began is recorded as
564
+ `before` or `after` and the crop comes from that source image. Remote images that
565
+ prevent browser canvas access still return coordinates and a `cropUnavailable`
566
+ marker.
559
567
 
560
568
  ### Height rules
561
569
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanglvm/relay",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Question boards with rich blocks (markdown, charts, mermaid, tables, code, diffs, video, sandboxed HTML), clickable local file-links, and element-level annotations for AI coding agents (Claude Code, Codex, …): ask users structured questions, present interactive visuals, collect inline comments, read answers as JSON — in a local browser board OR rendered INLINE inside the Claude & Codex apps as an MCP App (SEP-1865).",
5
5
  "keywords": [
6
6
  "ai-agents",