liteagents 2.6.1 → 2.8.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +4 -2
  3. package/installer/cli.js +4 -1
  4. package/package.json +1 -1
  5. package/packages/ampcode/commands/live-canvas/README.md +38 -47
  6. package/packages/{claude/skills/live-canvas/templates/demo → ampcode/commands/live-canvas/dev}/post-variants.html +8 -3
  7. package/packages/ampcode/commands/live-canvas/templates/lab-banner.html +6 -0
  8. package/packages/ampcode/commands/live-canvas/templates/overlay-vanilla.js +64 -6
  9. package/packages/ampcode/commands/live-canvas.md +140 -161
  10. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/.claude-plugin/plugin.json +1 -1
  11. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md +2 -2
  12. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/package.json +1 -1
  13. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/schema.json +1 -1
  14. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/server.js +320 -27
  15. package/packages/claude/plugins/live-canvas-marketplace/setup.sh +83 -24
  16. package/packages/claude/skills/live-canvas/README.md +53 -57
  17. package/packages/claude/skills/live-canvas/SKILL.md +122 -158
  18. package/packages/{ampcode/commands/live-canvas/templates/demo → claude/skills/live-canvas/dev}/post-variants.html +8 -3
  19. package/packages/claude/skills/live-canvas/templates/lab-banner.html +6 -0
  20. package/packages/claude/skills/live-canvas/templates/overlay-vanilla.js +64 -6
  21. package/packages/droid/commands/live-canvas/README.md +38 -47
  22. package/packages/droid/commands/live-canvas/{templates/demo → dev}/post-variants.html +8 -3
  23. package/packages/droid/commands/live-canvas/templates/lab-banner.html +6 -0
  24. package/packages/droid/commands/live-canvas/templates/overlay-vanilla.js +64 -6
  25. package/packages/droid/commands/live-canvas.md +140 -161
  26. package/packages/opencode/command/live-canvas/README.md +38 -47
  27. package/packages/opencode/command/live-canvas/{templates/demo → dev}/post-variants.html +8 -3
  28. package/packages/opencode/command/live-canvas/templates/lab-banner.html +6 -0
  29. package/packages/opencode/command/live-canvas/templates/overlay-vanilla.js +64 -6
  30. package/packages/opencode/command/live-canvas.md +140 -161
  31. package/packages/ampcode/commands/live-canvas/templates/.claude/settings.local.json +0 -8
  32. package/packages/ampcode/commands/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +0 -1299
  33. package/packages/ampcode/commands/live-canvas/templates/feedback-react/format-utils.ts +0 -283
  34. package/packages/ampcode/commands/live-canvas/templates/feedback-react/index.ts +0 -62
  35. package/packages/ampcode/commands/live-canvas/templates/feedback-react/selector-utils.ts +0 -423
  36. package/packages/ampcode/commands/live-canvas/templates/feedback-react/types.ts +0 -118
  37. package/packages/claude/skills/live-canvas/INTEGRATION_NOTES.md +0 -210
  38. package/packages/claude/skills/live-canvas/templates/.claude/settings.local.json +0 -8
  39. package/packages/claude/skills/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +0 -1299
  40. package/packages/claude/skills/live-canvas/templates/feedback-react/format-utils.ts +0 -283
  41. package/packages/claude/skills/live-canvas/templates/feedback-react/index.ts +0 -62
  42. package/packages/claude/skills/live-canvas/templates/feedback-react/selector-utils.ts +0 -423
  43. package/packages/claude/skills/live-canvas/templates/feedback-react/types.ts +0 -118
  44. package/packages/droid/commands/live-canvas/templates/.claude/settings.local.json +0 -8
  45. package/packages/droid/commands/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +0 -1299
  46. package/packages/droid/commands/live-canvas/templates/feedback-react/format-utils.ts +0 -283
  47. package/packages/droid/commands/live-canvas/templates/feedback-react/index.ts +0 -62
  48. package/packages/droid/commands/live-canvas/templates/feedback-react/selector-utils.ts +0 -423
  49. package/packages/droid/commands/live-canvas/templates/feedback-react/types.ts +0 -118
  50. package/packages/opencode/command/live-canvas/templates/.claude/settings.local.json +0 -8
  51. package/packages/opencode/command/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +0 -1299
  52. package/packages/opencode/command/live-canvas/templates/feedback-react/format-utils.ts +0 -283
  53. package/packages/opencode/command/live-canvas/templates/feedback-react/index.ts +0 -62
  54. package/packages/opencode/command/live-canvas/templates/feedback-react/selector-utils.ts +0 -423
  55. package/packages/opencode/command/live-canvas/templates/feedback-react/types.ts +0 -118
