@khanglvm/relay 0.20.3 → 0.22.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 +1 -1
- package/docs/AGENT.md +35 -62
- package/docs/SETUP.md +3 -2
- package/package.json +17 -5
- package/schema/spec.v1.json +55 -3
- package/skills/relay/SKILL.md +5 -2
- package/src/a2ui/board-catalog.json +1004 -0
- package/src/a2ui/board-constants.js +35 -0
- package/src/a2ui/board.js +5 -0
- package/src/a2ui/from-a2ui.js +71 -0
- package/src/a2ui/negotiate.js +38 -0
- package/src/a2ui/to-a2ui.js +147 -0
- package/src/cli/args.js +1 -1
- package/src/cli/help.js +2 -1
- package/src/cli/mcp.js +23 -3
- package/src/mcp/boards.js +195 -0
- package/src/mcp/config.js +20 -0
- package/src/mcp/constants.js +33 -0
- package/src/mcp/index.js +5 -0
- package/src/mcp/page.js +59 -0
- package/src/mcp/schemas.js +45 -0
- package/src/mcp/serve.js +116 -0
- package/src/mcp/server.js +24 -0
- package/src/mcp/store.js +35 -0
- package/src/mcp/token.js +56 -0
- package/src/mcp/tools.js +179 -0
- package/src/mcp-ui/board/block-ctx.js +22 -0
- package/src/mcp-ui/board/bridge.js +12 -2
- package/src/mcp-ui/board/core.js +2 -0
- package/src/mcp-ui/board/lifecycle.js +47 -9
- package/src/mcp-ui/board/normalize.js +12 -0
- package/src/mcp-ui/board/render.js +38 -45
- package/src/mcp-ui/board/state.js +3 -0
- package/src/mcp-ui/board/vendors.js +56 -11
- package/src/server/board.js +12 -9
- package/src/server/http.js +19 -0
- package/src/server/page.js +4 -0
- package/src/spec/constants.js +13 -1
- package/src/spec/index.js +1 -0
- package/src/spec/lookup.js +1 -0
- package/src/spec/normalize.js +3 -0
- package/src/spec/pick.js +104 -0
- package/src/spec/schema.js +26 -3
- package/src/ui/app/drafts.js +3 -0
- package/src/ui/app/render.js +1 -0
- package/src/ui/app/submit.js +1 -1
- package/src/ui/manifest.js +3 -2
- package/src/ui/pick.css +32 -0
- package/src/ui/pick.js +246 -0
- package/types/a2ui/board-constants.d.ts +24 -0
- package/types/a2ui/from-a2ui.d.ts +16 -0
- package/types/a2ui/negotiate.d.ts +17 -0
- package/types/a2ui/to-a2ui.d.ts +12 -0
- package/types/cli/agent-topics.d.ts +46 -0
- package/types/mcp/boards.d.ts +178 -0
- package/types/{mcp.d.ts → mcp/config.d.ts} +1 -8
- package/types/mcp/constants.d.ts +21 -0
- package/types/mcp/index.d.ts +4 -0
- package/types/mcp/page.d.ts +27 -0
- package/types/mcp/schemas.d.ts +49 -0
- package/types/mcp/serve.d.ts +16 -0
- package/types/mcp/server.d.ts +4 -0
- package/types/mcp/store.d.ts +52 -0
- package/types/mcp/token.d.ts +9 -0
- package/types/mcp/tools.d.ts +17 -0
- package/types/server/result.d.ts +10 -0
- package/types/server/sanitize.d.ts +6 -0
- package/types/spec/constants.d.ts +9 -0
- package/types/spec/index.d.ts +1 -0
- package/types/spec/lookup.d.ts +2 -1
- package/types/spec/pick.d.ts +25 -0
- package/types/spec/schema.d.ts +48 -0
- package/src/mcp.js +0 -483
package/README.md
CHANGED
package/docs/AGENT.md
CHANGED
|
@@ -4,6 +4,7 @@ Use Relay to present files, visuals, substantial plans, diffs, and related user
|
|
|
4
4
|
questions. Choose purpose-built blocks so users can inspect the content and
|
|
5
5
|
leave precise feedback. Keep short answers and progress updates in chat.
|
|
6
6
|
Respect the user’s existing authorization; boards do not add approval gates.
|
|
7
|
+
If your host app has its own way to ask the user or show results (native question cards, forms, pickers), use that for those. Use Relay for what the host can't show: line comments on a diff, Mermaid or Graphviz diagrams, element comments on an HTML prototype, rich multi-block review boards.
|
|
7
8
|
For a concise workflow, read the bundled skill (`rly skill path`). This guide is
|
|
8
9
|
a reference for fields and less common operations. Load one part with
|
|
9
10
|
`rly agent <topic>` (`questions`, `blocks`, `annotate`, `lifecycle`, `sharing`,
|
|
@@ -52,6 +53,7 @@ stderr. Exit codes: `0` submitted/acknowledged · `2` timeout · `3` cancelled
|
|
|
52
53
|
{"id":"signoff","type":"checklist","label":"Sign off each area","options":["login","billing"]} // pass/fail/N-A per item: one checklist, not many yes/no
|
|
53
54
|
{"id":"rank","type":"rank","label":"Priorities","options":["speed","a11y"]} {"id":"split","type":"allocate","label":"Budget","total":100,"options":["type","space"]}
|
|
54
55
|
{"id":"c","type":"single","label":"Scheme?","options":[{"value":"warm","label":"Warm","blocks":[{"type":"html","html":"<div style='height:100%;background:#c2674b'></div>","height":140}]}]} // a visual per option
|
|
56
|
+
{"id":"hero","type":"pick","label":"Shortlist two","max":2,"items":[{"id":"a","title":"Warm","image":"/abs/a.png","caption":"Terracotta"},{"id":"b","title":"Demo","video":"https://example.com/b.mp4"},{"id":"c","title":"Ref","url":"https://example.com/c"}]} // media tiles; answer {picks:[{id,note?}],overall?}; max 1 = single, min/max bound a multi
|
|
55
57
|
{"id":"s","type":"scale","label":"Rate","min":1,"max":5} {"id":"col","type":"color","label":"Brand color"} {"id":"ship","type":"yesno","label":"Ship?"}
|
|
56
58
|
```
|
|
57
59
|
Buttons inside a2ui do not replace a question. Their clicks return in `blockEdits`.
|
|
@@ -134,62 +136,25 @@ Report the printed URL to the user and never a `localhost`, `127.0.0.1` or
|
|
|
134
136
|
in the URL and the network behind the link are the access control. Use
|
|
135
137
|
`rly share <id> --revoke --all` to cut access.
|
|
136
138
|
|
|
137
|
-
## Inline mode
|
|
138
|
-
|
|
139
|
-
Everything
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
tools
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
- **Free MCP hosts** — the repo's `Dockerfile` runs relay with zero config on
|
|
157
|
-
**mcpdeploy.dev**, **mcphosting.io**, **Render / Railway / Fly**, or **Glama**;
|
|
158
|
-
the platform's `$PORT` is honored automatically. Set `RLY_MCP_TOKEN` for a
|
|
159
|
-
bearer-protected endpoint.
|
|
160
|
-
- **Smithery** (largest MCP marketplace) — publish the deployed URL with
|
|
161
|
-
`smithery mcp publish <url> -n @you/relay` for discovery + an OAuth gateway, or
|
|
162
|
-
distribute relay as a stdio bundle clients run locally.
|
|
163
|
-
|
|
164
|
-
A hosted instance can't see your local files (so `codeFile`/local-image blocks
|
|
165
|
-
won't resolve there — pass URLs or inline content); run it on your own machine if
|
|
166
|
-
you need local-file access.
|
|
167
|
-
|
|
168
|
-
Progressive rendering: if the host streams the tool call as you write it, the
|
|
169
|
-
board renders valid blocks/questions incrementally (a "Composing…" preview) and
|
|
170
|
-
finalizes when your call completes — so the user sees it build, not a blank wait.
|
|
171
|
-
|
|
172
|
-
Both take **the exact same board spec** documented below (the tool `inputSchema`
|
|
173
|
-
*is* this spec). Call the tool with your spec; the host shows the board, the user
|
|
174
|
-
fills it in, and their answers come back to you (answers, per-question notes,
|
|
175
|
-
comment) as a user-message turn, with structured context synced when the host
|
|
176
|
-
supports it — read them just as you would the CLI's result JSON. There is **no
|
|
177
|
-
`--detach`/`rly wait` dance, no stdout parsing, and no timeout** in this mode.
|
|
178
|
-
`relay_ask` stays live until the user submits and the host delivers the result;
|
|
179
|
-
`relay_show` is display-only by default and the agent continues immediately.
|
|
180
|
-
|
|
181
|
-
**Near-full parity with the browser board.** Local `codeFile` / `htmlFile` /
|
|
182
|
-
`diffFile` and local **image** files work inline too — the server inlines them
|
|
183
|
-
(images as data URIs) while normalizing your spec, so the sandboxed board needs
|
|
184
|
-
no file access. **Element-level annotations work inline** — the user can comment
|
|
185
|
-
on chart points, diagram nodes, table cells, images and text selections, returned
|
|
186
|
-
in `annotations` just like the CLI. The board also adopts the host's **theme,
|
|
187
|
-
fonts and colors** and uses the host's **full-screen** control. The only
|
|
188
|
-
inline-mode gaps vs. the browser board: **local video files** (use a
|
|
189
|
-
YouTube/Vimeo/`https` URL instead — those play) and commenting on elements
|
|
190
|
-
*inside* a custom-HTML mockup (every other annotation target works). Everything
|
|
191
|
-
else — questions plus markdown/code/diff/table/chart/mermaid/graphviz/plantuml/
|
|
192
|
-
image/palette/html — renders identically.
|
|
139
|
+
## Inline mode: relay as an MCP App (Claude and Codex apps)
|
|
140
|
+
|
|
141
|
+
Everything outside this section is the CLI surface: you run `rly` and read JSON from stdout. Relay is also an MCP App server (SEP-1865). A host that registers `rly mcp` (see `rly mcp config` and `rly mcp install --target claude|codex`) renders the board inline in the conversation instead of a browser tab.
|
|
142
|
+
|
|
143
|
+
Tools:
|
|
144
|
+
- `relay_board`: takes the spec this guide describes. A spec with `questions` collects answers; one without is display-only. The result is a short summary with the `boardId`, never the spec.
|
|
145
|
+
- `relay_result {boardId, wait_seconds}`: the answers, notes, comment, annotations and blockEdits, or the draft while the person is still filling the board in. `wait_seconds` blocks until they submit, up to 600. A timeout is not an answer: call it again.
|
|
146
|
+
- `relay_help {topic}` or `relay_help {schema}`: a part of this guide, or the exact fields of one block or question type.
|
|
147
|
+
- `relay_ask` and `relay_show`: the old names, kept as aliases for one more minor version. Use `relay_board`.
|
|
148
|
+
|
|
149
|
+
The flow: call `relay_board`, tell the person the board is on screen, and carry on or wait. When they submit, the host posts a one-line message naming the board. Read the answers with `relay_result`. Do not ask the same questions again in chat.
|
|
150
|
+
|
|
151
|
+
`rly mcp` speaks stdio to a local desktop host. `rly mcp --http [--port N] [--token-file PATH] [--allow-origin ORIGIN]` serves Streamable HTTP at `/mcp` for hosts that connect over a network. The bearer token comes from `--token-file`, `RLY_MCP_TOKEN` or `--token`; the flag shows in `ps`, so prefer the file or the variable. Boards are stored in the relay home of the machine that runs the server, so `codeFile` and local images resolve there and nowhere else. A host that draws A2UI can show the whole board natively instead of the iframe. It declares the board catalog, `https://github.com/khanglvm/relay/a2ui/catalog/board/v1`, under `extensions.a2ui["1.0"].supportedCatalogIds` when it connects, or per call in `_meta.a2ui`; the call wins over the connection. `relay_view` then returns the board as A2UI messages (`application/a2ui+json`, `application/json+a2ui` is accepted when declared) and the host sends button events to `a2ui_action` with the surface's data model. The catalog is `src/a2ui/board-catalog.json`; `toA2ui(spec)` and `fromA2ui(dataModel, spec)` from `@khanglvm/relay/a2ui-board` convert in both directions, and the result matches what the web board stores. Hosts that did not declare it keep the iframe.
|
|
152
|
+
|
|
153
|
+
To add the tools to a server you already run, call `registerRelay(server, {store, assetUrl, linkUrl})` from `@khanglvm/relay/mcp`.
|
|
154
|
+
|
|
155
|
+
If the host streams the tool call as you write it, the board renders valid blocks and questions as they arrive and finishes when your call completes.
|
|
156
|
+
|
|
157
|
+
Inline boards match the browser board. The server inlines `codeFile`, `htmlFile`, `diffFile` and local images (as data URIs) while it normalizes the spec, so the sandboxed board needs no file access. Element comments work on chart points, diagram nodes, table cells, images and text selections, and come back in `annotations`. The board adopts the host's theme, fonts, colors and full-screen control. Two gaps remain: local video files (use a YouTube, Vimeo or https URL) and comments on elements inside a custom HTML mockup.
|
|
193
158
|
|
|
194
159
|
## Creating boards
|
|
195
160
|
|
|
@@ -216,9 +181,8 @@ rly show --file spec.json --display-only
|
|
|
216
181
|
```
|
|
217
182
|
|
|
218
183
|
`--display-only` automatically detaches the browser board. In MCP App mode,
|
|
219
|
-
`
|
|
220
|
-
the user really needs to acknowledge or leave feedback.
|
|
221
|
-
response-bearing tool.
|
|
184
|
+
`relay_board` with no `questions` is display-only; set `responseRequired:true` only
|
|
185
|
+
when the user really needs to acknowledge or leave feedback.
|
|
222
186
|
|
|
223
187
|
Read a markdown file (no questions; library-free renderer; submit reads "Done"):
|
|
224
188
|
|
|
@@ -313,6 +277,7 @@ choices plus the full resolved file in `result.blockEdits[blockId]`:
|
|
|
313
277
|
| `rank` | `["b","a","c"]` — ordered option values, highest priority first |
|
|
314
278
|
| `checklist`| `{ "login":"pass", "checkout":"fail" }` — per-item status map |
|
|
315
279
|
| `allocate` | `{ "eng":50, "design":30, "ops":20 }` — budget distributed across options |
|
|
280
|
+
| `pick` | `{ "picks":[{"id":"a","note":"why"}], "overall":"…" }` — tiles in the order picked |
|
|
316
281
|
|
|
317
282
|
`rank` renders the `options` as a reorderable list (drag or ↑/↓ buttons); the
|
|
318
283
|
user prioritizes them and the answer is the ordered array of values. Needs ≥2
|
|
@@ -326,10 +291,18 @@ distributes a budget (`"total"`, default 100) across the options with sliders +
|
|
|
326
291
|
a live total bar; answer is `{optionValue: number}`. Both take per-option
|
|
327
292
|
`description`/`blocks` like single/multi.
|
|
328
293
|
|
|
294
|
+
`pick` shows media tiles to choose from. `items` are tiles: a string, or
|
|
295
|
+
`{id, title, caption?, image?, video?, url?}`, where `image` is a path or an
|
|
296
|
+
https URL, `video` plays as a muted preview when it is a file and opens as a
|
|
297
|
+
link otherwise, and `url` opens the page. `max` caps the picks (1 makes it a
|
|
298
|
+
single choice), `min` above 0 makes it required, and `itemNote:false` or
|
|
299
|
+
`overall:false` hide the per-tile and overall notes. Unknown ids are dropped
|
|
300
|
+
and the list is cut to `max`. Up to 60 tiles.
|
|
301
|
+
|
|
329
302
|
Aliases accepted: radio/choice/select→single, checkbox→multi,
|
|
330
303
|
boolean/bool/yn→yesno, input→text, longtext→textarea, rating/likert→scale,
|
|
331
304
|
colour/swatch→color, ranking/order/ordering/prioritize/sort→rank,
|
|
332
|
-
signoff/qa→checklist, budget/distribute/points→allocate.
|
|
305
|
+
signoff/qa→checklist, budget/distribute/points→allocate, tiles/gallery/shortlist→pick.
|
|
333
306
|
|
|
334
307
|
### Result JSON (stdout)
|
|
335
308
|
|
|
@@ -783,8 +756,8 @@ file write alone starts a new model turn.
|
|
|
783
756
|
|
|
784
757
|
| Client/surface | Recommended Relay return path |
|
|
785
758
|
|---|---|
|
|
786
|
-
| MCP App (`
|
|
787
|
-
| MCP App (`
|
|
759
|
+
| MCP App (`relay_board` with questions) | No CLI wait. The board stays live; on submit the host posts a one-line message and `relay_result` returns the answers. |
|
|
760
|
+
| MCP App (`relay_board`, display-only) | Present it and continue immediately; no acknowledgement is requested. |
|
|
788
761
|
| Claude Code | Run `rly wait <id> --timeout 0` as a [background Bash task](https://docs.anthropic.com/en/docs/claude-code/interactive-mode#background-bash-commands); retain its task id/output rather than opening a second board. |
|
|
789
762
|
| Gemini CLI | Run the waiter in the background and set [`tools.shell.backgroundCompletionBehavior` to `"inject"`](https://geminicli.com/docs/reference/configuration/) so completion is returned to the agent; `"notify"` only informs the chat UI. |
|
|
790
763
|
| Codex | Keep one foreground waiter. Codex background terminals use explicit `write_stdin` polling (the [poll window defaults to five minutes](https://developers.openai.com/codex/config-reference)); the process can outlive each poll, but no portable browser-submit API wakes a stopped turn. |
|
package/docs/SETUP.md
CHANGED
|
@@ -37,10 +37,11 @@ rly mcp install --target codex
|
|
|
37
37
|
|
|
38
38
|
The first command configures Claude Code; the others write Claude Desktop
|
|
39
39
|
and Codex config respectively. Use `rly mcp config` to print config snippets.
|
|
40
|
-
The server exposes `
|
|
40
|
+
The server exposes `relay_board` to show a board, `relay_result` to read the answers and `relay_help` for exact field shapes. `relay_ask` and `relay_show` remain as aliases of `relay_board` for one more minor version.
|
|
41
41
|
|
|
42
42
|
For remote clients, `rly mcp --http` serves Streamable HTTP. Run `rly help`
|
|
43
|
-
for host, port, token, and origin flags.
|
|
43
|
+
for host, port, token, and origin flags. Boards live in the relay home of the
|
|
44
|
+
machine that runs the server. The repo includes a `Dockerfile`.
|
|
44
45
|
See the [agent guide](AGENT.md) for board schemas, transport details,
|
|
45
46
|
and host requirements.
|
|
46
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanglvm/relay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.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, \u2026): ask users structured questions, present interactive visuals, collect inline comments, read answers as JSON \u2014 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",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"LICENSE"
|
|
46
46
|
],
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
48
|
+
"node": ">=20"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"check": "tsc -p tsconfig.json",
|
|
@@ -57,7 +57,9 @@
|
|
|
57
57
|
"prepack": "npm run build:types"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
+
"@a2ui/web_core": "^0.15.0",
|
|
60
61
|
"@biomejs/biome": "^2.6.8",
|
|
62
|
+
"@modelcontextprotocol/client": "^2.4.0",
|
|
61
63
|
"@types/node": "^20.19.43",
|
|
62
64
|
"typescript": "^7.0.2"
|
|
63
65
|
},
|
|
@@ -74,13 +76,23 @@
|
|
|
74
76
|
"types": "./types/a2ui/compile.d.ts",
|
|
75
77
|
"default": "./src/a2ui/compile.js"
|
|
76
78
|
},
|
|
79
|
+
"./a2ui-board": {
|
|
80
|
+
"types": "./types/a2ui/board.d.ts",
|
|
81
|
+
"default": "./src/a2ui/board.js"
|
|
82
|
+
},
|
|
77
83
|
"./mcp": {
|
|
78
|
-
"types": "./types/mcp.d.ts",
|
|
79
|
-
"default": "./src/mcp.js"
|
|
84
|
+
"types": "./types/mcp/index.d.ts",
|
|
85
|
+
"default": "./src/mcp/index.js"
|
|
80
86
|
},
|
|
81
87
|
"./schema.json": "./schema/spec.v1.json",
|
|
82
88
|
"./package.json": "./package.json"
|
|
83
89
|
},
|
|
84
90
|
"main": "./src/index.js",
|
|
85
|
-
"types": "./types/index.d.ts"
|
|
91
|
+
"types": "./types/index.d.ts",
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"@modelcontextprotocol/ext-apps": "^2.0.4",
|
|
94
|
+
"@modelcontextprotocol/node": "^2.1.2",
|
|
95
|
+
"@modelcontextprotocol/server": "^2.4.0",
|
|
96
|
+
"zod": "^4.6.7"
|
|
97
|
+
}
|
|
86
98
|
}
|
package/schema/spec.v1.json
CHANGED
|
@@ -454,7 +454,8 @@
|
|
|
454
454
|
"color",
|
|
455
455
|
"rank",
|
|
456
456
|
"checklist",
|
|
457
|
-
"allocate"
|
|
457
|
+
"allocate",
|
|
458
|
+
"pick"
|
|
458
459
|
],
|
|
459
460
|
"default": "text"
|
|
460
461
|
},
|
|
@@ -864,6 +865,57 @@
|
|
|
864
865
|
]
|
|
865
866
|
}
|
|
866
867
|
},
|
|
868
|
+
"items": {
|
|
869
|
+
"type": "array",
|
|
870
|
+
"description": "pick only: the tiles to choose among, 1 to 60. Strings, or {id, title, image?, video?, url?, caption?}. \"image\" is an https/data URL or a local file (embedded); \"video\" is an https YouTube/Vimeo link or media URL, shown as a link or a muted preview; \"url\" opens a page. The answer is {picks:[{id, note?}], overall?}: ids in the order picked, a note per tile, one overall note.",
|
|
871
|
+
"items": {
|
|
872
|
+
"anyOf": [
|
|
873
|
+
{
|
|
874
|
+
"type": "string"
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
"type": "object",
|
|
878
|
+
"required": [
|
|
879
|
+
"id"
|
|
880
|
+
],
|
|
881
|
+
"properties": {
|
|
882
|
+
"id": {
|
|
883
|
+
"type": "string",
|
|
884
|
+
"description": "Answer key for this tile (default: its title)."
|
|
885
|
+
},
|
|
886
|
+
"title": {
|
|
887
|
+
"type": "string"
|
|
888
|
+
},
|
|
889
|
+
"caption": {
|
|
890
|
+
"type": "string"
|
|
891
|
+
},
|
|
892
|
+
"image": {
|
|
893
|
+
"type": "string",
|
|
894
|
+
"description": "https/data URL, or a local image file (embedded)."
|
|
895
|
+
},
|
|
896
|
+
"video": {
|
|
897
|
+
"type": "string",
|
|
898
|
+
"description": "https YouTube/Vimeo link or media file URL."
|
|
899
|
+
},
|
|
900
|
+
"url": {
|
|
901
|
+
"type": "string",
|
|
902
|
+
"description": "https page the tile links to."
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
]
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
"itemNote": {
|
|
910
|
+
"type": "boolean",
|
|
911
|
+
"default": true,
|
|
912
|
+
"description": "pick only: a note field on each picked tile. Set false to hide it."
|
|
913
|
+
},
|
|
914
|
+
"overall": {
|
|
915
|
+
"type": "boolean",
|
|
916
|
+
"default": true,
|
|
917
|
+
"description": "pick only: one overall note under the tiles. Set false to hide it."
|
|
918
|
+
},
|
|
867
919
|
"other": {
|
|
868
920
|
"type": "boolean",
|
|
869
921
|
"description": "Add a free-text \"Other\" option (a multi-line textarea); its text is returned verbatim as the value. Defaults ON for \"single\" (radio) questions so the user is never boxed in — set other:false to remove it; \"multi\" stays opt-in (other:true)."
|
|
@@ -882,13 +934,13 @@
|
|
|
882
934
|
"min": {
|
|
883
935
|
"type": "integer",
|
|
884
936
|
"default": 1,
|
|
885
|
-
"description": "scale
|
|
937
|
+
"description": "scale: lowest value. pick: fewest tiles to pick (default 0; 1 or more makes the question required)."
|
|
886
938
|
},
|
|
887
939
|
"max": {
|
|
888
940
|
"type": "integer",
|
|
889
941
|
"default": 5,
|
|
890
942
|
"maximum": 10,
|
|
891
|
-
"description": "scale
|
|
943
|
+
"description": "scale: highest value, at most 10. pick: most tiles to pick (default: all of them; 1 makes it a single choice)."
|
|
892
944
|
},
|
|
893
945
|
"minLabel": {
|
|
894
946
|
"type": "string",
|
package/skills/relay/SKILL.md
CHANGED
|
@@ -7,13 +7,15 @@ description: "Show the user files, visuals, diffs, plans, charts or a set of rel
|
|
|
7
7
|
|
|
8
8
|
Put content in front of the person and read what they decide. Keep short answers and progress updates in chat. A board adds no approval step of its own; follow the authorization the user already gave.
|
|
9
9
|
|
|
10
|
+
If your host app has its own way to ask the user or show results (native question cards, forms, pickers), use that for those. Use Relay for what the host can't show: line comments on a diff, Mermaid or Graphviz diagrams, element comments on an HTML prototype, rich multi-block review boards.
|
|
11
|
+
|
|
10
12
|
## Workflow
|
|
11
13
|
1. Write a spec to a JSON file. Never pass big JSON in a shell argument.
|
|
12
14
|
2. `rly ask --file spec.json --detach` prints `{boardId,url}` at once. When no reply is needed: `rly show --file spec.json --display-only`.
|
|
13
15
|
3. Give the person the url. To get the result: `rly wait <boardId> --timeout 1800 --while-active --idle-grace 300` (blocks until submit) or `rly result <boardId>` (now). A timeout is not an answer: run `rly result` before you decide.
|
|
14
16
|
4. Read `answers`, `notes`, `comment`, `annotations` and `blockEdits` together; any of them can qualify an answer. When stdout is cut short, read the `resultFile` it names.
|
|
15
17
|
|
|
16
|
-
If Relay MCP tools are connected, `
|
|
18
|
+
If Relay MCP tools are connected, call `relay_board` with the same spec (questions make it collect answers, none make it display-only) and the board renders inline. Read the answers with `relay_result {boardId, wait_seconds}`; `relay_help` gives exact fields. Embed file content with `mdFile`, `codeFile` or an image block, because inline boards cannot open local file links.
|
|
17
19
|
|
|
18
20
|
## Spec in one screen
|
|
19
21
|
```json
|
|
@@ -31,7 +33,7 @@ If Relay MCP tools are connected, `relay_ask` (answers wanted) and `relay_show`
|
|
|
31
33
|
]
|
|
32
34
|
}
|
|
33
35
|
```
|
|
34
|
-
- Question types: single multi yesno text textarea scale color rank checklist allocate.
|
|
36
|
+
- Question types: single multi yesno text textarea scale color rank checklist allocate pick.
|
|
35
37
|
- Blocks: markdown(md|mdFile) code(codeFile) diff(diffFile) image compare chart table kpi mermaid graphviz html palette video pdf a2ui. Local files: pass absolute paths.
|
|
36
38
|
- Blocks go at the board root, on a question, or on an option (visual choices).
|
|
37
39
|
- Every id is stable and unique. `required:true` only for answers you cannot continue without.
|
|
@@ -50,6 +52,7 @@ If Relay MCP tools are connected, `relay_ask` (answers wanted) and `relay_show`
|
|
|
50
52
|
{"id":"signoff","type":"checklist","label":"Sign off each area","options":["login","billing"]} // pass/fail/N-A per item: one checklist, not many yes/no
|
|
51
53
|
{"id":"rank","type":"rank","label":"Priorities","options":["speed","a11y"]} {"id":"split","type":"allocate","label":"Budget","total":100,"options":["type","space"]}
|
|
52
54
|
{"id":"c","type":"single","label":"Scheme?","options":[{"value":"warm","label":"Warm","blocks":[{"type":"html","html":"<div style='height:100%;background:#c2674b'></div>","height":140}]}]} // a visual per option
|
|
55
|
+
{"id":"hero","type":"pick","label":"Shortlist two","max":2,"items":[{"id":"a","title":"Warm","image":"/abs/a.png","caption":"Terracotta"},{"id":"b","title":"Demo","video":"https://example.com/b.mp4"},{"id":"c","title":"Ref","url":"https://example.com/c"}]} // media tiles; answer {picks:[{id,note?}],overall?}; max 1 = single, min/max bound a multi
|
|
53
56
|
{"id":"s","type":"scale","label":"Rate","min":1,"max":5} {"id":"col","type":"color","label":"Brand color"} {"id":"ship","type":"yesno","label":"Ship?"}
|
|
54
57
|
```
|
|
55
58
|
Buttons inside a2ui do not replace a question. Their clicks return in `blockEdits`.
|