@khanglvm/relay 0.14.2 → 0.15.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
@@ -93,7 +93,7 @@ actually needs them.
93
93
  | `rly help` | every command at a glance |
94
94
  | `rly git pick` / `rly git cherry-pick` | choose commit actions and rank the order directly on a board; add `--code` to cherry-pick with split code review and per-hunk Apply/Skip/Hold |
95
95
  | `rly git conflict [files…]` | auto-detect unmerged conflict files, or open specific local paths, and return resolved content in `result.blockEdits` |
96
- | `rly share <board-id>` | activate/list/revoke same-Wi-Fi reviewer or collaborator links for a running browser board |
96
+ | `rly share <board-id>` | activate/list/revoke same-Wi-Fi collaborator, reference-only reviewer, or read-only links for a running browser board |
97
97
  | `rly view <file.md> …` | open a quick read-only board that renders local markdown file(s), data files, or PDFs — library-free; great for plans, READMEs, reports, quotes |
98
98
  | `rly install --target <agent>` | write relay's rules into an agent's instruction file — `claude` `codex` `cursor` `copilot` `kiro` `windsurf` `cline` `gemini` `opencode` `droid` `agents`; `--all`, `--scope`, `--print`, `--list` |
99
99
  | `rly upgrade` | update the CLI **and** refresh the skill in one step (safe around open boards; `--dry-run`, `--cli-only`, `--skill-only`) |
@@ -177,7 +177,8 @@ npm test # smoke tests with no external services (spawns real servers, fake-
177
177
  whose connection drops blocks further input instead of losing it, and
178
178
  `rly rescue <id>` re-serves on the same port so an open tab reconnects. Active
179
179
  same-Wi-Fi share links stay tied to the board and survive a same-port re-serve
180
- until revoked.
180
+ until revoked. Reviewer submissions are isolated, reference-only side reviews
181
+ that never finish the owner's board; read-only links cannot mutate feedback.
181
182
  - Still **zero npm runtime dependencies**, offline, and cross-platform. Vendored
182
183
  browser libraries are loaded only for boards that need them.
183
184
 
package/docs/AGENT.md CHANGED
@@ -79,19 +79,24 @@ click the topbar **Share** icon, or you can manage the same links for the user:
79
79
 
80
80
  ```sh
81
81
  rly share b-xxxxx # list active share roles
82
- rly share b-xxxxx --role review # reviewer: add comments only
83
- rly share b-xxxxx --role collab # collaborator: edit/comment/submit
82
+ rly share b-xxxxx --role review # reviewer: answer/comment + submit a side review
83
+ rly share b-xxxxx --role collab # collaborator: edit/comment/final-submit as owner-authorized
84
+ rly share b-xxxxx --role read # read-only viewer: no answers/comments/submit
84
85
  rly share b-xxxxx --role review --revoke # revoke one role
85
86
  rly share b-xxxxx --revoke --all # revoke all active links
86
87
  ```
87
88
 
88
- Use `review` unless the user explicitly wants the other device to submit as the
89
- owner. Reviewers cannot change answers, submit, edit comments, or delete
90
- comments; their autosaves merge new comments into the existing draft.
91
- Collaborators can edit answers, comment, open allowed local file links, and
92
- submit. Shared viewers refresh from the live draft when another viewer saves,
93
- deferred while someone is typing/commenting. Active share links keep the same
94
- token across a same-port `rly reopen`/`rly rescue` until revoked.
89
+ Use `review` for independent feedback: each browser gets an isolated review
90
+ draft and may answer, comment, and submit, but the submission is stored as a
91
+ **reference-only side review**. It does not finish the board, wake the agent, or
92
+ complete `rly wait`; the owner (or an owner-authorized collaborator) must still
93
+ submit the final answer. `rly result <id>` exposes current side-review drafts and
94
+ submissions on demand under `sideReviews`, clearly marked `referenceOnly:true`.
95
+ Use `read` when the other device should only view the board and existing
96
+ feedback. Read-only viewers cannot answer, comment, edit blocks, open local file
97
+ links, or submit. Collaborators retain owner-authorized edit/comment/final-submit
98
+ permission. Active links keep the same token across a same-port
99
+ `rly reopen`/`rly rescue` until revoked.
95
100
 
96
101
  ## Inline mode — relay as an MCP App (Claude & Codex apps)
97
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanglvm/relay",
3
- "version": "0.14.2",
3
+ "version": "0.15.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",
@@ -189,16 +189,22 @@ with `rly share`:
189
189
  rly share b-xxxxx # list active share roles
190
190
  rly share b-xxxxx --role review # activate a reviewer link
191
191
  rly share b-xxxxx --role collab # activate a collaborator link
192
+ rly share b-xxxxx --role read # activate a read-only link
192
193
  rly share b-xxxxx --role review --revoke # revoke one role
193
194
  rly share b-xxxxx --revoke --all # revoke all active share links