package/CHANGELOG.md CHANGED
@@ -17,6 +17,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
 
18
18
  ---
19
19
 
20
+ ## [2.8.0] - 2026-05-18
21
+
22
+ ### Added
23
+ - **live-canvas channel: lazy port binding via MCP tools** — `server.js` (v0.5.0) now exposes `channel_open`, `channel_close`, and `batch_open` tools and only binds port 8788 when the skill explicitly calls one. Plain Claude sessions stay idle by default; multiple sessions can have the plugin loaded with `/mcp` green without racing for the port.
24
+ - **live-canvas channel: automatic sibling takeover** — when `channel_open` finds port 8788 held by another instance of the live-canvas plugin running as the same uid, it takes over (SIGTERM the sibling, rebind, SIGKILL fallback if needed). The taken-over pid is returned as `took_over` in the response so the skill can surface it to the user. Foreign processes are still refused with `{status: "in_use", holder_pid, ...}` — the plugin won't kill anything it doesn't own. Removes the dead-end "port busy, go close it yourself in some other terminal" prompt the user was hitting on every second `/live-canvas`.
25
+ - **live-canvas JSON mode: writes to disk instead of browser download** — channel server gains a `POST /feedback-jsonl` route that appends submissions to `<parent claude cwd>/.claude-design/feedback.jsonl`. The skill calls a new `batch_open` MCP tool (no flag gate — JSON mode doesn't use channels) and sets the overlay's `batchEndpoint` to `/feedback-jsonl`. Falls back to the legacy browser-download path only when the MCP isn't available or another session holds the port.
26
+ - **live-canvas channel: parent-flag capability gate** — `channel_open` inspects the parent `claude` process's command line and refuses to bind if `--dangerously-load-development-channels` is missing, returning `{status: "no_channel_capability", message: ...}`. Without this, plain `claude` sessions could win the port race and silently drop every notification (POST 200, no `<channel>` tag — the "nothing landed" black hole).
27
+ - **Cross-platform parent-cmdline detection** — Linux reads `/proc/<ppid>/cmdline` (fast, no subprocess); macOS/BSD falls back to `ps -p <ppid> -o args=`; Windows falls back to `wmic process where processid=<ppid> get commandline`. If none work the gate fails closed.
28
+ - **SKILL.md Case D — explicit relaunch block** — when `channel_open` returns `no_channel_capability`, the skill prints the exact `live-claude --continue` command (and the literal `--dangerously-load-development-channels` long form) and stops, instead of proceeding into a non-functional Live mode.
29
+
30
+ ### Changed
31
+ - **SKILL.md mode-selection: replaced `curl /health` probe with the `mcp__live-canvas__channel_open` tool call.** The tool's structured result (`opened` / `already_listening` / `in_use` / `no_channel_capability`) is authoritative — no more curl-vs-marketplace-dir branch table. Mirrors in `packages/{droid,ampcode,opencode}/commands/live-canvas.md` synced.
32
+
33
+ ### Fixed
34
+ - **live-canvas: silent channel black-hole when a plain `claude` won the port race.** Before, the first session to start (often a plain `claude` without the experimental channels flag) would bind 8788 first; subsequent `live-claude` sessions hit EADDRINUSE and the user's browser feedback would POST 200 into a session that silently discarded notifications. The capability gate + lazy bind together eliminate this: only flagged sessions can claim the port.
35
+
36
+ ---
37
+
38
+ ## [2.7.0] - 2026-05-17
39
+
40
+ ### Added
41
+ - **live-canvas: one-shot installer** — `setup.sh` now copies the marketplace to `~/.claude/plugins/`, runs `npm install`, and writes a `live-claude` shell function to `~/.zshrc` and `~/.bashrc` so the user can launch a Live-mode session with one command. Idempotent.
42
+ - **live-canvas: collapsible overlay** — a "−" button next to "Add Feedback" hides the bar to a 36px corner bubble (sessionStorage-persisted). Mobile-friendly: comment popup goes full-width below 640px.
43
+ - **live-canvas: lab banner** — generated lab pages now include a "this is a temporary review surface" banner template (`templates/lab-banner.html`), mode-agnostic, paste-once.
44
+ - **live-canvas: explicit mode pick** — the skill asks Live vs JSON every run via `AskUserQuestion` instead of silently auto-detecting. If Live is unreachable, the skill diagnoses (installed-but-not-Live vs first-time setup) and prints targeted next steps instead of failing opaquely.
45
+ - **CLAUDE.md inline dev rules** — must-know rules from `.claude/memory/AGENT_RULES.md` (Simple > clever, surgical changes, dependency hierarchy, mobile-first UI, POC-first) are now inlined in CLAUDE.md so every agent session sees them.
46
+ - **Installer banner reads `package.json`** — the ASCII logo's version string is no longer hardcoded; `UPDATE_VERSION.sh` only needs to touch `package.json` to keep it current. README version badge already auto-pulled from `package.json` via shields.io.
47
+
48
+ ### Changed
49
+ - **live-canvas: vanilla overlay everywhere** — deleted the React-specific overlay (`templates/feedback-react/`, 5 files, ~2300 lines). `overlay-vanilla.js` (one file, plain DOM, zero deps) now works in every supported framework, including React/Next.js/Vite via a `<script>` tag + `useEffect`.
50
+ - **live-canvas: user-facing rename "Batch" → "JSON"** — the non-Live mode is now called "JSON mode" everywhere user-facing.
51
+ - **live-canvas: demo moved to `dev/`** — `templates/demo/post-variants.html` was never copied during real runs. Relocated to `dev/post-variants.html` at the skill root.
52
+
53
+ ### Fixed
54
+ - **live-canvas channel server: shutdown race** — `server.js` held port 8788 indefinitely after the MCP host disconnected because `server.close()` is async but `process.exit()` was called synchronously. Stale process broke `/reload-plugins` and second sessions. Now uses a `closing` guard and lets `server.close()` callback drive exit (with a 500ms unref'd ceiling).
55
+ - **live-canvas overlay: mode badge stale on re-expand** — collapsing and re-expanding the overlay used to show "BATCH mode" (now "JSON mode") even after a runtime live→batch fallback. Badge text now refreshes from `state.mode` on every re-expand.
56
+ - **live-canvas setup.sh: sudo guard** — bails early when run with `sudo` instead of silently installing into `/root/.claude/plugins/`.
57
+ - **live-canvas docs: stale tails** — README ASCII diagram still labeled the overlay "(vanilla JS or React)"; troubleshooting referenced the old `/demo/` URL prefix; SKILL.md JSX-translation note for the lab banner was too thin (kebab-case CSS properties would produce invalid JSX).
58
+
59
+ ### Removed
60
+ - **`templates/feedback-react/`** — React-specific overlay and supporting modules (`FeedbackOverlay.tsx`, `selector-utils.ts`, `format-utils.ts`, `types.ts`, `index.ts`).
61
+ - **`INTEGRATION_NOTES.md`** — stale draft predating the channel implementation; recommendations all completed.
62
+ - **3-case probe tree from Phase 0** — replaced by an explicit mode prompt + targeted diagnostic block when Live is picked but unreachable.
63
+
64
+ ---
65
+
20
66
  ## [2.6.1] - 2026-05-09
21
67
 
22
68
  ### Security
package/README.md CHANGED
@@ -11,8 +11,10 @@
11
11
 
12
12
  **AI development toolkit with 11 specialized agents and 23 commands per tool**
13
13
 
14
- [![npm version](https://img.shields.io/npm/v/liteagents)](https://www.npmjs.com/package/liteagents)
15
- [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
14
+ <p align="center">
15
+ <img src="https://img.shields.io/github/package-json/v/hamr0/liteagents?label=version&color=2a4f8c" alt="version (auto from package.json)">
16
+ <img src="https://img.shields.io/badge/license-Apache%202.0-2a4f8c" alt="license: Apache 2.0">
17
+ </p>
16
18
 
17
19
  **Supported Tools:**
18
20
  [![Claude](https://img.shields.io/badge/Claude-Supported-blue?logo=anthropic)](https://claude.ai)
package/installer/cli.js CHANGED
@@ -14,6 +14,9 @@ const fs = require('fs');
14
14
  const path = require('path');
15
15
  const readline = require('readline');
16
16
 
17
+ // Single source of truth for version; UPDATE_VERSION.sh bumps only package.json.
18
+ const PACKAGE_VERSION = require('../package.json').version;
19
+
17
20
  // ANSI color codes
18
21
  const colors = {
19
22
  reset: '\x1b[0m',
@@ -456,7 +459,7 @@ ${colors.bright}${colors.cyan}██╔══██║██║ ██║█
456
459
  ${colors.bright}${colors.cyan}██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ██║╚██████╗ ██║ ██╗██║ ██║${colors.reset}
457
460
  ${colors.bright}${colors.cyan}╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝${colors.reset}
458
461
 
459
- ${colors.bright}v2.6.1 | 11 agents + 23 commands per tool${colors.reset}
462
+ ${colors.bright}v${PACKAGE_VERSION} | 11 agents + 23 commands per tool${colors.reset}
460
463
  `);
461
464
  }
462
465
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "liteagents",
3
- "version": "2.6.1",
3
+ "version": "2.8.0",
4
4
  "description": "AI development toolkit with 11 specialized agents and 23 commands including live-canvas UI design with click-to-annotate feedback. Simple one-question installer for Claude, Opencode, Ampcode, and Droid.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Click-to-annotate UI design tool for Claude Code. Renders N variants of a component or page in your browser, you click an element and type what to change, and Claude edits the variant file while you watch in the browser. No window switching, no pasted JSON.
4
4
 
5
- Ships as a Claude Code skill plus an MCP channel plugin. Works in every tool liteagents supports (Claude, Droid, Amp, Opencode), but **Live mode only works in Claude Code** — other tools run in Batch mode only (see modes below).
5
+ Ships as a Claude Code skill plus an MCP channel plugin. Works in every tool liteagents supports (Claude, Droid, Amp, Opencode), but **Live mode only works in Claude Code** — other tools run in JSON mode only (see modes below).
6
6
 
7
7
  ---
8
8
 
@@ -11,7 +11,7 @@ Ships as a Claude Code skill plus an MCP channel plugin. Works in every tool lit
11
11
  ```
12
12
  ┌──────────────────────┐ POST /feedback ┌─────────────────────┐
13
13
  │ Overlay in browser │ ─────────────────────────► │ live-canvas-channel │
14
- │ (vanilla JS or React)│ │ (Node MCP server) │
14
+ │ (vanilla JS, ~500 lines)│ │ (Node MCP server) │
15
15
  └──────────────────────┘ └──────────┬──────────┘
16
16
  ▲ │
17
17
  │ dev server hot-reloads the page │ notifications/
@@ -31,28 +31,31 @@ Each Save in the overlay streams into the Claude session as a `<channel>` tag wi
31
31
 
32
32
  ## Modes
33
33
 
34
- The overlay auto-selects at runtime, the user never toggles manually.
34
+ The skill asks you which mode you want every time `/live-canvas` runs.
35
35
 
36
- | Mode | Trigger | What happens per Save |
36
+ | Mode | Use when | What happens per Save |
37
37
  |---|---|---|
38
- | **Live** | Channel server answers `GET /health`, session was started with the dev-channels flag | Comment streams into Claude's context; Claude edits the file; dev server hot-reloads. Toast: "Pushed to Claude ✨". |
39
- | **Batch** | No channel, or running under Droid/Amp/Opencode | Comment stays local. On Finish/Submit it writes JSONL (or downloads the file if no endpoint). User pastes or says "check" in the CLI to have the assistant act on the whole batch. |
38
+ | **Live** | You launched the session with `live-claude` and the channel is up | Comment streams into Claude's context; Claude edits the file; dev server hot-reloads. Toast: "Pushed to Claude ✨". |
39
+ | **JSON** | Any session, any tool (Claude, Droid, Amp, Opencode) | Comment stays local. On Finish/Submit it writes JSONL (or downloads the file if no endpoint). User pastes or says "check" in the CLI to have the assistant act on the whole batch. |
40
40
 
41
- Live mode gracefully degrades to Batch if a push ever fails mid-session.
41
+ If you pick Live but the channel doesn't answer, the skill stops and tells you to relaunch with `live-claude` (or fall back to JSON). It doesn't silently downgrade — the user always gets to choose.
42
42
 
43
43
  ---
44
44
 
45
45
  ## One-time setup (Live mode, Claude Code only)
46
46
 
47
- Run this once per machine. Without it, the skill still works in Batch mode.
47
+ Run this once per machine. Without it, the skill still works in JSON mode.
48
48
 
49
- ### 1. Install plugin npm dependencies
49
+ ### 1. Run the installer
50
50
 
51
51
  ```bash
52
- bash ~/.claude/plugins/live-canvas-marketplace/setup.sh
52
+ bash packages/claude/plugins/live-canvas-marketplace/setup.sh
53
53
  ```
54
54
 
55
- Checks Node >= 18, runs `npm install` inside the plugin dir. Idempotent.
55
+ The installer:
56
+ - copies the marketplace into `~/.claude/plugins/live-canvas-marketplace/` (overwrites any prior install)
57
+ - runs `npm install` inside the channel plugin
58
+ - adds a `live-claude` shell function to `~/.zshrc` and `~/.bashrc` (idempotent — re-runs replace in place)
56
59
 
57
60
  ### 2. Register the marketplace in Claude Code
58
61
 
@@ -66,21 +69,9 @@ Checks Node >= 18, runs `npm install` inside the plugin dir. Idempotent.
66
69
  /plugin install live-canvas-channel@live-canvas-marketplace
67
70
  ```
68
71
 
69
- ### 4. Start Claude Code with the dev-channels flag
72
+ ### 4. Open a fresh shell
70
73
 
71
- ```bash
72
- claude --dangerously-load-development-channels plugin:live-canvas-channel@live-canvas-marketplace
73
- ```
74
-
75
- Accept the safety prompt (custom channels are in research preview and not on the default allowlist).
76
-
77
- **Save yourself typing** — add to `~/.bashrc` or `~/.zshrc`:
78
-
79
- ```bash
80
- alias claude-live='claude --dangerously-load-development-channels plugin:live-canvas-channel@live-canvas-marketplace'
81
- ```
82
-
83
- From now on, `claude-live` to enable Live mode, plain `claude` for everything else.
74
+ `live-claude` is now available. Use plain `claude` for everything else; use `live-claude` when you want Live mode for this skill.
84
75
 
85
76
  ---
86
77
 
@@ -88,7 +79,7 @@ From now on, `claude-live` to enable Live mode, plain `claude` for everything el
88
79
 
89
80
  ### Start a session
90
81
 
91
- Either `claude` (Batch only) or `claude-live` (Live available).
82
+ Either `claude` (JSON only) or `live-claude` (Live available).
92
83
 
93
84
  ### Invoke the skill in a project
94
85
 
@@ -96,13 +87,13 @@ Either `claude` (Batch only) or `claude-live` (Live available).
96
87
  /live-canvas
97
88
  ```
98
89
 
99
- Phase 0 probes the channel and decides what to do:
90
+ Phase 0 always asks which mode you want — Live channel or JSON file — then probes the channel if you picked Live:
100
91
 
101
- | State | Skill behavior |
102
- |---|---|
103
- | Channel responding | Announces Live mode, goes straight into the interview |
104
- | Plugin installed but channel not responding (you forgot the dev flag) | AskUserQuestion: Batch now, or close and restart with the flag? |
105
- | Plugin not installed at all (first run) | AskUserQuestion: set up Live, or just use Batch? Prints the 4-step setup. |
92
+ | Choice | Channel up? | Skill behavior |
93
+ |---|---|---|
94
+ | Live | yes | Announces Live mode, starts the interview |
95
+ | Live | no | Tells you to relaunch with `live-claude` (or fall back to JSON) |
96
+ | JSON | n/a | Announces JSON mode, starts the interview |
106
97
 
107
98
  ### Interview & generation
108
99
 
@@ -113,13 +104,15 @@ Skill asks 5 short questions (scope, pain points, inspiration, persona, constrai
113
104
  Open `http://localhost:<dev-port>/__live_canvas`. Click **Add Feedback** (bottom right), click any element in any variant, type a one-liner, Save.
114
105
 
115
106
  - Live mode: toast says "Pushed to Claude ✨", Claude acknowledges and edits the file, dev server hot-reloads.
116
- - Batch mode: toast says "Saved — submit when ready", pin stays on the element, counter in the Submit button ticks up.
107
+ - JSON mode: toast says "Saved — submit when ready", pin stays on the element, counter in the Submit button ticks up.
108
+
109
+ Need the page back? The overlay has a "−" button next to **Add Feedback** that collapses everything to a small circle in the corner — tap to expand again. Useful on mobile where the bar can cover what's underneath.
117
110
 
118
111
  Keep clicking until a winner emerges.
119
112
 
120
113
  ### Finish
121
114
 
122
- Click the pink **Finish** (Live) or **Submit** (Batch) button:
115
+ Click the pink **Finish** (Live) or **Submit** (JSON) button:
123
116
 
124
117
  1. Type the overall direction: e.g. *"Go with B's layout, A's button styling"*
125
118
  2. Click Finish
@@ -142,12 +135,11 @@ packages/claude/
142
135
  ├── skills/live-canvas/
143
136
  │ ├── SKILL.md # Skill instructions (phases, flow)
144
137
  │ ├── DESIGN_PRINCIPLES.md # UX/a11y/motion reference
145
- │ ├── INTEGRATION_NOTES.md # Design-time notes (channel paths explored)
146
138
  │ ├── README.md # This file
139
+ │ ├── dev/post-variants.html # Standalone demo for local QA of the overlay
147
140
  │ └── templates/
148
- │ ├── overlay-vanilla.js # Framework-agnostic overlay (~400 lines)
149
- ├── feedback-react/ # React overlay for React/Next/Vite projects
150
- │ └── demo/post-variants.html # Standalone demo for testing the overlay
141
+ │ ├── overlay-vanilla.js # Framework-agnostic overlay (~500 lines)
142
+ └── lab-banner.html # "This is a temp lab" notice snippet
151
143
  └── plugins/
152
144
  └── live-canvas-marketplace/
153
145
  ├── .claude-plugin/marketplace.json
@@ -188,9 +180,9 @@ The skill checks the cache dir to tell first-time vs returning users apart.
188
180
  <project-root>/
189
181
  └── .claude-design/
190
182
  ├── lab/variants/VariantA.tsx … VariantE.tsx
191
- ├── lab/FeedbackOverlay.tsx (React) OR overlay-vanilla.js (other)
183
+ ├── overlay-vanilla.js (copied into the project's public/static dir)
192
184
  ├── design-brief.json # Structured output from the interview
193
- └── feedback.jsonl # Batch mode only; deleted on Finish
185
+ └── feedback.jsonl # JSON mode only; deleted on Finish
194
186
  ```
195
187
 
196
188
  Plus a temporary route (e.g. `app/__live_canvas/page.tsx` for Next.js App Router). Everything under `.claude-design/` and the temporary route is deleted on Finish or Abort.
@@ -207,12 +199,11 @@ Plus a temporary route (e.g. `app/__live_canvas/page.tsx` for Next.js App Router
207
199
 
208
200
  ## The install pipeline, end to end
209
201
 
210
- 1. **Liteagents installer** copies files:
202
+ 1. **Liteagents installer** copies the skill:
211
203
  - `packages/claude/skills/live-canvas/` → `~/.claude/skills/live-canvas/`
212
- - `packages/claude/plugins/live-canvas-marketplace/` → `~/.claude/plugins/live-canvas-marketplace/`
213
- 2. **User, once:** runs `bash ~/.claude/plugins/live-canvas-marketplace/setup.sh` → installs the plugin's npm deps
204
+ 2. **User, once:** runs `bash packages/claude/plugins/live-canvas-marketplace/setup.sh`copies marketplace to `~/.claude/plugins/`, runs `npm install`, adds `live-claude` function to `~/.zshrc` and `~/.bashrc`
214
205
  3. **User, once:** in a Claude session, runs `/plugin marketplace add ~/.claude/plugins/live-canvas-marketplace` + `/plugin install live-canvas-channel@live-canvas-marketplace`
215
- 4. **User, every session that wants Live mode:** starts Claude with `--dangerously-load-development-channels plugin:live-canvas-channel@live-canvas-marketplace` (or `claude-live` alias)
206
+ 4. **User, every session that wants Live mode:** runs `live-claude` (function installed by step 2)
216
207
  5. **User, whenever:** `/live-canvas` in any project
217
208
 
218
209
  Steps 1, 2, 3 are truly one-time. Step 4 is per-session. Step 5 is per-project-use.
@@ -221,7 +212,7 @@ Steps 1, 2, 3 are truly one-time. Step 4 is per-session. Step 5 is per-project-u
221
212
 
222
213
  ## Troubleshooting
223
214
 
224
- ### "Listening for channel messages…" appears on session start, but skill still says Batch
215
+ ### Channel server starts but skill still routes to JSON
225
216
 
226
217
  Port 8788 is stuck from an earlier session's server process. Kill it:
227
218
 
@@ -236,13 +227,13 @@ Then `/reload-plugins` in the new session.
236
227
 
237
228
  Three common causes, in order of likelihood:
238
229
 
239
- 1. You didn't start this session with the dev flag. Close it, reopen with `claude-live`.
230
+ 1. You didn't start this session with the dev flag. Close it, reopen with `live-claude`.
240
231
  2. The plugin subprocess died on startup. In the session, run `/mcp` — look for `live-canvas` with its status. "Failed to connect" means a node/dep error: check `~/.claude/debug/<session-id>.txt` for the stderr.
241
232
  3. You never ran step 2 of setup. Re-run `bash ~/.claude/plugins/live-canvas-marketplace/setup.sh`.
242
233
 
243
234
  ### Overlay loads in the browser but no pills appear
244
235
 
245
- The overlay script didn't load. Most common cause: you started the Python server inside the wrong directory so the relative `../overlay-vanilla.js` path couldn't resolve. Start the server one level up and navigate with the `/demo/` prefix.
236
+ The overlay script didn't load. Most common cause: you started the Python server inside the wrong directory so the relative `../templates/overlay-vanilla.js` path couldn't resolve. Start the server one level up and navigate with the `/dev/` prefix.
246
237
 
247
238
  ### "Pushed to Claude ✨" toast appears but nothing happens in the terminal
248
239
 
@@ -79,6 +79,9 @@
79
79
  <header>
80
80
  <h1>Live Canvas — Post card demo</h1>
81
81
  <p>5 variations of a social post (likes, retweets, comments). Click <b>Add Feedback</b> bottom-right → click any element → leave a comment. Right-click the pill to submit.</p>
82
+ <div style="background:#fef3c7;border:1px solid #fbbf24;border-radius:8px;padding:10px 14px;margin-top:12px;font-size:13px;color:#78350f;">
83
+ <b>This is an overlay-only demo.</b> Feedback events transit through the Live channel (or JSON file, with <code>?json=1</code>) so you can verify the UI works — but there are no <code>.claude-design/lab/variants/</code> files behind these cards, so the Claude session receiving events <em>cannot</em> edit anything. For the full lifecycle, run <code>/live-canvas</code> in a real project.
84
+ </div>
82
85
  </header>
83
86
 
84
87
  <main>
@@ -193,12 +196,14 @@
193
196
 
194
197
  </main>
195
198
 
196
- <!-- Overlay (relative path works with file://) -->
197
- <script src="../overlay-vanilla.js"></script>
199
+ <!-- Overlay (served from sibling templates/ dir; works under any static server rooted at the skill dir) -->
200
+ <script src="../templates/overlay-vanilla.js"></script>
198
201
  <script>
202
+ // ?json=1 forces JSON mode (skip channel probe); default tries Live first.
203
+ const forceJson = new URLSearchParams(location.search).has('json');
199
204
  LiveCanvas.init({
200
205
  target: 'PostCard',
201
- channelUrl: 'http://localhost:8788',
206
+ ...(forceJson ? {} : { channelUrl: 'http://localhost:8788' }),
202
207
  });
203
208
  </script>
204
209
  </body>
@@ -0,0 +1,6 @@
1
+ <div role="note" style="background:#fefce8;border:1px solid #facc15;border-radius:8px;padding:10px 14px;margin:12px 0;font-size:13px;line-height:1.5;color:#854d0e;">
2
+ <b>This is a temporary design lab.</b> Click any element → leave a comment → Save.
3
+ Your feedback goes to Claude; the lab is deleted on Finish. The overlay
4
+ badge (bottom-right) tells you whether feedback is streaming live or being
5
+ collected as JSON.
6
+ </div>
@@ -23,7 +23,7 @@
23
23
  * Batch — saves accumulate locally; Submit All POSTs JSONL to batchEndpoint
24
24
  * (or downloads the file if no endpoint configured)
25
25
  *
26
- * Payload schema: v1.0, compatible with the upstream React FeedbackOverlay.
26
+ * Payload schema: v1.0 (see live-canvas-channel/schema.json).
27
27
  */
28
28
  (function () {
29
29
  'use strict';
@@ -38,11 +38,16 @@
38
38
  batchEndpoint: null,
39
39
  active: false,
40
40
  picking: false,
41
+ minimized: false, // collapsed to a single bubble?
41
42
  comments: [], // Comment[] — only items pending batch submit
42
43
  overall: '',
43
44
  pinCounts: Object.create(null), // `${variant}|${selector}` → placed-pin count
44
45
  };
45
46
 
47
+ // Persist collapse state across hot reloads / variant switches.
48
+ const MIN_KEY = 'lc-minimized';
49
+ try { state.minimized = sessionStorage.getItem(MIN_KEY) === '1'; } catch (_) {}
50
+
46
51
  // ---------- utilities ----------
47
52
 
48
53
  const uid = () => `c-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
@@ -134,7 +139,8 @@
134
139
  const css = `
135
140
  [${DATA_OVERLAY}] { font-family: system-ui, sans-serif; box-sizing: border-box; }
136
141
  .${PFX}-bar { position: fixed; right: 16px; bottom: 16px; z-index: 2147483646;
137
- display: flex; gap: 8px; }
142
+ display: flex; gap: 8px; align-items: center; }
143
+ .${PFX}-bar[data-hidden='1'] { display: none; }
138
144
  .${PFX}-btn { border: 0; border-radius: 999px; padding: 10px 16px;
139
145
  font-weight: 600; font-size: 13px; cursor: pointer;
140
146
  box-shadow: 0 4px 12px rgba(0,0,0,.25); font-family: inherit; }
@@ -146,9 +152,22 @@
146
152
  .${PFX}-submit .${PFX}-count { display: inline-block; background: #d946ef; color: #fff;
147
153
  border-radius: 999px; min-width: 18px; padding: 0 6px; margin-left: 6px;
148
154
  font-size: 11px; line-height: 18px; text-align: center; }
155
+ .${PFX}-min { width: 32px; height: 32px; padding: 0; border-radius: 50%;
156
+ background: #fff; color: #111; border: 1px solid #e4e4e7; font-size: 16px;
157
+ line-height: 1; display: flex; align-items: center; justify-content: center; }
158
+ .${PFX}-bubble { position: fixed; right: 16px; bottom: 16px; z-index: 2147483646;
159
+ width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
160
+ background: #111; color: #fff; font-size: 14px; font-weight: 700;
161
+ box-shadow: 0 4px 12px rgba(0,0,0,.25); display: none; }
162
+ .${PFX}-bubble[data-show='1'] { display: flex; align-items: center; justify-content: center; }
149
163
  .${PFX}-mode { position: fixed; right: 16px; bottom: 60px; z-index: 2147483646;
150
164
  background: rgba(0,0,0,.75); color: #fff; font-size: 11px;
151
165
  padding: 4px 8px; border-radius: 4px; pointer-events: none; }
166
+ .${PFX}-mode[data-hidden='1'] { display: none; }
167
+ @media (max-width: 640px) {
168
+ .${PFX}-popup { left: 8px !important; right: 8px; width: auto !important; max-width: none; }
169
+ .${PFX}-submit-card { width: 100% !important; max-width: calc(100vw - 24px); }
170
+ }
152
171
  .${PFX}-picking { cursor: crosshair !important; }
153
172
  .${PFX}-hover-outline { outline: 2px solid #d946ef !important; outline-offset: 2px; }
154
173
  .${PFX}-pin { position: absolute; z-index: 2147483645; width: 24px; height: 24px;
@@ -235,9 +254,33 @@
235
254
 
236
255
  // ---------- UI ----------
237
256
 
238
- let toggleBtn, submitBtn, modeBadge, toast, popupNode;
257
+ let toggleBtn, submitBtn, minBtn, bubbleBtn, barNode, modeBadge, toast, popupNode;
239
258
  let hoverEl = null;
240
259
 
260
+ const applyMinimized = () => {
261
+ if (!barNode) return;
262
+ barNode.setAttribute('data-hidden', state.minimized ? '1' : '0');
263
+ modeBadge.setAttribute('data-hidden', state.minimized ? '1' : '0');
264
+ bubbleBtn.setAttribute('data-show', state.minimized ? '1' : '0');
265
+ // state.mode can flip live → batch mid-session if a push fails; refresh
266
+ // the badge each time we re-show it so it doesn't lie.
267
+ if (!state.minimized) {
268
+ modeBadge.textContent = `${state.mode === 'live' ? 'LIVE' : 'JSON'} mode`;
269
+ }
270
+ // Cancel an active pick when collapsing — otherwise clicks land on the page.
271
+ if (state.minimized && state.picking) {
272
+ state.picking = false;
273
+ setPickingCursor(false);
274
+ clearHover();
275
+ toggleBtn.setAttribute('data-active', '0');
276
+ toggleBtn.textContent = 'Add Feedback';
277
+ }
278
+ closePopup();
279
+ try { sessionStorage.setItem(MIN_KEY, state.minimized ? '1' : '0'); } catch (_) {}
280
+ };
281
+
282
+ const setMinimized = (v) => { state.minimized = !!v; applyMinimized(); };
283
+
241
284
  const pendingCount = () => state.comments.filter(c => !c.delivered).length;
242
285
 
243
286
  const refreshSubmitBtn = () => {
@@ -442,14 +485,29 @@
442
485
  submitBtn = el('button', { class: `${PFX}-btn ${PFX}-submit`, on: {
443
486
  click: openSubmitModal,
444
487
  }});
488
+ minBtn = el('button', {
489
+ class: `${PFX}-btn ${PFX}-min`,
490
+ title: 'Hide overlay',
491
+ 'aria-label': 'Hide overlay',
492
+ on: { click: () => setMinimized(true) },
493
+ }, '−');
445
494
  refreshSubmitBtn();
446
- const bar = el('div', { class: `${PFX}-bar` }, [submitBtn, toggleBtn]);
447
- modeBadge = el('div', { class: `${PFX}-mode` }, `${state.mode === 'live' ? 'LIVE' : 'BATCH'} mode`);
495
+ barNode = el('div', { class: `${PFX}-bar` }, [minBtn, submitBtn, toggleBtn]);
496
+ bubbleBtn = el('button', {
497
+ class: `${PFX}-bubble`,
498
+ title: 'Show feedback overlay',
499
+ 'aria-label': 'Show feedback overlay',
500
+ on: { click: () => setMinimized(false) },
501
+ }, '◐');
502
+ modeBadge = el('div', { class: `${PFX}-mode` }, `${state.mode === 'live' ? 'LIVE' : 'JSON'} mode`);
448
503
  toast = el('div', { class: `${PFX}-toast` });
449
- document.body.appendChild(bar);
504
+ document.body.appendChild(barNode);
505
+ document.body.appendChild(bubbleBtn);
450
506
  document.body.appendChild(modeBadge);
451
507
  document.body.appendChild(toast);
452
508
 
509
+ applyMinimized();
510
+
453
511
  document.addEventListener('mousemove', onMouseMove, true);
454
512
  document.addEventListener('click', onClick, true);
455
513
  };