loop-canvas 0.1.1 → 0.1.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.
- package/README.md +1 -1
- package/cli.mjs +9 -8
- package/package.json +1 -1
- package/public/app.css +1 -1
- package/public/app.js +80 -35
- package/public/icons.LICENSE.txt +21 -0
- package/public/index.html +38 -21
- package/server.mjs +29 -19
- package/skills/loop-canvas/SKILL.md +13 -8
|
@@ -39,15 +39,15 @@ If a global install isn't allowed, run every command below as `npx -y loop-canva
|
|
|
39
39
|
The canvas is only ever that localhost page. If you find yourself writing HTML for a canvas, toolbar or comment UI, or publishing a site, stop: that's not Loop, and comments left there reach no one.
|
|
40
40
|
4. **Share it, if asked:** `loop share` prints a link anyone on the same Wi-Fi can open (also in the canvas under **Share**). `loop share --public` makes a public link through a tunnel (needs `brew install cloudflared`). Guests can click through the frames and comment; their comments wait for the host's approval before reaching the agent.
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Comments come to this chat (Claude Code)
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Loop is a visual canvas for you and the user to work on together. Their canvas comments are them talking to **you**, in this chat, with everything you already know about them and the project. So in Claude Code, always do this right after opening the canvas:
|
|
45
45
|
|
|
46
|
-
1. Start `loop watch`
|
|
47
|
-
2.
|
|
48
|
-
3. If the user
|
|
46
|
+
1. Start `loop watch` with the Monitor tool (set the longest timeout, and start it again whenever it expires) and keep it running for the rest of the session. Each canvas comment arrives as a line: `COMMENT <id> on "<frame>": "<text>" | details: <file> | progress: loop step … | when done: loop reply …`.
|
|
47
|
+
2. Treat each COMMENT exactly like a message from the user here. Read the details file: it says where they pointed, lists marks and attachments, and gives the path of a screenshot of the frame as they saw it when they sent the comment (look at that instead of taking one). Do the work the way you would for any request in this chat. Match the effort to the request: a small, specific fix just gets made; design work or a layout change gets checked with `loop shot` and iterated. As you go, say what you're doing with `loop step <id> "<a few words>"` (for example "Reading the header", "Editing the pricing card"): the comment's pin on the canvas shows it live, one step at a time, so the user can follow without opening the thread. Then answer with `loop reply <id> "<what you changed>" --model <your model id>`. The frame refreshes and your reply shows in the canvas thread.
|
|
48
|
+
3. If the user talks about a frame here in the chat instead, make the change and post a short update to its canvas thread with `loop note <id> "<what you changed>"`. `loop thread <id>` shows what was said on the canvas.
|
|
49
49
|
|
|
50
|
-
Tell the user: "Comments you leave on the canvas
|
|
50
|
+
Tell the user: "Comments you leave on the canvas come to me here, and I'll reply in both places." If this chat stops listening, comments wait on the canvas until it's back (the user can send one to a background agent from its thread).
|
|
51
51
|
|
|
52
52
|
## How comments reach an agent
|
|
53
53
|
|
|
@@ -55,17 +55,22 @@ Check the mode with `loop list` or the pill in the top right; switch it with `lo
|
|
|
55
55
|
|
|
56
56
|
Loop detects which agent launched it (Claude Code or Codex) and uses that same agent for the canvas's comments. If detection ever picks the wrong one, pass `--agent codex` or `--agent claude` to `loop open` / `loop scan`.
|
|
57
57
|
|
|
58
|
-
- **headless** (default): Loop runs
|
|
58
|
+
- **headless** (default): Loop runs Claude Code itself in the frame's folder (or in the project root for URL frames): one process per frame that stays ready between comments, streams progress to the frame title and the comment's pin, and keeps a snapshot so the user can undo. Nothing else is needed.
|
|
59
59
|
- **inbox**: use this when the user wants *this* session to handle feedback. Steps:
|
|
60
60
|
1. `loop inbox --wait` blocks up to 25 seconds and returns JSON `{comment, frame, prompt}`, or `{"comment": null}`. Repeat until you get a comment.
|
|
61
61
|
2. Read `prompt`. It describes the request, the element the user pointed at, and the path to a PNG of any marks they drew. Make the change in `frame.src` (static frames), or find the source for that route (URL frames).
|
|
62
|
-
3. While working,
|
|
62
|
+
3. While working, show progress: `loop step <commentId> "Editing the header"`. The comment's pin on the canvas shows it live.
|
|
63
63
|
4. Finish with `loop reply <commentId> "One sentence on what changed" --model <your model id, e.g. claude-opus-5-5>` (add `--error` if you couldn't do it). The frame reloads, and the model shows under your reply.
|
|
64
64
|
|
|
65
|
+
## Seeing your work and offering options
|
|
66
|
+
- `loop shot <frameId>` saves a screenshot of a frame exactly as it renders and prints the PNG path. Use it to check design work and layout changes, and fix what looks off before you reply. A comment's details already include a screenshot from the moment it was sent, and a small, specific fix doesn't need another.
|
|
67
|
+
- When the user asks for options or alternatives on a comment, don't change the real files. For each option run `loop option <commentId> "<short name>"`, which prints an empty folder, and write the complete new version of each changed file there at the same relative path. The user previews the options live in the frame and picks one. `loop shot <frameId> --option <commentId>:A` shows an option on a static frame before anyone picks.
|
|
68
|
+
|
|
65
69
|
## Other commands
|
|
66
70
|
`loop list` (frames + status) · `loop create "<brief>"` (Loop's own agent builds a new frame) · `loop rm <id>` · `loop stop`
|
|
67
71
|
|
|
68
72
|
## Notes
|
|
69
73
|
- Keep static frames self-contained in their folder. The comment agent is only allowed to edit inside that folder.
|
|
74
|
+
- Frames with a snowflake are **frozen**: read-only snapshots the user took to keep a moment (⇧F). Never edit a snapshot; a comment on one is a change to the app's source for that screen.
|
|
70
75
|
- Name frames by what they are ("Checkout — one page", "Checkout — stepped"), not "Frame 1".
|
|
71
76
|
- `.loop/canvas.json` holds the layout and comments; its folder includes a `.gitignore` for runtime files.
|