mockpit 1.3.0 → 3.0.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 (77) hide show
  1. package/README.md +66 -202
  2. package/bin/demoData.js +5 -5
  3. package/bin/initDesign.js +6 -6
  4. package/bin/mockpit.js +687 -192
  5. package/bin/poster.js +377 -0
  6. package/dist/mcp/server.js +110 -19
  7. package/dist/server/answerAdditions.d.ts +7 -0
  8. package/dist/server/answerAdditions.js +76 -0
  9. package/dist/server/apiViews.d.ts +563 -41
  10. package/dist/server/apiViews.js +223 -74
  11. package/dist/server/app.d.ts +10 -2
  12. package/dist/server/app.js +3284 -782
  13. package/dist/server/appIcon.js +15 -5
  14. package/dist/server/appIconPng.js +3 -3
  15. package/dist/server/askNudges.js +1 -1
  16. package/dist/server/cdnInline.d.ts +8 -0
  17. package/dist/server/cdnInline.js +638 -0
  18. package/dist/server/codeWorker.js +2 -1
  19. package/dist/server/decisionList.d.ts +45 -0
  20. package/dist/server/decisionList.js +302 -0
  21. package/dist/server/decisions.d.ts +8 -8
  22. package/dist/server/decisions.js +18 -17
  23. package/dist/server/designGuide.d.ts +10 -6
  24. package/dist/server/designGuide.js +173 -78
  25. package/dist/server/embeds.d.ts +4 -1
  26. package/dist/server/embeds.js +57 -6
  27. package/dist/server/eventLog.d.ts +2 -2
  28. package/dist/server/eventLog.js +11 -11
  29. package/dist/server/events.d.ts +9 -6
  30. package/dist/server/feedbackBatch.d.ts +38 -16
  31. package/dist/server/feedbackBatch.js +121 -50
  32. package/dist/server/fills.d.ts +4 -0
  33. package/dist/server/fills.js +55 -1
  34. package/dist/server/guidance.d.ts +23 -0
  35. package/dist/server/guidance.js +71 -0
  36. package/dist/server/handoff.d.ts +4 -1
  37. package/dist/server/handoff.js +8 -2
  38. package/dist/server/icons.js +1 -1
  39. package/dist/server/index.js +49 -11
  40. package/dist/server/jump.d.ts +21 -0
  41. package/dist/server/jump.js +175 -0
  42. package/dist/server/knobs.d.ts +3 -3
  43. package/dist/server/knobs.js +6 -6
  44. package/dist/server/mcpHttp.d.ts +8 -1
  45. package/dist/server/mcpHttp.js +44 -7
  46. package/dist/server/mcpSpec.d.ts +2 -1
  47. package/dist/server/mcpSpec.js +172 -50
  48. package/dist/server/parts.js +9 -1
  49. package/dist/server/postSurfaces.js +3 -0
  50. package/dist/server/run.d.ts +1 -1
  51. package/dist/server/run.js +31 -17
  52. package/dist/server/runApi.d.ts +3 -3
  53. package/dist/server/runApi.js +34 -24
  54. package/dist/server/sqlStore.d.ts +117 -94
  55. package/dist/server/sqlStore.js +1089 -141
  56. package/dist/server/standings.d.ts +25 -0
  57. package/dist/server/standings.js +113 -0
  58. package/dist/server/surfacePage.d.ts +6 -9
  59. package/dist/server/surfacePage.js +361 -86
  60. package/dist/server/types.d.ts +252 -69
  61. package/dist/server/types.js +87 -69
  62. package/extensions/mockpit.js +245 -65
  63. package/guide/AGENT_SETUP.md +13 -1
  64. package/guide/packs/design-craft.md +34 -0
  65. package/guide/topics/asks.md +117 -69
  66. package/guide/topics/feedback.md +156 -119
  67. package/guide/topics/html.md +19 -32
  68. package/guide/topics/http.md +43 -40
  69. package/guide/topics/knobs.md +7 -10
  70. package/guide/topics/scripts.md +24 -35
  71. package/guide/topics/surfaces.md +50 -41
  72. package/opencode/mockpit.js +120 -0
  73. package/opencode/package.json +8 -0
  74. package/package.json +4 -6
  75. package/skills/launch-video/SKILL.md +12 -12
  76. package/skills/mockpit/SKILL.md +35 -23
  77. package/viewer/dist/index.html +9 -8
package/README.md CHANGED
@@ -1,247 +1,111 @@
1
1
  # mockpit
2
2
 
