easel-canvas 0.5.0 → 0.6.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 +27 -1
- package/bin/server.mjs +3 -2
- package/dist/assets/index-DE0ohrot.js +75 -0
- package/dist/assets/{index-0pl9ILre.css → index-yigh_b3W.css} +1 -1
- package/dist/favicon.svg +1 -0
- package/dist/index.html +3 -2
- package/package.json +3 -2
- package/server/args.mjs +4 -2
- package/server/export.mjs +10 -3
- package/server/index.mjs +20 -1
- package/server/live/dispatch.mjs +168 -0
- package/server/live/inventory.mjs +101 -0
- package/server/live/live.mjs +366 -0
- package/server/live/proto.mjs +101 -0
- package/server/live/routes.mjs +49 -0
- package/server/routes.mjs +16 -3
- package/dist/assets/index-BRuM-YIO.js +0 -75
- package/dist/viewer/viewer.css +0 -1
- package/dist/viewer/viewer.js +0 -56
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h1><picture><source media="(prefers-color-scheme: dark)" srcset="brand/wordmark-dark.svg"><img src="brand/wordmark.svg" alt="Easel" width="152" height="47"></picture></h1>
|
|
4
4
|
|
|
5
5
|
**A design canvas where your coding agents and you work on the same real HTML.**
|
|
6
6
|
|
|
@@ -195,6 +195,32 @@ To show the copy inside another page, frame its `index.html` with `?embed`: the
|
|
|
195
195
|
|
|
196
196
|
Exporting again replaces what the previous export of the same kind wrote there (a small `.easel-export.json` lists it) and leaves anything else in the folder alone; a non-empty folder Easel did not create is never cleared. Dot folders (`.easel/`, `.thumbs/`…) and files outside the design folder are never copied. A single file inlines the screens' images, fonts, CSS and scripts but not HTML embedded with `<iframe>`; the export lists what it skipped.
|
|
197
197
|
|
|
198
|
+
## Live share
|
|
199
|
+
|
|
200
|
+
**Share › Live share › Start** gives you a link that lets other people watch your canvas with you while Easel is open: they see your boards as they change, everyone's cursor and name, and the comments. Pick what the link opens as: **View**, or **Comment** (guests can add comments and replies, marked *Guest* on your canvas). Editing is not part of this version. The share pill in the top-right card shows who is there; **Stop** ends it for everyone, **New link** replaces the link for that role and closes the guests who came by the old one, and closing Easel ends it too. Links do not survive a restart, and there are no accounts.
|
|
201
|
+
|
|
202
|
+
How it is kept safe, in plain words:
|
|
203
|
+
|
|
204
|
+
- **Your computer stays the source.** Easel opens one outgoing connection to a relay; nothing on your machine starts listening to the internet. Guests' requests are answered inside Easel by a short allow-list written for guests (the board list, comments without your AI requests, and the files your boards load). Anything else — AI runs, edits, history, settings, your file paths — is refused before any of Easel's own routes run. A test fails if a new route is added without deciding whether guests may have it.
|
|
205
|
+
- **The relay cannot read anything.** The key is in the link's `#` part, which browsers never send to a server. Every message is encrypted end to end (AES-GCM, a key per link role), so the relay only passes along bytes it cannot open. Whoever has the link has the key: share it like you would share the screen.
|
|
206
|
+
- **Guests cannot pretend.** The role comes from which link's key opens a guest's messages; the name on a comment is the one the guest typed (shown as *Guest*), and a guest comment is never a request for your AI agent.
|
|
207
|
+
- **Boards run apart from the key.** The link page that holds the key shows the canvas in a frame on a second site (the board host), so a board's own scripts cannot reach the key or the connection. Boards are your own files and are treated as such.
|
|
208
|
+
- **Ending clears; dropping keeps, for a while.** **Stop** or **New link** clears what those guests were looking at. A guest who was away at that moment (asleep, offline) is told it ended when they come back: the relay remembers that a room was ended, by its id and the time only, for 24 hours. A dropped connection (your laptop sleeps, Easel quits without Stop, the network or the relay goes) leaves guests the last state they saw, read-only and marked *Disconnected*; after 10 minutes without you the guest page clears it too and says so, while it keeps trying to reconnect and picks up again when you are back. What a guest received stays only in that browser tab: Easel's guest page writes nothing to disk (no Cache Storage, no IndexedDB, answers marked `no-store`).
|
|
209
|
+
- **The name guests see** is your comment author name (your git name until you change it). **Share › Live share** shows it and changes it in place; it is saved in this browser, not in the design folder.
|
|
210
|
+
- **Limits.** Up to 20 guests per room, a request rate and queue per guest (more get "slow down"), 1 MB per message, 32 MB per file, and a guest whose connection cannot keep up is dropped rather than buffered.
|
|
211
|
+
|
|
212
|
+
Easel connects to `wss://easel.d-t-it.com/live/ws` unless you pass `--relay <url>` (or set `EASEL_RELAY`). If the relay cannot be reached, the popover says live share is not available and nothing else changes. The relay is open source in [`relay/`](relay/): a small Node server (`node relay/node.mjs`) and a Cloudflare Worker with a Durable Object (`relay/worker.mjs`) speaking the same protocol, so you can run your own; [docs/live-share-deploy.md](docs/live-share-deploy.md) has the steps.
|
|
213
|
+
|
|
214
|
+
Try it on one machine (two origins on loopback ports, the Node relay in between):
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npm run build # also builds dist/live (the link page and the board host)
|
|
218
|
+
node relay/node.mjs # relay :4480, link page :4481, board host :4482
|
|
219
|
+
npx easel-canvas --relay ws://127.0.0.1:4480/live/ws # or: node bin/server.mjs --relay ws://127.0.0.1:4480/live/ws
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Then **Share › Live share › Start**, copy the link and open it in another browser profile.
|
|
223
|
+
|
|
198
224
|
## Pin it in your project
|
|
199
225
|
|
|
200
226
|
`npx easel-canvas@latest` is all most projects need. To pin an exact version for your team, add it as a dev dependency (`npm i -D easel-canvas`, then `"design": "easel-canvas"` in your scripts) or as a git submodule. With your designs in `<project>/docs/design/screens/`:
|
package/bin/server.mjs
CHANGED
|
@@ -31,6 +31,7 @@ Usage
|
|
|
31
31
|
Options
|
|
32
32
|
--port <n> port to listen on (default 4317; when it is busy and --port is not given, the next free one)
|
|
33
33
|
--open open the canvas in your browser (--demo and --init do this; --no-open to skip)
|
|
34
|
+
--relay <url> live-share relay (default wss://easel.d-t-it.com/live/ws, or EASEL_RELAY; see README "Live share")
|
|
34
35
|
-h, --help show this help
|
|
35
36
|
-v, --version
|
|
36
37
|
|
|
@@ -145,7 +146,7 @@ let app;
|
|
|
145
146
|
let child = null; // after a hand-over: the new server, which this process only waits on
|
|
146
147
|
const start = async (port, autoPort) => {
|
|
147
148
|
const a = await createServer({ dir, port, dev: !args.prod, extraRoutes, autoPort, register: true, updateCheck: true });
|
|
148
|
-
await attach(a);
|
|
149
|
+
await attach(a, { relay: args.relay });
|
|
149
150
|
a.ctx.handover = handover;
|
|
150
151
|
return a;
|
|
151
152
|
};
|
|
@@ -157,7 +158,7 @@ const start = async (port, autoPort) => {
|
|
|
157
158
|
async function handover(root) {
|
|
158
159
|
const port = app.port;
|
|
159
160
|
await app.close();
|
|
160
|
-
const next = spawn(process.execPath, [path.join(root, "bin", "server.mjs"), "--dir", dir, "--port", String(port), "--no-open", ...(args.prod ? ["--prod"] : [])], { stdio: "inherit", env: process.env, windowsHide: true });
|
|
161
|
+
const next = spawn(process.execPath, [path.join(root, "bin", "server.mjs"), "--dir", dir, "--port", String(port), "--no-open", ...(args.prod ? ["--prod"] : []), ...(args.relay ? ["--relay", args.relay] : [])], { stdio: "inherit", env: process.env, windowsHide: true });
|
|
161
162
|
let dead = false;
|
|
162
163
|
next.on("exit", () => (dead = true));
|
|
163
164
|
next.on("error", () => (dead = true));
|