ponzu 0.0.0-stage → 1.57.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 North Brook
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,210 @@
1
- # Temporary Holding Version
1
+ <p align="center"><img src="apps/web/public/favicon.svg" width="72" height="72" alt=""></p>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <h1 align="center">Ponzu</h1>
4
+
5
+ <p align="center">The design canvas for your coding agent.<br>Open source. Runs on your machine. Your agent designs in plain HTML and CSS, and you steer with comments.</p>
6
+
7
+ <p align="center"><a href="https://ponzu.design">ponzu.design</a> · <a href="#connect-an-agent">Connect an agent</a> · <a href="#the-design-format">The .design format</a> · <a href="#embed-it">Embed it</a></p>
8
+
9
+ <p align="center"><a href="https://ponzu.design/gh/north-brook/ponzu/design/brand.design"><img src="https://ponzu.design/badge.svg?label=brand" alt="brand | Ponzu"></a> <a href="https://ponzu.design/gh/north-brook/ponzu/design/press-kit.design"><img src="https://ponzu.design/badge.svg?label=press%20kit" alt="press kit | Ponzu"></a> <a href="https://ponzu.design/gh/north-brook/ponzu/design/components.design"><img src="https://ponzu.design/badge.svg?label=design%20system" alt="design system | Ponzu"></a></p>
10
+
11
+ ---
12
+
13
+ Ponzu is an infinite canvas of artboards. Agents draw on it over MCP, writing HTML and CSS, and you watch it happen live. You leave comments on the canvas; the agent picks them up, makes the change, and resolves them. There are no manual editing panels. If you want something changed, you ask.
14
+
15
+ - **Free forever.** MIT. No account, no seats, no limits. Bring the agent you already use.
16
+ - **Your files, your workflow.** A `.design` is a folder of HTML files on your disk. Commit it next to your code, sync it through Dropbox, or toss it.
17
+ - **Just HTML and CSS.** If a browser can do it, so can your design: grid, gradients, variable fonts, video, real animation. Agents watch their animations and hover states frame by frame, not just the first frame.
18
+
19
+ ## Quick start
20
+
21
+ ```sh
22
+ bunx ponzu serve
23
+ ```
24
+
25
+ This opens the canvas in your browser and serves MCP at `http://127.0.0.1:7777/mcp`. Every `.design` folder under the current directory is opened. It needs [Bun](https://bun.sh); `bun add -g ponzu` keeps a `ponzu` command around.
26
+
27
+ To change a design someone committed to GitHub, open it by its path:
28
+
29
+ ```sh
30
+ bunx ponzu open north-brook/ponzu/examples/kettle.design
31
+ ```
32
+
33
+ This clones the repo into `~/Ponzu/north-brook/ponzu` (or reuses the clone there) and serves that design. It takes the same path as the [web viewer](#share-it-from-github), with `@branch` after the repo, or a `ponzu.design/gh` or `github.com` link.
34
+
35
+ Or [download the Mac app](https://ponzu.design/download) (Apple silicon, signed and notarized; it updates itself). It opens `.design` folders like documents, and on first launch it sets up Claude Code, Codex and Cursor for you. There's nothing else to install or keep running.
36
+
37
+ The app also puts `ponzu` in your terminal, running from inside the app so it updates with it. It links the command into a folder your shell already searches that you can write to (`~/.local/bin`, `~/bin` or `/usr/local/bin`), never over another `ponzu`. If there's no such folder, choose **Ponzu › Install Terminal Command…**, which asks for your password to add it to `/usr/local/bin`.
38
+
39
+ ## Connect an agent
40
+
41
+ The Mac app does this on launch. Without it:
42
+
43
+ ```sh
44
+ ponzu install # every agent found: Claude Code, Codex, Cursor
45
+ ponzu install claude # or just one
46
+ ```
47
+
48
+ Agents get a command to launch, `ponzu mcp`, rather than a URL. It finds the running Ponzu (the app or `ponzu serve`) on whatever port it's on, so the agent shares your canvas. If the app is installed but not running, it starts it in the background, with no window until you open Ponzu. With neither, it runs the tools itself on the `.design` folders under the agent's project. With the app installed, the command runs from inside the app, so it updates with it.
49
+
50
+ Any other MCP client can launch `ponzu mcp` over stdio, or use `http://127.0.0.1:7777/mcp` while Ponzu runs. `ponzu install claude --url <url>` registers a URL, e.g. a Ponzu on another machine.
51
+
52
+ ### The plugin
53
+
54
+ Claude Code and Codex can also install Ponzu as a plugin. It adds Ponzu's skills (start a design from a brief, bring a screen into Ponzu, explore variations, implement a design, watch your comments) and the same server the app sets up. It launches the Mac app's server, so open the app once first.
55
+
56
+ ```sh
57
+ claude plugin marketplace add north-brook/ponzu && claude plugin install ponzu@ponzu
58
+ codex plugin marketplace add north-brook/ponzu && codex plugin add ponzu@ponzu
59
+ ```
60
+
61
+ With the app's own setup there too, each agent keeps one Ponzu server, not two. The plugin lives in [`plugin/`](plugin).
62
+
63
+ Then ask for something:
64
+
65
+ > Design a landing page for a houseplant shop in a new `design/shop.design`. Give me three takes on the hero.
66
+
67
+ When an agent points you at a design, it gives you a link rather than a folder path, so it opens in Ponzu instead of your editor: `https://ponzu.design/local#mac=workstation&file=/path/to/app.design&artboard=ab_hero` for the Mac app, or the canvas's own `http://localhost:7777/?file=…` under `ponzu serve`. `artboard` is optional and opens on that board. `mac` is the Mac the design is on, by its Tailscale name, so the link opens on your other Macs too, through Ponzu's link between them; without Tailscale it's left out and the link opens the path on the Mac you click it on. The ponzu.design page hands the design to the app as `ponzu://open?mac=…&file=…` (chats drop links in schemes they don't know) or offers the download if Ponzu isn't installed; the path stays after the `#`, which browsers never send to the site. `/local` sits beside `/gh` for designs on GitHub.
68
+
69
+ To go back and forth on a design, use the `watch` prompt (or say "watch my comments in Ponzu"). The agent watches the canvas for your comments, handles each one and resolves it, replying only to answer a question or flag something. Agents also start watching on their own once they've put work up for you to review, and you can still chat with them while they do.
70
+
71
+ ### Reach it from another machine
72
+
73
+ ```sh
74
+ ponzu serve --host 0.0.0.0 # or your tailnet IP
75
+ ponzu install claude --url http://<that machine>:7777/mcp
76
+ ```
77
+
78
+ Ponzu has no auth. Bind beyond localhost only on networks you trust, such as a tailnet.
79
+
80
+ ## The design format
81
+
82
+ A `.design` is a folder. macOS shows it as a single document; everything else sees a directory.
83
+
84
+ ```
85
+ weft.design/
86
+ design.json { "ponzu": 1, "name": "Weft", "pages": [{ "id", "name", "icon" }] }
87
+ tokens.css :root { --color-signal: #FF5A1F; … }
88
+ comments.json { "threads": [{ "id", "artboardId", "nodeId", "x", "y", "status", "messages", … }] }
89
+ notes/brief.md notes the agent keeps between sessions
90
+ assets/ images and fonts
91
+ pages/
92
+ website/
93
+ landing.html one artboard per file
94
+ ```
95
+
96
+ Each artboard file holds one `<section data-artboard>`. Its size is the `width` and `height` in its style (1440×900 without them); `data-x` and `data-y` only place it on the page.
97
+
98
+ ```html
99
+ <section data-artboard data-id="ab_dr6yq" data-name="Landing" data-x="0" data-y="0" style="width:1440px;height:7216px;background-color:var(--color-paper)">
100
+ <h1 data-id="n_g9oar7w" style="font:700 80px/0.95 var(--font-display);letter-spacing:-0.05em">Write locally. Sync everywhere.</h1>
101
+ </section>
102
+ ```
103
+
104
+ - **Edit it however you like.** Ponzu watches the folder. An edit from your editor, `sed` or another agent shows up live and becomes an event agents can react to.
105
+ - **Ids are lazy.** Hand-written elements get stable ids derived from their position. Ponzu writes an id into a file only when something needs to point at it.
106
+ - **Inert by default.** `<script>`, `on*` handlers and `javascript:` URLs are stripped on load.
107
+ - **Comments are pins.** A thread in `comments.json` sits on an artboard (`artboardId`, plus `nodeId` for a node in it) or on a page's open canvas (`pageId`), at `x`/`y`. One missing a field isn't shown, and stays in the file until it's fixed.
108
+ - **Agents can read the format too.** `get_guide('format')` gives them every file's fields, with examples, for importing or generating a design by writing it directly.
109
+ - **Fonts just work.** Google Fonts named in `font-family` load automatically on the canvas and in screenshots.
110
+ - **Examples stay off your home screen.** `"example": true` in `design.json` marks a sample design. The home screen lists an example only once you open it yourself (from Finder, the app, or `ponzu serve path/to/example.design`), not when it's merely found: by Spotlight, by a scan of your folders, or because an agent started in a folder that has one. Agents still open and use examples like any other design. The ones in [`examples/`](examples) are marked.
111
+
112
+ To implement a design, point your coding agent at the folder. The HTML, tokens and comments are the spec.
113
+
114
+ ### Share it from GitHub
115
+
116
+ A `.design` committed to a public repo opens on the canvas at `ponzu.design/gh/<owner>/<repo>/<path/to/name.design>`, read-only, with its comments, images and fonts: [this repo's Kettle](https://ponzu.design/gh/north-brook/ponzu/examples/kettle.design), for one. Add `@<branch, tag or commit>` to the repo for another ref, or leave off the path to list every design in the repo. Link it from your README with a badge labelled by the design's name; without `?label=` it reads "open in | Ponzu":
117
+
118
+ ```md
119
+ [![Kettle | Ponzu](https://ponzu.design/badge.svg?label=Kettle)](https://ponzu.design/gh/<owner>/<repo>/<path/to/name.design>)
120
+ ```
121
+
122
+ Ponzu keeps a light and a dark preview of each design in its `.ponzu/` folder (the picture Finder shows). Commit them, and a shared link's card shows the design itself.
123
+
124
+ ## Embed it
125
+
126
+ Ponzu is a set of packages you can build into your own product:
127
+
128
+ | Package | What it does |
129
+ | --- | --- |
130
+ | `@ponzu/core` | HTML ↔ node tree, ops with inverses (undo, change feed), sanitizer |
131
+ | `@ponzu/store` | Opens a `.design` from any storage; diffs outside edits into ops |
132
+ | `@ponzu/tools` | The agent tools as transport-agnostic `{ name, schema, handler }` |
133
+ | `@ponzu/mcp` | Those tools over MCP (stdio and streamable HTTP) |
134
+ | `@ponzu/render` | Screenshots, frame-by-frame animation recordings, motion loops and a lint pass. Uses Chromium, an Electron window, or your own renderer |
135
+ | `@ponzu/react` | `<Canvas>`. Renders artboards with the host page's own engine, in shadow roots |
136
+ | `@ponzu/server` | The local host behind `ponzu serve` |
137
+
138
+ On a big page the canvas draws each board as cheaply as it can be seen: boards drawn small show as pictures (their looping motion as short videos over them), images load as copies sized to how they're drawn, and boards off screen skip rendering. A source that serves pictures provides `snapshotUrl` (and `loopsUrl`); without it every board is live DOM. `ponzu serve` makes pictures, loops and image copies in the background and keeps them in `~/.ponzu/cache` (`PONZU_HOME` moves it), trimmed to a few GB, least recently used first.
139
+
140
+ ```tsx
141
+ import { Canvas, MemorySource } from "@ponzu/react";
142
+ import "@ponzu/react/styles.css";
143
+
144
+ <Canvas source={new MemorySource(doc, (next) => save(next))} theme="light" />
145
+ ```
146
+
147
+ Use the tools without MCP, for example with the AI SDK or the Anthropic API:
148
+
149
+ ```ts
150
+ import { tools, runTool, jsonSchema } from "@ponzu/tools";
151
+
152
+ const defs = tools.map((t) => ({ name: t.name, description: t.description, input_schema: jsonSchema(t) }));
153
+ const result = await runTool(tools.find((t) => t.name === "write_html")!, args, { ws, caller });
154
+ ```
155
+
156
+ ## The agent surface
157
+
158
+ About thirty tools in six groups. `get_guide` serves the house rules.
159
+
160
+ | Group | Tools |
161
+ | --- | --- |
162
+ | Orient | `get_basic_info` `get_tree` `get_node` `get_html` `find_nodes` |
163
+ | Write | `create_artboard` `write_html` `update_styles` `set_text` `set_attributes` `duplicate` `move_nodes` `delete` `rename` `update_artboard` |
164
+ | See | `screenshot` (with lint) `record` `export` |
165
+ | Organize | `list_files` `create_file` `update_file` `create_page` `update_page` `archive` `get_tokens` `set_tokens` |
166
+ | Converse | `list_comments` `get_comment` `create_comment` `reply` `set_comment_status` `send_feedback` |
167
+ | Listen + remember | `wait_for_activity` `set_status` `write_note` `read_notes` `get_guide` |
168
+
169
+ Skills for agents that support them ship in [the plugin](#the-plugin), in [`plugin/skills/`](plugin/skills).
170
+
171
+ ## Telemetry
172
+
173
+ The Mac app and the `ponzu` package send pseudonymous usage to the Ponzu team: which tools agents call and whether they fail (with a coarse reason, like a timeout), which agents connect, how often the canvas opens, and the Ponzu version and OS. Each install is a random id in `~/.ponzu/telemetry.json`. When Tailscale is running, Ponzu also links that id to a hash of your Tailscale user id, which is the same on each of your Macs, so the team counts people rather than machines. Your Tailscale id, name and email are never sent, but someone with the hash could check guessed ids against it. Nothing about your designs leaves your machine: no HTML, file names, paths, comment text or tool arguments.
174
+
175
+ Agents can also tell us how Ponzu is working for them with `send_feedback`. That's the one event with words in it, and it's about Ponzu, not your work.
176
+
177
+ Turn all of it off with `ponzu telemetry off`, or set `PONZU_TELEMETRY=0` or `DO_NOT_TRACK=1`. Nothing is sent in CI. Only release builds report: Ponzu built from source, or a fork, has no key and sends nothing. The packages you embed (`@ponzu/tools`, `@ponzu/react` and the rest) send nothing on their own; a host opts in by passing a `telemetry` to its workspace.
178
+
179
+ ## Develop
180
+
181
+ ```sh
182
+ bun install
183
+ bun test
184
+ bun run --filter @ponzu/studio build
185
+ bun apps/cli/src/index.ts serve examples/halon.design examples/kettle.design examples/weft.design
186
+ ```
187
+
188
+ [`examples/`](examples) holds three made-up companies to try Ponzu on: Halon (incident response for engineering teams), Kettle (an iPhone app for people who live together) and Weft (a sync platform for developers). Each has a brand, architecture diagrams, a website and an app, with its brief in `notes/brief.md`.
189
+
190
+ For studio work, run `bun run dev`: the studio with hot reload on all three examples.
191
+
192
+ Run from a checkout, `serve` stays out of the installed app's way: it listens on a port in 7800–7999 derived from the checkout's path (the same every run, different per worktree, the next free one if it's taken), and not on the tailnet, so your iPhone and other Macs keep finding the app, not a dev server. `--port` picks a port; `--tailnet` answers the phone and other Macs too, for testing against them (the app's tailnet port must be free). The studio's dev server proxies to the checkout's port; `PONZU_SERVER=<url>` points it elsewhere.
193
+
194
+ Desktop: `cd apps/desktop && bun run start`. iPhone: `cd apps/mobile && bunx expo run:ios` ([docs/mobile.md](docs/mobile.md)).
195
+
196
+ PR titles are Conventional Commits, and merging a `feat` or `fix` ships a signed release on its own. See [CONTRIBUTING.md](CONTRIBUTING.md).
197
+
198
+ ## Brand and press
199
+
200
+ Ponzu's own brand lives in this repo as `.design` folders under [`design/`](design), and opens on the canvas in your browser:
201
+
202
+ - [Brand](https://ponzu.design/gh/north-brook/ponzu/design/brand.design): the slice, the lockup, the app icon, color, type, motion and voice.
203
+ - [Press kit](https://ponzu.design/gh/north-brook/ponzu/design/press-kit.design): a description and the facts, logos, product shots and social images, ready to export.
204
+ - [Design system](https://ponzu.design/gh/north-brook/ponzu/design/components.design): the studio's bars, buttons, menus, comments and icons, in light and dark.
205
+
206
+ [All three](https://ponzu.design/gh/north-brook/ponzu/design). Each one's `notes/brief.md` says where its source of truth lives in the code.
207
+
208
+ ## License
209
+
210
+ MIT