3
- **A design-decision loop for terminal coding agents.**
3
+ **A design loop for terminal coding agents. Your agent shows designs in your browser and asks
4
+ its questions there. You answer in place and press Send once.**
4
5
 
5
- Your agent publishes a mock (a page or a component) in each of its UI states and
6
- in a few parallel looks. It shows up live in your browser with the agent's
7
- questions beside it: pick a look from pictures, tune the knobs it exposed, leave
8
- comments on the parts it marked, then press **Send**, at your own pace. Nothing
9
- the agent calls waits for you: it gets the whole batch once and revises.
6
+ The agent publishes a screen in its states and a few variants, then ends its turn. You compare
7
+ them from pictures, tune knobs, comment on parts and keep the runners-up. One Send gives the
8
+ agent the whole reply. Nothing it calls waits for you.
10
9
 
11
10
  <table>
12
11
  <tr>
13
12
  <td width="50%" valign="top">
14
13
  <picture>
15
14
  <source media="(prefers-color-scheme: dark)" srcset="docs/mockpit-dark.png">
16
- <img width="100%" alt="The Writer mock on its first question, Look: the Writing state on the stage with a numbered question pin, the strip of four UI states below it, and the panel offering three looks (Quiet, Dark, Editorial) as picture options" src="docs/mockpit-light.png">
15
+ <img width="100%" alt="The Writer design asking Quiet, dark or editorial?, with the three variants as picture answers beside the stage" src="docs/mockpit-light.png">
17
16
  </picture>
18
17
  </td>
19
18
  <td width="50%" valign="top">
20
- <img width="100%" alt="Animated demo: the agent publishes the Writer mock; the user previews the three looks on the stage, picks Quiet, answers where the trim goes, keeps a part from another look and presses Send; the top bar reads Sent, Not seen yet, then Delivered once the agent reads the feedback; the agent replies and publishes v2" src="docs/mockpit-demo.gif">
19
+ <img width="100%" alt="Animated demo: the user keeps Dark, hides Editorial, picks Quiet, answers where the trim goes and presses Send; the reply shows Not seen yet, then Delivered, and the agent publishes version 2" src="docs/mockpit-demo.gif">
21
20
  </td>
22
21
  </tr>
23
22
  </table>
24
23
 