194
195
  ```
195
196
 
196
- Use `review` when the other device should add comments only. Reviewers cannot
197
- change answers, submit, edit comments, or delete comments; their autosaves merge
198
- new comments into the existing draft. Use `collab` only when the user explicitly
197
+ Use `review` for independent feedback. Each reviewer browser gets an isolated
198
+ draft and can answer, comment, and submit a **reference-only side review**. That
199
+ submission never finishes the board or wakes/completes the waiting agent; the
200
+ owner (or owner-authorized collaborator) must still provide the final answer.
201
+ When the owner asks for current reviewer input, run `rly result <id>` and inspect
202
+ `sideReviews.submissions` plus `sideReviews.drafts`; both are explicitly marked
203
+ reference-only. Use `read` for a view-only link with no answers, comments, block
204
+ edits, local-file opening, or submit. Use `collab` only when the user explicitly
199
205
  wants that device to act as the owner: collaborators can edit answers, comment,
200
- open allowed local file links, and submit. Shared viewers refresh from the live
201
- draft when another viewer saves, deferred while someone is typing/commenting.
206
+ open allowed local file links, and final-submit. Shared viewers refresh from the
207
+ relevant live draft when another viewer in the same role/session saves.
202
208
  Active share links are durable too: they keep the same token across a same-port
203
209
  `rly reopen`/`rly rescue` until `rly share --revoke` disables them.
204
210
 
package/src/cli.js CHANGED
@@ -761,21 +761,27 @@ async function cmdWaitLoop(id, deadline, opts) {
761
761
 
762
762
  async function cmdResult(args) {
763
763
  const record = mustLoad(args._[0]);
764
+ const sideReviews = {
765
+ referenceOnly: true,
766
+ note: 'Side reviews are reference only. Wait for the board owner (or owner-authorized collaborator) to submit the final answer.',
767
+ submissions: Array.isArray(record.sideReviews) ? record.sideReviews : [],
768
+ drafts: record.reviewDrafts && typeof record.reviewDrafts === 'object' ? record.reviewDrafts : {},
769
+ };
764
770
  if (record.result && record.result.finishedAt) {
765
- printResult(record.result);
771
+ printResult({ ...record.result, sideReviews });
766
772
  return exitCodeFor(record.result.status);
767
773
  }
768
774
  const running = loadRunning(record.id);
769
775
  if (running && isAlive(running.pid)) {
770
776
  // While open, expose the real-time autosaved draft so agents can peek, plus
771
777
  // best-effort presence (whether the user is still viewing/focused/active).
772
- const out = { status: 'open', boardId: record.id, url: running.url, draft: record.draft ?? null };
778
+ const out = { status: 'open', boardId: record.id, url: running.url, draft: record.draft ?? null, sideReviews };
773
779
  const presence = await fetchPresence(running.url);
774
780
  if (presence) out.presence = presence;
775
781
  printResult(out); // draft can hold many annotations — sidecar it too
776
782
  return 0;
777
783
  }
778
- printResult({ status: 'lost', boardId: record.id, draft: record.draft ?? null });
784
+ printResult({ status: 'lost', boardId: record.id, draft: record.draft ?? null, sideReviews });
779
785
  return 5;
780
786
  }
781
787
 
@@ -785,9 +791,10 @@ async function cmdShare(args) {
785
791
  if (!running || !isAlive(running.pid)) {
786
792
  throw new CliError(`board "${record.id}" is not running. Use \`rly reopen ${record.id} --detach\` first.`, 5);
787
793
  }
788
- const role = args.all ? 'all' : args.role;
789
- if (role !== undefined && !['collab', 'review', 'all'].includes(role)) {
790
- throw new CliError('--role must be collab or review.', 4);
794
+ let role = args.all ? 'all' : args.role;
795
+ if (role === 'readonly' || role === 'read-only') role = 'read';
796
+ if (role !== undefined && !['collab', 'review', 'read', 'all'].includes(role)) {
797
+ throw new CliError('--role must be collab, review, or read.', 4);
791
798
  }
792
799
  const shareUrl = new URL('/api/share', running.url);
793
800
  let res;
@@ -1100,8 +1107,10 @@ the user should view — put it in relay instead of printing it.**
1100
1107
  option its own visual (\`options[].blocks\`) so the user picks by looking.
1101
1108
  - Same-Wi-Fi sharing is locked by default. When the user wants another device to
1102
1109
  review or co-fill a running board, manage explicit links with \`rly share <id>\`:
1103
- \`--role review\` creates a comments-only reviewer link, \`--role collab\` creates
1104
- an edit/comment/submit link, and \`--revoke\` disables active links. Active
1110
+ \`--role review\` creates an answer/comment link whose submissions are reference-only
1111
+ side reviews (\`rly result\` exposes them but they never complete \`rly wait\`),
1112
+ \`--role collab\` creates an owner-authorized edit/comment/final-submit link,
1113
+ \`--role read\` creates a view-only link, and \`--revoke\` disables active links. Active
1105
1114
  share links are durable across same-port \`rly reopen\`/\`rly rescue\` until
1106
1115
  revoked.
1107
1116
  - **There's a purpose-built component for most content — use the MOST SPECIFIC one,
@@ -1610,8 +1619,9 @@ USAGE
1610
1619
  read that file if your shell truncates stdout; never pipe to head/tail
1611
1620
  rly result <id> result/status now (includes live autosaved draft + presence while open)
1612
1621
  rly share <id> list active same-Wi-Fi share links for a running board
1613
- rly share <id> --role review activate a reviewer link (comments only)
1614
- rly share <id> --role collab activate a collaborator link (edit/comment/submit)
1622
+ rly share <id> --role review reviewer: answer/comment/submit a reference-only side review
1623
+ rly share <id> --role collab collaborator: edit/comment/final-submit as owner-authorized
1624
+ rly share <id> --role read activate a read-only viewer link
1615
1625
  rly share <id> --role review --revoke
1616
1626
  revoke one share role; use --revoke --all to disable all roles
1617
1627
  active links survive same-port reopen/rescue until revoked