easel-canvas 0.2.0 → 0.2.2

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.
Files changed (42) hide show
  1. package/README.md +51 -26
  2. package/bin/mcp.mjs +10 -7
  3. package/dist/assets/{index-BZFSkKqU.css → index-CjyXUlEx.css} +1 -1
  4. package/dist/assets/index-DFCSLJXY.js +66 -0
  5. package/dist/index.html +2 -2
  6. package/dist/viewer/viewer.css +1 -1
  7. package/dist/viewer/viewer.js +13 -12
  8. package/examples/demo/CLAUDE.md +8 -0
  9. package/examples/demo/assets/fonts/OFL-Anton.txt +93 -0
  10. package/examples/demo/assets/fonts/OFL-JetBrainsMono.txt +93 -0
  11. package/examples/demo/assets/fonts/anton-latin-400.woff2 +0 -0
  12. package/examples/demo/assets/fonts/jetbrains-mono-latin-400.woff2 +0 -0
  13. package/examples/demo/assets/ticket-qr.svg +5 -0
  14. package/examples/demo/board.json +47 -20
  15. package/examples/demo/comments.json +27 -7
  16. package/examples/demo/screens/brand.html +155 -0
  17. package/examples/demo/screens/clash.html +94 -0
  18. package/examples/demo/screens/empty-day.html +114 -0
  19. package/examples/demo/screens/film.html +98 -0
  20. package/examples/demo/screens/home-daylight.html +144 -0
  21. package/examples/demo/screens/home.html +132 -38
  22. package/examples/demo/screens/poster.html +77 -0
  23. package/examples/demo/screens/programme.html +125 -0
  24. package/examples/demo/screens/site.html +118 -0
  25. package/examples/demo/screens/square.html +71 -0
  26. package/examples/demo/screens/ticket.html +107 -0
  27. package/examples/demo/screens/timetable.html +192 -0
  28. package/examples/demo/tokens.json +54 -22
  29. package/package.json +3 -2
  30. package/server/args.mjs +3 -2
  31. package/server/boards.mjs +22 -2
  32. package/server/chat.mjs +26 -16
  33. package/server/forks.mjs +16 -3
  34. package/server/html.mjs +1 -1
  35. package/server/place.mjs +33 -5
  36. package/dist/assets/index-BwyrrnkP.js +0 -65
  37. package/examples/demo/screens/empty.html +0 -43
  38. package/examples/demo/screens/habit.html +0 -55
  39. package/examples/demo/screens/landing.html +0 -44
  40. package/examples/demo/screens/new-habit.html +0 -47
  41. package/examples/demo/screens/settings.html +0 -43
  42. package/examples/demo/screens/stats.html +0 -50
package/README.md CHANGED
@@ -2,29 +2,31 @@
2
2
 
3
3
  # Easel
4
4
 
5
- **An infinite canvas for HTML screens. Your AI agent writes the designs; you see and tweak them live.**
5
+ **A design canvas where your coding agents and you work on the same real HTML.**
6
+
7
+ No export, no hand-off, no design file: screens are HTML files in your repo, and Claude Code, Codex, Cursor and Gemini edit them on the same canvas you do.
6
8
 