25
- ## Fork of sideshow
26
-
27
- mockpit is a fork of [sideshow](https://github.com/modem-dev/sideshow) by
28
- [Ben Vinegar](https://github.com/benvinegar), sponsored by
29
- [Modem](https://modem.dev). The renderer, sandboxing, MCP/CLI/HTTP tiers and
30
- Cloudflare deploy all come from that work. Thank you.
31
-
32
- Upstream is a live visual surface where agents post renders and you comment.
33
- mockpit turns that into a design-decision loop:
34
-
35
- | | sideshow | mockpit |
36
- | ------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
37
- | Structure | A stream of posts per session | **project › mock › state › variant › version**: a repo, a page or component by slug, its UI states, parallel looks, history |
38
- | Questions | Free-text comments | The agent asks; you answer in place, picking from pictures of each option |
39
- | Tuning | — | Knobs the agent declares (sliders, colours, springs…) on [tunekit](https://github.com/fabiogaliano/tunekit), live on the stage |
40
- | Comments | Text on a post | Anchored on a **part** the agent marked with `data-part`, in a given state |
41
- | Feedback | Each comment reaches the agent as it's written | Picks, tuned values, mix and comments stay drafts until you **Send**, then go out as one reply |
42
- | Design system | Built-in viewer themes | `mockpit init` detects the repo's tokens, fonts and kit so the agent's markup matches your codebase |
43
- | Agent verbs | Post-level: `publish`, `update`, `wait`, `comment` | Mock-level, never blocking: `publish`, `ask`, `read`, `feedback`, `say`, `export`, `upload`, `guide`, `run` |
44
-
45
- ## The loop
46
-
47
- 1. **Publish.** The agent publishes each state of the mock ("Writing", "Lab
48
- open") in one or more variants ("quiet", "dark"). One stage shows the mock;
49
- the strip under it switches states.
50
- 2. **Ask.** The agent asks what it can't decide alone: which look, where a
51
- panel goes, which of two layouts. The question lives in the mock, not in
52
- chat; the agent tells you where to look and ends its turn. Options bound to
53
- a variant or to knob values render as pictures; hovering one previews it on
54
- the stage, clicking picks it, and the part it changed is outlined. A
55
- region the agent drew several ways (a slot: one `data-part`, a `data-fill`
56
- per alternative) is asked about once; a slot inside a fill is asked only
57
- while that fill is chosen. Variants the agent forgot to ask about get a
58
- built-in **Which one?**.
59
- 3. **Tune.** Parts the agent marked are selectable on the stage. Tune lists
60
- them with the knobs it declared for each, a **Borrow** line for a part
61
- another look draws differently, plus a comment field. Presets
62
- save a set of tuned values in your browser.
63
- 4. **Send.** Everything above is a draft (it survives a reload) until one
64
- **Send**. A mock with a single variant and no questions gets **Accept /
65
- Revise / Drop** instead. The Send lands in the Thread as **Not seen yet**,
66
- then **Delivered** once the agent has it. If it isn't picked up, tell your
67
- agent you've answered.
68
- 5. **Revise.** The agent gets one reply (answers, tuned values, mix, comments)
69
- on its next write, its next `feedback` call, or from `mockpit watch` under a
70
- background monitor. It publishes the next version; the frame header's `v3 ▾` lists the history,
71
- and an older version opens under a banner with "restore as vN". Looks that
72
- lost are archived, not deleted.
73
-
74
- **Home** lists the project's mocks with a thumbnail, their states and how many
75
- questions are open, with "Answer next ›" to jump to the first one. Dark and
76
- light themes, toggled from the top bar. On a phone or an iPad in portrait the
77
- design is a canvas you pan and pinch, at each width the agent names (or one you
78
- pick: Phone 390, Tablet 744, Desktop 820, Wide 1280) side by side, and the
79
- questions float over it in a card you can snap to a corner, a side or the
80
- bottom, or tuck against an edge. On a desktop, Inspect opens the stage full
81
- screen to pan and pinch-zoom it.
82
-
83
- ## Quick start
84
-
85
- Requires Node 22.18 or newer.
24
+ ## Quickstart
25
+
26
+ Needs Node 22.18 or newer.
86
27
 
87
28
  ```sh
88
- git clone https://github.com/fabiogaliano/mockpit && cd mockpit
89
- npm install
90
- npm start # viewer on http://localhost:8228
91
- npm link # puts the `mockpit` CLI on your PATH
29
+ npm i -g mockpit
30
+ mockpit serve --open # http://localhost:8228
31
+ mockpit demo # seeds a sample design to click through
92
32
  ```
93
33
 
94
- Point your agent at it by pasting the setup block into its instructions:
34
+ Point your agent at it, once per repo:
95
35
 
96
36
  ```sh
97
37
  curl -s http://localhost:8228/setup >> AGENTS.md
38
+ mockpit init # reads the repo's tokens, fonts and kit
39
+ ```
40
+
41
+ Then ask it to "design this up on mockpit". Claude Code, Codex, OpenCode, Pi and MCP setup:
42
+ [docs/connecting-agents.md](docs/connecting-agents.md).
43
+
44
+ ## A turn
45
+
46
+ ```sh
47
+ mockpit publish --design writer --state Writing --variant quiet --html quiet.html
48
+ mockpit publish --design writer --state Writing --variant dark --html dark.html
49
+ mockpit ask --design writer "Quiet or dark?" --option Quiet=quiet --option Dark=dark
50
+ # the agent says where to look and stops. After your Send:
51
+ mockpit feedback
98
52
  ```
99
53
 
100
- Then run `mockpit init` once per repo and ask the agent to "mock this up on
101
- mockpit". No agent handy? `mockpit demo` seeds the Writer: one mock in four
102
- states and three looks, with questions, knobs and marked parts.
54
+ ## What you can do with an answer
103
55
 
104
- MCP, the Pi extension and the Claude Code plugin are covered in
105
- **[docs/connecting-agents.md](docs/connecting-agents.md)**.
56
+ - **Pick** from pictures. Hover to preview it on the stage.
57
+ - **Keep** runners-up. After Send they stay beside the design, one click from Use this instead.
58
+ - **Hide** what you don't want, with a reason if you like. The agent won't offer it again.
59
+ - **Ask for more** answers without sending the rest of your draft.
60
+ - **Save a set** of answers across questions, like Warm or Quiet, and switch between sets.
61
+ - **Tune** the knobs the agent declared, **borrow** a part from another variant, and
62
+ **comment** on any part.
106
63
 
107
- ## What a mock can show
64
+ Studio puts every variant side by side. Home groups a project's ideas, screens, flows and
65
+ components, and Needs you lists what's waiting on you.
108
66
 
109
- A version is an ordered list of **surfaces**, and one version can carry several.
110
- Html is what design mocks use and the only kind with parts and knobs; the others
111
- render the same way on the stage.
67
+ ## What it shows
68
+
69
+ Html with parts and knobs, plus markdown, diff, terminal, image, mermaid, json and code. All of
70
+ it renders in a sandboxed frame.
112
71
 
113
72
  <table>
114
73
  <tr>
115
- <td width="50%" valign="top">
116
- <img src="docs/surfaces/01-html.png" width="100%" alt="html surface">
117
- <p><b><code>html</code></b>: markup the agent authors, rendered in a sandbox and themed by your design system.</p>
118
- </td>
119
- <td width="50%" valign="top">
120
- <img src="docs/surfaces/02-markdown.png" width="100%" alt="markdown surface">
121
- <p><b><code>markdown</code></b>: prose, tables and fenced code.</p>
122
- </td>
123
- </tr>
124
- <tr>
125
- <td width="50%" valign="top">
126
- <img src="docs/surfaces/03-diff.png" width="100%" alt="diff surface">
127
- <p><b><code>diff</code></b>: a patch as a syntax-highlighted code review (unified or split).</p>
128
- </td>
129
- <td width="50%" valign="top">
130
- <img src="docs/surfaces/07-mermaid.png" width="100%" alt="mermaid surface">
131
- <p><b><code>mermaid</code></b>: diagram source rendered to SVG in the viewer palette.</p>
132
- </td>
74
+ <td width="50%"><img src="docs/surfaces/01-html.png" width="100%" alt="html surface"></td>
75
+ <td width="50%"><img src="docs/surfaces/03-diff.png" width="100%" alt="diff surface"></td>
133
76
  </tr>
134
77
  </table>
135
78
 
136
- There are also `terminal` (ANSI output), `image` (uploaded assets), `json`
137
- (collapsible tree) and `code` (shiki-highlighted source with line numbers).
138
-
139
- ## Agent verbs
140
-
141
- Nine verbs, the same on every tier with the same fields: a zero-dependency CLI
142
- for agents with only a shell, MCP over stdio or streamable HTTP at `/mcp`, and
143
- plain HTTP. None of them waits for the user.
144
-
145
- | CLI | MCP | HTTP |
146
- | --------------------- | -------------------- | -------------------------------------- |
147
- | `mockpit publish` | `publish` | `POST /api/mocks` |
148
- | `mockpit ask` | `ask` | `POST /api/mocks/:id/asks` |
149
- | `mockpit read [slug]` | `read` | `GET /api/mocks`, `GET /api/mocks/:id` |
150
- | `mockpit feedback` | `feedback` | `GET /api/feedback?session=…` |
151
- | `mockpit say` | `say` | `POST /api/mocks/:id/say` |
152
- | `mockpit export` | `export` | `GET /api/mocks/:id/export` |
153
- | `mockpit upload` | `upload` | `POST /api/assets` |
154
- | `mockpit guide` | `guide` | `GET /agent-howto` |
155
- | `mockpit run` | `run` (`?mode=code`) | `POST /api/run` |
156
-
157
- The CLI adds `mockpit init` (detect the repo's design system, once per repo)
158
- and `mockpit watch` (one line per Send, for a background monitor).
159
-
160
- - **`publish` is the one write.** It creates the mock, state or variant, or the
161
- next version of an existing one. Send `html`, the full ordered `surfaces`
162
- list (an entry that is only `{id}` keeps that surface), or `parts` to replace
163
- just the marked elements.
164
- - **`feedback` returns at once** with what the user sent since the agent last
165
- heard, plus `pending`: whether each mock is open in the viewer and how far the user's
166
- draft has got (`2 of 3 answered`). Every write returns `feedback` too, and
167
- each Send is delivered exactly once across all of them.
168
- - **Asks are nudged.** A publish that leaves several variants with no ask
169
- binding them returns a nudge and a ready `suggestedAsk`.
170
-
171
- A typical turn:
79
+ ## Agent side
172
80
 
173
- ```sh
174
- mockpit publish --mock writer --state "Writing" --variant quiet --html quiet.html
175
- mockpit publish --mock writer --state "Writing" --variant dark --html dark.html
176
- mockpit ask --mock writer "Which look?" --option Quiet=quiet --option Dark=dark
177
- # the agent says where to look and ends its turn; once you've answered:
178
- mockpit feedback
179
- ```
81
+ Eleven verbs, the same on the zero-dependency CLI, MCP (stdio, or HTTP at `/mcp`) and plain
82
+ HTTP: `publish`, `ask`, `read`, `feedback`, `say`, `move`, `edit`, `export`, `upload`,
83
+ `guide`, `run`. `mockpit watch` wakes a waiting agent on each Send.
84
+
85
+ Agents read a short brief before their first publish (`/agent-howto`). Add your own taste in
86
+ `~/.mockpit/rules.md`, or per repo in `.mockpit/rules.md`.
87
+ [`examples/rules.md`](examples/rules.md) is one.
88
+
89
+ ## Where it runs
180
90
 
181
- The running server serves the brief at `/agent-howto`: one short, project-aware
182
- document an agent reads before its first publish. Reference topics (`knobs`,
183
- `asks`, `surfaces`, `html`, `reply`, `http`, `scripts`) are at
184
- `/agent-howto?topic=<id>`; `/guide` is the `html` topic. `run` executes one
185
- script against the same verbs on the server, so publishing variants and asking
186
- take one call; `/mcp?mode=code` serves it as the only tool, for connectors
187
- without a codemode of their own.
188
-
189
- ## Run it anywhere
190
-
191
- It runs locally as a small Node server (SQLite at `~/.mockpit/mockpit.db`), or on
192
- Cloudflare Workers when your agent and browser are on different machines. See
193
- **[docs/deploying.md](docs/deploying.md)**.
194
-
195
- The server keeps an event log, one JSON line per agent call, viewer write and
196
- live-feed connection (ids and shapes, never content), at
197
- `~/.mockpit/events.jsonl` next to the database. It rolls over at 10 MB. Set
198
- `MOCKPIT_LOG` to another path, or to `off` to disable it; on Workers it goes to
199
- Workers Logs. `node scripts/inspect.ts` in a checkout reads it alongside the
200
- database and Claude Code transcripts.
201
-
202
- The server app is importable from `mockpit/server` (`createApp`, `SqlStore`,
203
- `createSqliteStorage`). The embeddable viewer engine (`mockpit/viewer-embed`,
204
- `mountViewer`) is gone: the viewer is self-hosted only.
205
-
206
- ## Migrating from 0.x
207
-
208
- - **SQLite workspaces migrate in place on first boot.** Each item becomes a
209
- single-state mock with its variants and version history; comments keep their
210
- ids and sequence numbers, so agents' feedback cursors carry over. Comments a
211
- user was still drafting become the mock's draft. Deployed Durable Objects
212
- migrate the same way.
213
- - **The JSON store is gone.** If you run with `MOCKPIT_STORE=json`, start your
214
- current version once without it **before upgrading**:
215
- `env -u MOCKPIT_STORE mockpit serve` (keep `MOCKPIT_DATA`/`MOCKPIT_DB` if you
216
- set them). That first SQLite boot copies `~/.mockpit/mockpit.json` into
217
- `~/.mockpit/mockpit.db`, as long as the database is still empty; then upgrade.
218
- The JSON file is left untouched either way.
219
- - **`--item` is now `--mock`** (`mockpit publish --mock <slug> --state <s>
220
- --variant <v>`), and the MCP tools are named by verb (`publish`, `ask`,
221
- `read`, `feedback`, `say`, `export`, `upload`, `guide`).
222
- - **Removed:** the item, post, snippet and session-page routes
223
- (`/api/projects/:name/items`, `/api/posts`, `/api/surfaces`, `/api/snippets`,
224
- `/session/:id`, `/p/:id`), `?part=`, the item/post MCP tools and their
225
- deprecated aliases (`publish_item`, `publish_post`, `publish_surface`, …), the
226
- CLI's `page`, `list`, `sessions`, `update`, per-kind shortcuts (`markdown`,
227
- `diff`, …), `test-post` and `trace*` commands, the github/gruvbox/one themes
228
- and the embed engine. Agents should re-fetch `/agent-howto`; refresh pasted
229
- setup blocks from `/setup`.
91
+ Locally, a small Node server with SQLite at `~/.mockpit/mockpit.db`. When the agent and browser
92
+ are on different machines, deploy it to Cloudflare Workers: [docs/deploying.md](docs/deploying.md).
230
93
 
231
94
  ## Development
232
95
 
233
96
  ```sh
234
- npm run dev # server with watch + viewer watch build
235
- npm test # Node unit/API/store tests + viewer unit tests
236
- npm run test:worker # local workerd + Durable Object integration
237
- npm run typecheck # node + workers + viewer
238
- npm run lint # oxlint
239
- npm run format # oxfmt
240
- npm run test:e2e # Playwright, chromium + webkit (bridge, mock screen, decide flow)
97
+ git clone https://github.com/fabiogaliano/mockpit && cd mockpit
98
+ npm install
99
+ npm run dev # server + viewer watch build
100
+ npm run typecheck && npm run lint && npm run format:check
241
101
  ```
242
102
 
243
- The architecture and contributor rules are in [AGENTS.md](AGENTS.md).
103
+ Architecture and rules: [AGENTS.md](AGENTS.md).
104
+
105
+ ## Credits
244
106
 
245
- ## License
107
+ A fork of [sideshow](https://github.com/modem-dev/sideshow) by
108
+ [Ben Vinegar](https://github.com/benvinegar), sponsored by [Modem](https://modem.dev). The
109
+ renderer, sandboxing, agent tiers and Cloudflare deploy started there.
246
110
 
247
111
  [MIT](LICENSE). The original sideshow copyright is retained.
package/bin/demoData.js CHANGED
@@ -1,5 +1,5 @@
1
- // Seed content for `mockpit demo`: the Writer mock — four states of one
2
- // writing app, each drawn in three looks, with its parts marked so the viewer
1
+ // Seed content for `mockpit demo`: the Writer design — four states of one
2
+ // writing app, each drawn in three variants, with its parts marked so the viewer
3
3
  // can show questions, tuning and part comments. Dependency-free like the CLI.
4
4
 
5
5
  const LOOKS = {
@@ -101,9 +101,9 @@ export const DEMO = {
101
101
  },
102
102
  asks: [
103
103
  {
104
- id: "look",
105
- text: "Which look?",
106
- scope: "mock",
104
+ id: "tone",
105
+ text: "Quiet, dark or editorial?",
106
+ scope: "design",
107
107
  options: [
108
108
  { label: "Quiet", variant: "quiet" },
109
109
  { label: "Dark", variant: "dark" },
package/bin/initDesign.js CHANGED
@@ -4,7 +4,7 @@
4
4
  //
5
5
  // The point of this file is that the agent never assembles a design set by
6
6
  // hand: init reads what the repo already declares (Tailwind, shadcn, a `:root`
7
- // token block, fonts), turns it into the project's DesignSettings, and writes a
7
+ // token block, fonts), turns it into the project's DesignSystem, and writes a
8
8
  // starter file the agent copies from. Everything here is deterministic — no
9
9
  // model in the loop.
10
10
 
@@ -257,11 +257,11 @@ function hasTailwind(cwd) {
257
257
  }
258
258
 
259
259
  /**
260
- * Inspect a repo and derive the project's DesignSettings inputs.
260
+ * Inspect a repo and derive the project's DesignSystem inputs.
261
261
  * Never throws on a hostile/odd tree — an undetectable repo returns the
262
262
  * builtin kit with no palette, which is a perfectly good starting point.
263
263
  */
264
- export async function detectDesign(cwd) {
264
+ export async function detectDesignSystem(cwd) {
265
265
  const { paletteFromCssVars } = await loadThemes();
266
266
  const budget = { left: MAX_FILES };
267
267
  const cssFiles = findCssFiles(cwd, budget);
@@ -818,13 +818,13 @@ const STARTER_TOKENS = [
818
818
  * tokens, and one icon in use. `iconSets` are the prefixes the server resolves
819
819
  * for this project.
820
820
  */
821
- export function renderStarter(design, iconSets = ["lucide", "mage"]) {
822
- const kit = design?.kit ?? "builtin";
821
+ export function renderStarter(designSystem, iconSets = ["lucide", "mage"]) {
822
+ const kit = designSystem?.kit ?? "builtin";
823
823
  const bodies = { tailwind: TAILWIND_BODY, basecoat: BASECOAT_BODY };
824
824
  const body = (bodies[kit] ?? BUILTIN_BODY).replace("ICON_SLOT", '<i icon="lucide:check"></i>');
825
825
  // Show the tokens an agent reaches for first. A repo's block is usually led
826
826
  // by sizing/easing tokens, so surface the semantic colors ahead of them.
827
- const props = customProps(design?.cssVars ?? "");
827
+ const props = customProps(designSystem?.cssVars ?? "");
828
828
  const rank = (name) => {
829
829
  const i = STARTER_TOKENS.indexOf(name);
830
830
  return i === -1 ? STARTER_TOKENS.length : i;