7
9
  [![npm](https://img.shields.io/npm/v/easel-canvas.svg?color=black)](https://www.npmjs.com/package/easel-canvas)
8
10
  [![License: MIT](https://img.shields.io/badge/license-MIT-black.svg)](LICENSE)
9
11
  [![Node](https://img.shields.io/badge/node-%E2%89%A520-black.svg)](package.json)
10
12
  [![MCP](https://img.shields.io/badge/MCP-22%20tools-3E7BFA.svg)](#connect-your-ai-agent)
11
- [![Works with](https://img.shields.io/badge/works%20with-Claude%20Code%20·%20Codex-3E7BFA.svg)](#connect-your-ai-agent)
13
+ [![Works with](https://img.shields.io/badge/works%20with-Claude%20Code%20·%20Codex%20·%20Cursor%20·%20Gemini-3E7BFA.svg)](#connect-your-ai-agent)
12
14
 
13
- <img src="docs/screenshots/demo.gif" alt="Demo: editing text in place on a mobile screen, then asking Claude Code in the AI tab to rename a heading and recolor a bar; the board redraws with the change" width="100%">
15
+ <img src="docs/screenshots/demo.gif" alt="Demo: the Intercut No.14 film festival identity on one canvas, then a zoom to its phone app; retyping the spliced title on My cut in place and taking it back, changing the ticket bar's fill to a token, asking Claude Code in the AI tab to turn the home screen into the ticket while the board redraws red with the QR code and the chat lists its tool calls, check_tokens among them; undoing and redoing that whole run, then exporting a view-only copy from Share" width="100%">
14
16
 
15
- <sub>A real Claude Code run on the bundled demo (the agent's thinking time is sped up 4×).</sub>
17
+ <sub>A real Claude Code run on the bundled demo. The agent's working time is sped up 16× (about 93 seconds shown in 6); everything else plays at real speed.</sub>
16
18
 
17
19
  </div>
18
20
 
19
- Easel turns a folder of plain HTML files into a design canvas. Claude Code or Codex writes a screen, and it shows up on the canvas a moment later. Drag, resize, retype or restyle anything on the canvas, and **only that part of the source file changes**. There is no export step and no proprietary file format: your designs stay in your repo as HTML and merge with git like any other code.
21
+ Easel turns a folder of plain HTML files into a design canvas. Your agent writes a screen and it shows up on the canvas a moment later. Drag, resize, retype or restyle anything on the canvas, and **only that part of the source file changes**. Your designs stay in your repo as HTML and merge with git like any other code.
20
22
 
21
23
  ## Try it in 30 seconds
22
24
 
23
25
  ```bash
24
- npx easel-canvas --demo
26
+ npx easel-canvas@latest --demo
25
27
  ```
26
28
 
27
- That copies the "Tidy" habit tracker demo to `./easel-demo` and opens it at http://localhost:4317. Open the **AI** tab (⌘J) and ask Claude Code or Codex for a change, or click anything on a screen and start editing.
29
+ That copies the demo to `./easel-demo` and opens it at http://localhost:4317: Intercut No.14, a film festival identity with a phone app, a desktop timetable and campaign pieces, 12 boards set in bundled open-licence fonts. Click anything on a screen and start editing, or open the **AI** tab (⌘J) and ask your agent for a change. (`@latest` makes npx fetch the newest version instead of reusing a copy it cached; see [Updates](#updates).)
28
30
 
29
31
  Already have HTML screens? Run it in your project:
30
32
 
@@ -36,28 +38,41 @@ npx easel-canvas --dir ./designs # any folder of screens/*.html
36
38
 
37
39
  ## Why Easel
38
40
 
39
- - **HTML is the source of truth.** Each `screens/*.html` file is one board. What you see is exactly what ships to the browser, and there's nothing to export or keep in sync.
40
- - **Built for AI agents.** An MCP server with 22 tools lets agents see the boards, read what you selected, leave comments, check tokens and arrange the canvas. An in-app chat runs `claude -p`, `codex exec`, `cursor-agent -p`, `gemini -p` or your own command with your selection as context; Claude Code's permission requests come up as cards you answer in the chat.
41
- - **Surgical edits.** Changes are patched into the exact source range (parse5 locations), so formatting, comments and the rest of the file stay untouched. If an agent edits the same element first, your edit is rejected instead of overwriting it.
42
- - **Git-friendly by design.** Layout, notes and comments live in small JSON files written one entry per line, so two branches moving different boards merge without conflicts.
43
- - **Local-first.** It runs on `127.0.0.1` and works directly on the files in your repo. No account, no cloud, no lock-in.
41
+ - **HTML is the source of truth.** Each `screens/*.html` file is one board. What you see is what ships to the browser, with nothing to export or keep in sync.
42
+ - **Built for AI agents.** An MCP server with 22 tools lets agents see the boards, read your selection, comment, check tokens and arrange the canvas. The in-app chat runs Claude Code, Codex, Cursor Agent, Gemini CLI or your own command with your selection as context. A Claude Code run started there carries Easel's tools for that canvas without `connect`, and its permission requests come up as cards you answer there.
43
+ - **Several agents and people, no overwrites.** One writer per board: a second agent gets a fork beside it, not your file. Every change is tagged with who made it, and an agent's whole run undoes in one step.
44
+ - **Surgical edits.** Changes are patched into the exact source range (parse5 locations), so formatting, comments and the rest of the file stay as they were. If an agent changed the same element first, your edit is refused instead of overwriting it.
45
+ - **A copy anyone can open.** Share exports a view-only canvas you can host anywhere, or one `.html` file to attach to a message or a PR.
46
+ - **Git-friendly.** Layout, notes and comments live in small JSON files, one entry per line, so branches that move different boards merge without conflicts.
47
+ - **Local-first.** It runs on `127.0.0.1` against the files in your repo. No account, no cloud, no lock-in.
44
48
 
45
49
  ## Features
46
50
 
47
51
  <table>
48
52
  <tr>
49
- <td colspan="2"><img src="docs/screenshots/overview.png" alt="Easel showing a habit tracker app: five mobile screens on an infinite canvas with notes and flow arrows, the board list card at the left and the inspector card at the right with token and accessibility checks"></td>
53
+ <td colspan="2"><img src="docs/screenshots/overview.png" alt="Easel showing the Intercut No.14 film festival identity: the brand sheet and the site's first screen, the phone app's seven screens joined by flow arrows, the desktop timetable and sticky notes on one canvas, the board list card at the left and the inspector card at the right with the Brand sheet's position, options, token check and accessibility check"></td>
54
+ </tr>
55
+ <tr>
56
+ <td colspan="2"><b>See every screen at once.</b> Each HTML file in <code>screens/</code> is a board on one canvas, next to notes and arrows, with token and accessibility checks for the one you pick.</td>
50
57
  </tr>
51
58
  <tr>
52
- <td width="50%"><img src="docs/screenshots/select.png" alt="A card selected inside a mobile screen, its element toolbar (Text, Fill, Radius, Spacing, Ask AI, Comment) in the line above the dock, and the inspector with the breadcrumb, Fill, Text, Corner radius, Padding and Gap"></td>
53
- <td width="50%"><img src="docs/screenshots/ai-chat.png" alt="AI chat in the inspector card: a reply from Claude Code with Read and Edit tool lines, Undo this run and Compare, and the edited Today screen on the canvas"></td>
59
+ <td width="50%"><img src="docs/screenshots/select.png" alt="The Show ticket bar selected inside the My cut phone screen, its element toolbar (Text, Fill, Radius, Spacing, Ask AI, Comment) in the line above the dock, and the inspector with the breadcrumb, Fill set to the Safelight token with its contrast, Text, Corner radius, Padding and Gap"></td>
60
+ <td width="50%"><img src="docs/screenshots/ai-chat.png" alt="AI chat in the inspector card after a real Claude Code run: its reply about turning My cut into the ticket with a larger scannable QR code, Changed 1 board with Undo this run and Compare, and the My cut screen redrawn red with the QR code next to the Film and Ticket screens, under a Claude Code activity tag"></td>
54
61
  </tr>
55
62
  <tr>
56
- <td><b>Edit in place.</b> Select any element, drag it, resize it, align it, retype its text or change its styles. Layers, wrap in flex/grid, cross-board copy and paste.</td>
57
- <td><b>Chat with your agent.</b> Pick Claude Code or Codex, send the selection, boards and comments as context, watch the edit stream in, ask for N variants side by side.</td>
63
+ <td><b>Edit the real screen.</b> Click any element to drag, resize, align, retype or restyle it; only that part of the HTML changes. Layers, wrap in flex or grid, copy and paste across boards.</td>
64
+ <td><b>Ask your agent.</b> Claude Code, Codex, Cursor Agent or Gemini CLI get your selection, boards and comments as context. Watch the board redraw, ask for variants side by side, and undo the whole run in one step.</td>
58
65
  </tr>
59
66
  <tr>
60
- <td width="50%"><img src="docs/screenshots/dark-mode.png" alt="Dark mode with a board context menu: Select inside, Ask AI for a review, Focus view, Ask AI, Go to board, Rename, Rename file, Duplicate, Bring to front, Send to back, Delete"></td>
67
+ <td width="50%"><img src="docs/screenshots/agents.png" alt="Two agents on one canvas: the Social square held by Claude Code (Claude Code is editing…) and Codex working on a fork beside it, Social square · Codex (Codex is editing…), with a dashed arrow back, the note Forked — Codex started while Claude Code was editing, and Use this one on both"></td>
68
+ <td width="50%"><img src="docs/screenshots/share.png" alt="The Share popover under the inspector header with Selected boards (2): Web folder exported to intercut/easel-export/ with Reveal and Copy deploy command, One .html file, PDF and PNG, and the matching npx easel-canvas export --boards home.html,ticket.html command"></td>
69
+ </tr>
70
+ <tr>
71
+ <td><b>Work alongside several agents.</b> One writer per board: a second agent works on a fork beside it, every change is tagged with who made it, and Use this one keeps the version you want.</td>
72
+ <td><b>Share a view-only copy.</b> Export the canvas, a page or the selected boards as a static site to host anywhere, or as one <code>.html</code> file to attach; PDF and PNG too.</td>
73
+ </tr>
74
+ <tr>
75
+ <td width="50%"><img src="docs/screenshots/dark-mode.png" alt="Dark mode on the film festival's phone screens with the Ticket board's context menu: Select inside, Ask AI for a review, Focus view, Ask AI, Go to board, Rename, Rename file, Duplicate, Bring to front, Send to back, Delete"></td>
61
76
  <td width="50%">
62
77
  <b>Everything a canvas should do.</b>
63
78
  <ul>
@@ -82,6 +97,8 @@ Then, in your project folder:
82
97
  npx easel-canvas connect
83
98
  ```
84
99
 
100
+ The in-app chat does not need this for Claude Code: each run it starts gets its own copy of these tools, bound to that canvas and that run, and a project's `easel` server is set aside for the run so the agent sees one set. Codex, Cursor Agent and Gemini CLI runs from the chat use the tools only once the project is connected.
101
+
85
102
  It adds the Easel MCP server to your agents' configs and leaves everything else in those files as it was: `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor) and `.gemini/settings.json` (Gemini CLI) in the project, and `[mcp_servers.easel]` in `~/.codex/config.toml` (Codex). Cursor, Gemini CLI and Codex are written only when they are found on your machine; pick agents with `--agents claude,cursor,gemini,codex`, or preview with `--dry-run`. Restart your agent afterwards.
86
103
 
87
104
  There is no port to set: the MCP server finds the canvas running for the folder your agent works in (each canvas registers itself in `~/.easel/servers/`), and a busy port 4317 simply moves the canvas to the next free one. With several canvases open outside any of their projects, pass `--port <n>` to `easel-mcp` to pick one.
@@ -113,8 +130,8 @@ Using Easel as a submodule (below)? Point `args` at `tools/easel/bin/mcp.mjs` wi
113
130
  Then try:
114
131
 
115
132
  > "Fix what I selected on the canvas: make the button text shorter."
116
- > "Make three variants of the Stats screen."
117
- > "Create an onboarding screen at 390×844 and put it next to Today."
133
+ > "Make three variants of the sign-up screen."
134
+ > "Create an onboarding screen at 390×844 and put it next to Home."
118
135
 
119
136
  New files with `<meta name="board-size" content="390x844">` are placed on the canvas automatically at that size.
120
137
 
@@ -128,7 +145,7 @@ The same from the terminal, with no canvas running (it works in CI):
128
145
  npx easel-canvas export # web folder in ./easel-export
129
146
  npx easel-canvas export --single-file # one self-contained .html
130
147
  npx easel-canvas export --page Onboarding --pdf --png
131
- npx easel-canvas export --boards home.html,stats.html --out dist/design-preview
148
+ npx easel-canvas export --boards home.html,ticket.html --out dist/design-preview
132
149
  ```
133
150
 
134
151
  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.
@@ -173,8 +190,8 @@ npm run design # http://localhost:4317
173
190
  | Find | Left "Boards" tab: ⌘K search and list; pages (drag to reorder; right-click to rename, delete, or set the launch page) |
174
191
  | Boards | Draw with the board tool (B), use a "New board" template (Blank · Mobile screen · Desktop screen · Document), or drop an HTML file on the canvas. Duplicate ⌘D, rename F2 (renaming the file offers to update references), Delete (confirm, trash, undo), Bring to front / Send to back ⌘] ⌘[ |
175
192
  | Multiple items | Drag on empty space to marquee-select or use Shift; move together (snap guides, Alt to disable); arrow keys 1, Shift 10, Option 100 |
176
- | Board options | Right "Properties": position, size, Radius, No frame, Interactive (Play), Stretch to window, Open as launch screen, Layout guides (Columns · Rows · Grid, up to 6, ⌃G), Adjustable values |
177
- | View | Focus view (F, ←→), Play in place (P or ▶, Esc), Play full screen (right-click) |
193
+ | Board options | Right "Properties": position, size, Radius, No frame, Show Play button (a dot and an always-visible ▶ on the label; not needed to play), Stretch to window, Open as launch screen, Layout guides (Columns · Rows · Grid, up to 6, ⌃G), Adjustable values |
194
+ | View | Focus view (F, ←→), Play in place on any board (P with one board selected, or right-click; ▶ on boards with Show Play button; Esc stops), Play full screen (right-click). Playing never writes to `board.json`. With no board or several selected, P is the pen |
178
195
  | Notes and shapes | Title (T), sticky note (N, 8 colors, size, bold, italic), Rectangle (R), Oval (O), Line (L), Arrow (A), Pen (P when no board is selected), image (Assets or paste) |
179
196
  | Select elements | No mode to enter: click anything on a board (drag the board to move it). Shift-click or Shift-drag for several, Esc lets go (then of the board), ↑ parent, ↓ or Enter first child, ←→ siblings, Option+↑↓ to reorder, ⌘A for all siblings, ⌘G Wrap in flex, Tab into the element toolbar |
180
197
  | Direct editing | The element toolbar, in the line above the dock: Text (size, weight), Fill (your tokens first, written as a CSS variable, then Custom), Radius, Spacing (padding, gap), Ask AI, Comment. Double-click text to edit it (Shift+Enter for a line break). Move with handles (Alt drops inside a box) and resize, 6 align options, Properties panel in design words with the breadcrumb (CSS names on hover, everything else under More (CSS), ⚠, contrast), Replace image, ⌘C/⌘V to paste into another board |
@@ -189,7 +206,7 @@ npm run design # http://localhost:4317
189
206
  | AI permissions | When Claude Code wants to run a command or edit outside what it may, the chat shows the exact request: Allow once, Always allow (that tool, or a command's first two words, until Easel restarts; never for file edits, for commands with `;` `&&` `\|` `>` and the like, or for `sh -c`-style wrappers), or Deny |
190
207
  | Undo an AI run | Each run that changed files ends with the boards it changed and added: Undo this run (one step, ⌘Z brings it back; asks first if you changed one of them since), Redo, Compare before and after. After a restart: Restore the copy from before this run (the newest 10 are kept) |
191
208
  | Custom agent | Agent menu › Custom command…: a name and a command with `{prompt}`, e.g. `aider --message {prompt} --yes`. Saved in `~/.easel/agents.json` (not in the project), run without a shell, output shown as plain text |
192
- | Screen | F6 to move between regions, Tab to move between boards, ⌘\\ to fold the left card, Appearance (System · Light · Dark) |
209
+ | Screen | F6 to move between regions, Tab to move between boards, ⌘\\ to fold both cards away and back, Appearance (System · Light · Dark) |
193
210
 
194
211
  </details>
195
212
 
@@ -208,6 +225,10 @@ your-project/docs/design/
208
225
  - The canvas is a Vite + React app. Each board is an iframe of the real HTML, so scripts, links and CSS behave exactly as in a browser.
209
226
  - The server listens on 127.0.0.1 only and refuses changes (and the live connection) from other web pages open in your browser: only requests with no `Origin` (the CLI, the MCP server) or from the canvas page itself, on a local host name, get through. Boards are your project's own HTML and run inside the canvas page, with the same access to it as you have, so open only design folders you trust.
210
227
 
228
+ ## Easel and Claude Design
229
+
230
+ Claude Design makes designs inside Claude, as artifacts. Easel keeps them as HTML files in your repo, edited by whichever agent you use, and exports a static copy when you want to show them. A feature-by-feature comparison is in [PARITY.md](PARITY.md) (last checked on 2026-10-09, before 0.2.0).
231
+
211
232
  ## Development
212
233
 
213
234
  ```bash
@@ -215,10 +236,11 @@ npm test # unit tests (source patching, board format, chat parsing,
215
236
  npm run test:e2e # Playwright end-to-end tests against test/fixtures/design
216
237
  npm run typecheck
217
238
  npm run demo # run the repo's demo from source
239
+ npm run design:css # rebuild docs/design/assets/easel.css after changing app/src/style.css, so the boards in docs/design keep matching the app
218
240
  ```
219
241
 
220
242
  - `test/fixtures/design/` intentionally keeps Korean screen content and board titles: it mimics real user content and is needed to test Korean text input (IME) and rendering. Set `DESIGN_CANVAS_E2E_DIR=<folder>` to run the e2e tests against another design folder.
221
- - `examples/demo/` is the "Tidy" demo used for the screenshots above.
243
+ - `examples/demo/` is Intercut No.14, the project `--demo` copies and the one in the demo video and the screenshots above. Its two fonts are bundled under the SIL Open Font License (see [License](#license)).
222
244
 
223
245
  | Folder | Contents |
224
246
  | --- | --- |
@@ -226,11 +248,14 @@ npm run demo # run the repo's demo from source
226
248
  | `server/` | API and routes, board.json, file watching, element paths and hashes, source patching, history, chat runner, tokens |
227
249
  | `app/` | Canvas UI (Vite + React + TypeScript); all UI text lives in `app/src/strings.ts` |
228
250
  | `test/` | `node --test` unit tests and Playwright e2e tests |
251
+ | `tools/` | Repo maintenance scripts, not shipped: `mkcss.mjs` builds the design boards' stylesheet from the app's |
229
252
 
230
- Background reading: the original plan is in [PLAN.md](PLAN.md), a feature-by-feature comparison with Claude Design is in [PARITY.md](PARITY.md), and the work log is in [tasks.md](tasks.md).
253
+ Background reading: the original plan is in [PLAN.md](PLAN.md) and the work log is in [tasks.md](tasks.md).
231
254
 
232
255
  Contributions are welcome: open an issue or a pull request.
233
256
 
234
257
  ## License
235
258
 
236
259
  [MIT](LICENSE) © Hyun Park
260
+
261
+ The demo bundles two fonts in `examples/demo/assets/fonts/`, each under the [SIL Open Font License 1.1](https://openfontlicense.org) with its licence text beside it: [Anton](https://github.com/googlefonts/AntonFont) (`OFL-Anton.txt`) and [JetBrains Mono](https://github.com/JetBrains/JetBrainsMono) (`OFL-JetBrainsMono.txt`), both taken from the Fontsource 5.3.0 packages.
package/bin/mcp.mjs CHANGED
@@ -2,7 +2,8 @@
2
2
  // AI-generated with Claude Code, 2026-10-09, reviewed by Hyun Park
3
3
  // MCP server (stdio): exposes boards, selection, screenshots, comments and placement through the app server API (http://localhost:<port>). PLAN.md ch. 6.
4
4
  // The agent creates and edits HTML by writing files directly. This server only observes, points at things, and places boards.
5
- // With --permission it exposes a single tool instead: the permission prompt of an in-app chat run, answered in the Easel chat.
5
+ // With --chat (an in-app Claude Code run) it also carries the run's permission prompt, answered in the Easel chat, under the name easel-chat;
6
+ // --permission (older) carries only that permission tool.
6
7
  // No port needed: the canvas for the folder the agent runs in is found through the registry (server/registry.mjs) on each call.
7
8
  import { readFileSync } from "node:fs";
8
9
  import fs from "node:fs/promises";
@@ -69,12 +70,14 @@ async function call(method, path, body) {
69
70
  const callJson = async (m, p, b) => JSON.parse(await call(m, p, b));
70
71
  const ok = (data) => ({ content: [{ type: "text", text: typeof data === "string" ? data : JSON.stringify(data, null, 2) }] });
71
72
 
72
- // --permission: started by an in-app Claude Code run (inline --mcp-config) for its permission prompts only, under its own name
73
- const server = new McpServer({ name: args.permission ? "easel-chat" : "easel", version: pkg.version });
74
- /** The canvas tools; none of them in --permission mode (the project's own easel server already has them) */
75
- const tool = args.permission ? () => {} : (...a) => server.registerTool(...a);
73
+ // --chat: started by an in-app Claude Code run (inline --mcp-config), bound to its canvas and run: the canvas tools and the permission tool,
74
+ // under a name of its own (the run denies any other easel server, so the model sees one set). --permission: the permission tool only
75
+ const permissionOnly = args.permission && !args.chat;
76
+ const server = new McpServer({ name: args.chat || args.permission ? "easel-chat" : "easel", version: pkg.version });
77
+ /** The canvas tools; none of them in --permission mode */
78
+ const tool = permissionOnly ? () => {} : (...a) => server.registerTool(...a);
76
79
 
77
- if (args.permission)
80
+ if (args.chat || args.permission)
78
81
  server.registerTool(
79
82
  "permission",
80
83
  {
@@ -344,7 +347,7 @@ let leaving = false;
344
347
  const leave = async () => {
345
348
  if (leaving) return;
346
349
  leaving = true;
347
- if (!args.permission && port)
350
+ if (!permissionOnly && port)
348
351
  await fetch(`http://127.0.0.1:${port}/api/boards/release`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client: CLIENT }), signal: AbortSignal.timeout(1000) }).catch(() => {});
349
352
  process.exit(0);
350
353
  };