uisandbox-mcp 0.3.1 → 0.3.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.
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>UISandbox — Play with your real app's design, live</title>
7
- <meta name="description" content="Play with your real app's design, live: drop the build, turn the knobs — brand, colours, fonts, spacing, radius — watch it follow 1:1, export the change as a patch or tokens. In your browser or via MCP. Free, open source, nothing leaves your tab." />
6
+ <title>UISandbox · Play with your real app's design, live</title>
7
+ <meta name="description" content="Play with your real app's design, live: drop the build, turn the knobs (brand, colours, fonts, spacing, radius), watch it follow 1:1, export the change as a patch or tokens. In your browser or via MCP. Free, open source, your files never leave your browser." />
8
8
  <link rel="canonical" href="https://uisandbox.org/" />
9
9
  <meta name="theme-color" content="#18191d" />
10
10
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
@@ -19,15 +19,15 @@
19
19
  <meta property="og:type" content="website" />
20
20
  <meta property="og:site_name" content="UISandbox" />
21
21
  <meta property="og:url" content="https://uisandbox.org/" />
22
- <meta property="og:title" content="UISandbox — Play with your real app's design, live" />
23
- <meta property="og:description" content="Drop the build, turn the knobs, watch the real app follow 1:1, export the patch. In your browser or via MCP. Free, open source (MIT), nothing leaves your tab." />
22
+ <meta property="og:title" content="UISandbox · Play with your real app's design, live" />
23
+ <meta property="og:description" content="Drop the build, turn the knobs, watch the real app follow 1:1, export the patch. In your browser or via MCP. Free, open source (MIT), your files never leave your browser." />
24
24
  <meta property="og:image" content="https://uisandbox.org/og.png" />
25
25
  <meta property="og:image:width" content="1200" />
26
26
  <meta property="og:image:height" content="630" />
27
27
  <meta property="og:image:alt" content="UISandbox: a real web app in a sandbox with the knobs beside it" />
28
28
  <meta name="twitter:card" content="summary_large_image" />
29
- <meta name="twitter:title" content="UISandbox — Play with your real app's design, live" />
30
- <meta name="twitter:description" content="Drop the build, turn the knobs, watch the real app follow 1:1, export the patch. In your browser or via MCP. Free, open source (MIT), nothing leaves your tab." />
29
+ <meta name="twitter:title" content="UISandbox · Play with your real app's design, live" />
30
+ <meta name="twitter:description" content="Drop the build, turn the knobs, watch the real app follow 1:1, export the patch. In your browser or via MCP. Free, open source (MIT), your files never leave your browser." />
31
31
  <meta name="twitter:image" content="https://uisandbox.org/og.png" />
32
32
  <!-- Structured data -->
33
33
  <script type="application/ld+json">
@@ -52,15 +52,15 @@
52
52
  "Every CSS literal becomes a variable holding the same value; knobs move your own values",
53
53
  "Knobs: brand and the colour families your CSS contains, background, fonts, text size, line height, letter spacing, weight, spacing, radius, border width, elevation, motion, gradient angle, hue, saturation, contrast, your dark mode",
54
54
  "Export: CSS, JSON, patch, patched files, design tokens (CSS, Tailwind, shadcn), Swift and Android constants",
55
- "Nothing leaves the tab: files are read in the page and served to the frame by a service worker",
55
+ "Your files never leave your browser: they are read in the page and served to the frame by a service worker",
56
56
  "Load by URL for agents: /?load=<zip-url>"
57
57
  ]
58
58
  }
59
59
  </script>
60
60
  <link rel="preconnect" href="https://fonts.googleapis.com" />
61
61
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
62
- <script type="module" crossorigin src="/assets/index-Bj469ZCA.js"></script>
63
- <link rel="stylesheet" crossorigin href="/assets/index-BoluCeWz.css">
62
+ <script type="module" crossorigin src="/assets/index-J6HcqYP4.js"></script>
63
+ <link rel="stylesheet" crossorigin href="/assets/index-DTKomyUq.css">
64
64
  </head>
65
65
  <body>
66
66
  <style>
@@ -87,11 +87,11 @@
87
87
  <div class="m"></div>
88
88
  <div class="k">Test your design on the real thing</div>
89
89
  <h1>Play with your real<br>app's design, live.</h1>
90
- <p class="s">Drop your built web app — in your browser or from your agent via MCP. Every colour, font, radius and spacing in its CSS becomes a knob; turn them, watch the real app follow 1:1, and export the change as a patch or tokens.</p>
90
+ <p class="s">Drop your built web app, in your browser or straight from your agent via MCP. Every colour, font, radius and spacing in its CSS becomes a knob; turn them, watch the real app follow 1:1, and export the change as a patch or tokens.</p>
91
91
  <div class="i"></div>
92
- <p class="k" style="text-transform:none;letter-spacing:0;font-size:12.5px;margin:-16px 0 28px">✓ Free · ✓ Open source (MIT) · ✓ Nothing leaves your tab</p>
92
+ <p class="k" style="text-transform:none;letter-spacing:0;font-size:12.5px;margin:-16px 0 28px">✓ Free · ✓ Open source (MIT) · ✓ Your files never leave your browser</p>
93
93
  <div class="c">
94
- <p>Drop the <b>built</b> site — its <code>dist/</code>, <code>build/</code> or <code>out/</code> folder, a zip, or a public GitHub repo. It renders 1:1 in the browser; nothing is uploaded (files are read in the page and served to the frame by a service worker on this origin).</p>
94
+ <p>Drop the <b>built</b> site: its <code>dist/</code>, <code>build/</code> or <code>out/</code> folder, a zip, or a public GitHub or GitLab repo. It renders 1:1 in the browser; nothing is uploaded (files are read in the page and served to the frame by a service worker on this origin).</p>
95
95
  <p>Knobs: brand and the colour families your CSS contains, background, fonts, text size, line height, letter spacing, weight, spacing, radius, border width, elevation, motion, gradient angle, hue, saturation, contrast, your dark mode. Export: CSS, JSON, a patch, your files patched, design tokens, Swift and Android constants. Free, MIT. <a href="https://github.com/AlexanderKaan/uisandbox">Source</a> · <a href="/llms.txt">llms.txt</a> · <a href="https://www.npmjs.com/package/uisandbox-mcp">MCP server</a></p>
96
96
  </div>
97
97
  <noscript><p style="margin-top:16px">UISandbox needs JavaScript and a browser with service workers.</p></noscript>
@@ -1,6 +1,6 @@
1
1
  # UISandbox
2
2
 
3
- > Play with your real app's design, live — test your design on the real thing. Restyle your app without rebuilding it. Drop a built web app (its dist/, build/ or out/ folder as a zip or folder), see it 1:1 in the browser, turn the knobs — brand, colour families, background, fonts, text size, line height, letter spacing, weight, spacing, radius, border width, elevation, motion, gradient angle, hue, saturation, contrast, dark mode — and export exactly what you see. Free, open source (MIT). Nothing leaves the tab.
3
+ > Play with your real app's design, live — test your design on the real thing. Restyle your app without rebuilding it. Drop a built web app (its dist/, build/ or out/ folder as a zip or folder), see it 1:1 in the browser, turn the knobs — brand, colour families, background, fonts, text size, line height, letter spacing, weight, spacing, radius, border width, elevation, motion, gradient angle, hue, saturation, contrast, dark mode — and export exactly what you see. Free, open source (MIT). Your files never leave your browser.
4
4
 
5
5
  Site: https://uisandbox.org/ · Source: https://github.com/AlexanderKaan/uisandbox · Author: Alexander Kaan (Pageminds)
6
6
 
@@ -16,7 +16,7 @@ Site: https://uisandbox.org/ · Source: https://github.com/AlexanderKaan/uisandb
16
16
 
17
17
  - It does not render iOS/Android apps (no browser can); it exports Swift/Android constants from the knobs instead.
18
18
  - It does not render source repositories — a build is needed (npm run build → dist/). Source is audited for the knob stand only.
19
- - It does not upload anything: files are read in the page and served to a sandbox frame by a service worker on the same origin.
19
+ - It does not upload anything: files are read in the page and served to a sandbox frame by a service worker on the same origin. No account, no cookies, no analytics. Verifiable: the page keeps working with the network off, and the network tab stays quiet while you drop, turn knobs and export.
20
20
 
21
21
  ## How honesty is enforced
22
22
 
@@ -26,7 +26,7 @@ Site: https://uisandbox.org/ · Source: https://github.com/AlexanderKaan/uisandb
26
26
 
27
27
  ## For agents
28
28
 
29
- - Load by link — any agent can say this to a user: `https://uisandbox.org/?load=https://github.com/user/repo` (a public repo; its default branch — or `/tree/branch` — is fetched as a zip through the site's own route; the build must be inside the repo, e.g. a gh-pages branch), or `?load=<zip-url>` for a zip the browser may fetch (CORS).
29
+ - Load by link — any agent can say this to a user: `https://uisandbox.org/?load=https://github.com/user/repo` (a public GitHub or GitLab repo; its default branch — or `/tree/branch` — is fetched as a zip through the site's own route; the build must be inside the repo, e.g. a gh-pages branch), or `?load=<zip-url>` for a zip the browser may fetch (CORS).
30
30
  - Claude Code plugin: `/plugin marketplace add AlexanderKaan/uisandbox` → `/plugin install uisandbox@uisandbox` (skill + MCP server).
31
31
  - In Claude Code / Claude Desktop / Cursor with the MCP server: say "open this app in UISandbox" — the agent builds the app, loads it and opens the real sandbox in the browser (`open`), and can export what you turned afterwards (`state` → `export`). Prompts `/uisandbox:open` and `/uisandbox:try` exist where the client shows MCP prompts.
32
32
  - MCP server (stdio, same engine): tools `open` (the real sandbox in the user's browser, served locally), `state`, `load` (zip URL/path), `screens`, `set` (knobs), `export` (sheet-css, sheet-json, patch, tokens-css, tokens-json, tailwind, shadcn, swift, android-xml, android-kotlin), `verify` (the 1:1 check in headless Chromium), `screenshot`. Install: `npx -y uisandbox-mcp` (npm: https://www.npmjs.com/package/uisandbox-mcp); config and a prompt to paste: https://github.com/AlexanderKaan/uisandbox/blob/main/mcp/README.md
@@ -59,12 +59,12 @@ Restyle your app without rebuilding it — drop the build, turn the knobs, watch
59
59
  <p align="center">
60
60
  <img alt="MIT" src="https://img.shields.io/badge/license-MIT-black">
61
61
  <img alt="npm" src="https://img.shields.io/npm/v/uisandbox-mcp?label=uisandbox-mcp&color=black">
62
- <img alt="nothing leaves your tab" src="https://img.shields.io/badge/nothing%20leaves-your%20tab-black">
62
+ <img alt="your files never leave your browser" src="https://img.shields.io/badge/files%20never%20leave-your%20browser-black">
63
63
  <img alt="1:1 measured" src="https://img.shields.io/badge/1%3A1-measured%2C%20not%20promised-black">
64
64
  </p>
65
65
 
66
66
  ```bash
67
- npx uisandbox-mcp open ./dist # the sandbox opens in your browser with your build — no agent needed
67
+ npx uisandbox-mcp open # run inside your project: it finds the build and opens the sandbox — no agent needed
68
68
  ```
69
69
 
70
70
  Or drop a zip on **[uisandbox.org](https://uisandbox.org)**. Or, in Claude Code: `/plugin marketplace add AlexanderKaan/uisandbox` → `/plugin install uisandbox@uisandbox` and say *"open this app in UISandbox"*.
@@ -73,7 +73,7 @@ Or drop a zip on **[uisandbox.org](https://uisandbox.org)**. Or, in Claude Code:
73
73
 
74
74
  ## What it does
75
75
 
76
- 1. **Bring the build** — three ways in: a zip of `dist/`, `build/`, `out/` (or a whole repo with the build inside); a folder (a build renders, a source folder is read for the knob stand); a public GitHub repo URL (fetched as a zip through a same-origin route — the one thing that leaves the tab, see [`notes/security.md`](notes/security.md)). While it works, the door shows the stages with their numbers. Otherwise nothing leaves the tab: files are read in the page and served to the frame by a service worker on this origin.
76
+ 1. **Bring the build** — three ways in: a zip of `dist/`, `build/`, `out/` (or a whole repo with the build inside); a folder (a build renders, a source folder is read for the knob stand); a public GitHub or GitLab repo URL (fetched as a zip through a same-origin route — the one thing that leaves the tab, see [`notes/security.md`](notes/security.md)). While it works, the door shows the stages with their numbers. Otherwise your files never leave your browser: files are read in the page and served to the frame by a service worker on this origin.
77
77
  2. **See it 1:1.** Every colour, radius, font, size, spacing, line-height, letter-spacing, weight, border-width, duration, gradient angle and shadow literal in your CSS becomes a variable holding the very same value, so the page renders exactly as it was — runtime styles too (`style=""` set by JS, `<style>` your framework appends, `insertRule`/`replaceSync` from styled-components, Emotion, Lit, Ant's cssinjs; CDN stylesheets through a same-origin proxy; nested same-origin frames such as Storybook's).
78
78
  3. **Turn the knobs.** Brand, and the colour families your CSS actually contains (secondary, accent, the status set, a palette row for what is neither); page background; grey tint and border tone; display and body font (yours listed first, then alternatives by character); dials for text size, line height, letter spacing, weight, spacing, radius, border width, elevation, motion and gradient angle — every dial with **×1 = as in your code** at its centre; global hue, saturation and contrast that reach every colour, chart palettes and CSS-drawn icons included; your dark mode, switched on your own hooks.
79
79
  4. **Export.** Your values as CSS / JSON / a patch list, your files patched in place, `--k-*` tokens for web (CSS, Tailwind, shadcn), Swift constants + an asset catalog for iOS, `colors.xml` + Kotlin for Android.
package/dist/app/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # UISandbox
2
2
 
3
- > Play with your real app's design, live — test your design on the real thing. Restyle your app without rebuilding it. Drop a built web app (its dist/, build/ or out/ folder as a zip or folder), see it 1:1 in the browser, turn the knobs — brand, colour families, background, fonts, text size, line height, letter spacing, weight, spacing, radius, border width, elevation, motion, gradient angle, hue, saturation, contrast, dark mode — and export exactly what you see. Free, open source (MIT). Nothing leaves the tab.
3
+ > Play with your real app's design, live — test your design on the real thing. Restyle your app without rebuilding it. Drop a built web app (its dist/, build/ or out/ folder as a zip or folder), see it 1:1 in the browser, turn the knobs — brand, colour families, background, fonts, text size, line height, letter spacing, weight, spacing, radius, border width, elevation, motion, gradient angle, hue, saturation, contrast, dark mode — and export exactly what you see. Free, open source (MIT). Your files never leave your browser.
4
4
 
5
5
  Site: https://uisandbox.org/ · Source: https://github.com/AlexanderKaan/uisandbox · Author: Alexander Kaan (Pageminds)
6
6
 
@@ -16,7 +16,7 @@ Site: https://uisandbox.org/ · Source: https://github.com/AlexanderKaan/uisandb
16
16
 
17
17
  - It does not render iOS/Android apps (no browser can); it exports Swift/Android constants from the knobs instead.
18
18
  - It does not render source repositories — a build is needed (npm run build → dist/). Source is audited for the knob stand only.
19
- - It does not upload anything: files are read in the page and served to a sandbox frame by a service worker on the same origin.
19
+ - It does not upload anything: files are read in the page and served to a sandbox frame by a service worker on the same origin. No account, no cookies, no analytics. Verifiable: the page keeps working with the network off, and the network tab stays quiet while you drop, turn knobs and export.
20
20
 
21
21
  ## How honesty is enforced
22
22
 
@@ -26,7 +26,7 @@ Site: https://uisandbox.org/ · Source: https://github.com/AlexanderKaan/uisandb
26
26
 
27
27
  ## For agents
28
28
 
29
- - Load by link — any agent can say this to a user: `https://uisandbox.org/?load=https://github.com/user/repo` (a public repo; its default branch — or `/tree/branch` — is fetched as a zip through the site's own route; the build must be inside the repo, e.g. a gh-pages branch), or `?load=<zip-url>` for a zip the browser may fetch (CORS).
29
+ - Load by link — any agent can say this to a user: `https://uisandbox.org/?load=https://github.com/user/repo` (a public GitHub or GitLab repo; its default branch — or `/tree/branch` — is fetched as a zip through the site's own route; the build must be inside the repo, e.g. a gh-pages branch), or `?load=<zip-url>` for a zip the browser may fetch (CORS).
30
30
  - Claude Code plugin: `/plugin marketplace add AlexanderKaan/uisandbox` → `/plugin install uisandbox@uisandbox` (skill + MCP server).
31
31
  - In Claude Code / Claude Desktop / Cursor with the MCP server: say "open this app in UISandbox" — the agent builds the app, loads it and opens the real sandbox in the browser (`open`), and can export what you turned afterwards (`state` → `export`). Prompts `/uisandbox:open` and `/uisandbox:try` exist where the client shows MCP prompts.
32
32
  - MCP server (stdio, same engine): tools `open` (the real sandbox in the user's browser, served locally), `state`, `load` (zip URL/path), `screens`, `set` (knobs), `export` (sheet-css, sheet-json, patch, tokens-css, tokens-json, tailwind, shadcn, swift, android-xml, android-kotlin), `verify` (the 1:1 check in headless Chromium), `screenshot`. Install: `npx -y uisandbox-mcp` (npm: https://www.npmjs.com/package/uisandbox-mcp); config and a prompt to paste: https://github.com/AlexanderKaan/uisandbox/blob/main/mcp/README.md
package/dist/app/og.png CHANGED
Binary file
package/dist/server.mjs CHANGED
@@ -4079,14 +4079,30 @@ var LENGTH = /(?<![\w.#-])(-?\d*\.?\d+)(px|rem|em)(?![\w%])/g;
4079
4079
  var HEX = /#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3,4})\b/gi;
4080
4080
  var FUNC_COLOR = /\b(?:rgba?|hsla?|hwb|oklch|oklab|lch|lab|color)\((?:[^()]|\([^()]*\))*\)/gi;
4081
4081
  var NAMED = /(?<![\w-])([a-z]{3,20})(?![\w-])/gi;
4082
- /** Mask strings and url() so nothing inside them is ever matched. */
4082
+ /** Mask strings and url() so nothing inside them is ever matched — and the
4083
+ * functions Chromium does not know (`-moz-linear-gradient(`, `-o-…(`, `-ms-…(`):
4084
+ * a declaration holding one is dropped AT PARSE TIME, so the earlier
4085
+ * `-webkit-gradient(` declaration wins; with a var() inside, the same
4086
+ * declaration parses, wins the cascade, and only fails at computed-value
4087
+ * time — background gone (video.js, Ace: the 2011 three-vendor gradient
4088
+ * stack). Left untouched, it stays as dead as it was. */
4089
+ var DEAD_FN = /^-(moz|o|ms)-[a-z-]*\(/i;
4083
4090
  function masked(value) {
4084
4091
  let out = "";
4085
4092
  let i = 0;
4086
4093
  const n = value.length;
4087
4094
  while (i < n) {
4088
4095
  const c = value[i];
4089
- if (c === "\"" || c === "'") {
4096
+ if (c === "-" && DEAD_FN.test(value.slice(i, i + 40))) {
4097
+ let depth = 0, j = i;
4098
+ for (; j < n; j++) if (value[j] === "(") depth++;
4099
+ else if (value[j] === ")") {
4100
+ depth--;
4101
+ if (depth === 0) break;
4102
+ }
4103
+ out += " ".repeat(Math.min(j + 1, n) - i);
4104
+ i = Math.min(j + 1, n);
4105
+ } else if (c === "\"" || c === "'") {
4090
4106
  const q = c;
4091
4107
  let j = i + 1;
4092
4108
  while (j < n && value[j] !== q) {
@@ -4297,6 +4313,7 @@ function splicesFor(prop, value) {
4297
4313
  const bare = m.trim().toLowerCase();
4298
4314
  const svgs = /data:image\/svg\+xml/i.test(value) ? findSvgUrls(value) : [];
4299
4315
  if (KEYWORD_ONLY.test(bare)) return [];
4316
+ if (/(^|[\s,(])-(moz|o|ms)-[a-z-]*\(/i.test(value)) return [];
4300
4317
  if (/(^|[\s,/(])(inherit|initial|unset|revert|revert-layer)(?=$|[\s,/)])/i.test(bare)) return [];
4301
4318
  if (bare.startsWith("var(") && !/,/.test(bare)) return [];
4302
4319
  if (prop.startsWith("--")) {
@@ -4505,7 +4522,13 @@ function detectPlatform(paths, hasIndexHtml, texts = []) {
4505
4522
  const pkg = texts.find((t) => /(^|\/)package\.json$/.test(t.path))?.head ?? "";
4506
4523
  const wpTheme = texts.some((t) => /(^|\/)style\.css$/.test(t.path) && /Theme Name:/i.test(t.head)) || has(paths, /(^|\/)(functions\.php|theme\.json)$/) && has(paths, /\.php$/);
4507
4524
  const electron = /"electron"/.test(pkg);
4508
- if (hasIndexHtml && !wpTheme) {
4525
+ const pages = texts.filter((t) => /\.html?$/i.test(t.path));
4526
+ const DEV_ENTRY = /<script[^>]+type=["']module["'][^>]*\ssrc=["'](?:\.?\/)?(?:src|app|client|source)\/[^"']+\.(?:[cm]?[jt]sx?|vue|svelte)["']/i;
4527
+ const allTemplates = pages.length > 0 && pages.every((t) => DEV_ENTRY.test(t.head) || /<script[^>]+src=["'][^"']*flutter(_bootstrap)?\.js["']/i.test(t.head) && !has(paths, /(^|\/)(main\.dart\.js|flutter_service_worker\.js|flutter_bootstrap\.js)$/));
4528
+ const viteSource = allTemplates && pages.some((t) => DEV_ENTRY.test(t.head));
4529
+ const flutterSource = has(paths, /(^|\/)pubspec\.yaml$/) && !has(paths, /(^|\/)(main\.dart\.js|flutter_service_worker\.js|flutter_bootstrap\.js)$/) && (!hasIndexHtml || allTemplates || pages.length > 0 && pages.every((t) => /(^|\/)web\/[^/]+\.html?$/i.test(t.path) || DEV_ENTRY.test(t.head)));
4530
+ const expoSource = texts.some((t) => /(^|\/)app\.json$/.test(t.path) && /"expo"\s*:/.test(t.head)) && /"react-native"/.test(pkg) && (allTemplates || !hasIndexHtml);
4531
+ if (hasIndexHtml && !wpTheme && !flutterSource && !expoSource && !viteSource) {
4509
4532
  if (electron) return {
4510
4533
  kind: "electron",
4511
4534
  label: "Electron (web renderer)",
@@ -4519,6 +4542,24 @@ function detectPlatform(paths, hasIndexHtml, texts = []) {
4519
4542
  renders: true
4520
4543
  };
4521
4544
  }
4545
+ if (expoSource) return {
4546
+ kind: "react-native",
4547
+ label: "React Native / Expo",
4548
+ evidence: ["app.json with expo, react-native in package.json"],
4549
+ renders: false
4550
+ };
4551
+ if (flutterSource) return {
4552
+ kind: "flutter",
4553
+ label: "Flutter (Dart)",
4554
+ evidence: [`${count(paths, /\.dart$/)} Dart files`, "web/index.html is the build template"],
4555
+ renders: false
4556
+ };
4557
+ if (viteSource) return {
4558
+ kind: "web-source",
4559
+ label: "Web source (dev entry, no build)",
4560
+ evidence: [`index.html loads ${pages.find((t) => DEV_ENTRY.test(t.head)).head.match(DEV_ENTRY)[0].match(/src=["']([^"']+)/)[1]} — a dev entry, not a build`],
4561
+ renders: false
4562
+ };
4522
4563
  if (has(paths, /\.xcodeproj\/|(^|\/)Package\.swift$|\.xcassets\//) || count(paths, /\.swift$/) > 3) {
4523
4564
  ev.push(`${count(paths, /\.swift$/)} Swift files`, `${count(paths, /\.colorset\/Contents\.json$/)} colour sets`);
4524
4565
  if (!has(paths, /pubspec\.yaml$/)) return {
@@ -4587,11 +4628,12 @@ function refusalFor(p, detail) {
4587
4628
  switch (p.kind) {
4588
4629
  case "ios": return `This is an iOS/macOS project (${p.evidence.join(", ")}). No browser can render SwiftUI or UIKit, so the sandbox cannot show it 1:1 — and it will not show you a look-alike. Drop a BUILT web app instead — its dist/, build/ or out/ folder with an index.html — and it renders exactly as deployed.`;
4589
4630
  case "android": return `This is an Android project (${p.evidence.join(", ")}). Compose and XML layouts have no browser render, so the sandbox cannot show it 1:1. Drop a BUILT web app instead — its dist/, build/ or out/ folder with an index.html — and it renders exactly as deployed.`;
4590
- case "flutter": return `This is a Flutter project. A Flutter WEB build (\`flutter build web\` → build/web/) renders here; the Dart source alone cannot.`;
4631
+ case "flutter": return `This is a Flutter project (${p.evidence.join(", ")}). A Flutter WEB build renders here — run \`flutter build web\` and drop build/web/; the Dart source alone cannot.`;
4632
+ case "react-native": return `This is a React Native / Expo project (${p.evidence.join(", ")}). Native views have no browser render; a WEB export does — run \`npx expo export -p web\` (or \`expo build:web\`) and drop the dist/ folder.`;
4591
4633
  case "qt": return "This is a Qt/QML project. There is no browser render for QML, so the sandbox cannot show it 1:1. Drop a BUILT web app instead — its dist/, build/ or out/ folder with an index.html — and it renders exactly as deployed.";
4592
4634
  case "kivy": return "This is a Kivy (Python) project. There is no browser render for kv layouts, so the sandbox cannot show it 1:1. Drop a BUILT web app instead — its dist/, build/ or out/ folder with an index.html — and it renders exactly as deployed.";
4593
4635
  case "python-gui": return "This looks like a Python project without a web build. The sandbox renders web builds only. Drop a BUILT web app instead — its dist/, build/ or out/ folder with an index.html — and it renders exactly as deployed.";
4594
- case "web-source": return `This is web SOURCE without a built page (${p.evidence.join(", ")}). Build it first — \`npm run build\`, or for a WordPress theme a static export of the site — then drop the output folder.`;
4636
+ case "web-source": return `This is web SOURCE without a built page (${p.evidence.join(", ")}). Build it first — \`npm run build\`, or for a WordPress theme a static export of the site — then drop the output folder (dist/, build/ or out/).`;
4595
4637
  case "unknown": return `No index.html and nothing the sandbox can render was found in these ${detail.files} files. Drop a BUILT web app instead — its dist/, build/ or out/ folder with an index.html — and it renders exactly as deployed.`;
4596
4638
  default: return "This archive has no page the sandbox can open. Drop a BUILT web app instead — its dist/, build/ or out/ folder with an index.html — and it renders exactly as deployed.";
4597
4639
  }
@@ -4708,12 +4750,22 @@ var newId = () => `p${Date.now().toString(36)}${(seq$1++).toString(36)}`;
4708
4750
  async function buildProject(archive, opts = {}) {
4709
4751
  const paths = archive.entries.map((e) => e.path);
4710
4752
  const heads = [];
4711
- for (const e of archive.entries) if (/(^|\/)(package\.json|style\.css)$/.test(e.path) && e.size < 2e5) {
4753
+ let pagesRead = 0;
4754
+ for (const e of archive.entries) if (/(^|\/)(package\.json|style\.css|app\.json|pubspec\.yaml)$/.test(e.path) && e.size < 2e5) {
4712
4755
  const t = await archive.readText(e);
4713
4756
  if (t) heads.push({
4714
4757
  path: e.path,
4715
4758
  head: t.slice(0, 2e3)
4716
4759
  });
4760
+ } else if (/\.html?$/i.test(e.path) && e.size < 2e5 && pagesRead < 80 && !/(^|\/)node_modules\//.test(e.path)) {
4761
+ const t = await archive.readText(e);
4762
+ if (t) {
4763
+ heads.push({
4764
+ path: e.path,
4765
+ head: t.slice(0, 4e3)
4766
+ });
4767
+ pagesRead++;
4768
+ }
4717
4769
  }
4718
4770
  const anyPage = paths.some((p) => /\.html?$/i.test(p) && !/(^|\/)(node_modules|tests?|__tests__|mocks?)\//i.test(p));
4719
4771
  const early = detectPlatform(paths, anyPage, heads);
@@ -8965,7 +9017,7 @@ async function zipFolder(dir) {
8965
9017
  const files = [];
8966
9018
  const walk = (d) => {
8967
9019
  for (const e of readdirSync(d)) {
8968
- if (e === "node_modules" || e === ".git") continue;
9020
+ if (e === "node_modules" || e === ".git" || e === ".DS_Store" || e === ".cache") continue;
8969
9021
  const f = join(d, e);
8970
9022
  if (statSync(f).isDirectory()) walk(f);
8971
9023
  else files.push(f);
@@ -9129,7 +9181,7 @@ var summarise = (p) => {
9129
9181
  };
9130
9182
  var server = new McpServer({
9131
9183
  name: "uisandbox",
9132
- version: "0.3.1"
9184
+ version: "0.3.2"
9133
9185
  }, { instructions: `UISandbox renders a BUILT web app 1:1 in a sandbox and turns every CSS literal into a knob that moves the app's own value; "1:1" is measured (a computed-style diff), not promised.
9134
9186
 
9135
9187
  When to use it — and offer it without being asked:
@@ -9399,7 +9451,7 @@ server.registerTool("open", {
9399
9451
  const { port } = await localServer();
9400
9452
  const hash = JSON.stringify(p.cfg) === JSON.stringify(p.report.baseline.cfg) ? "" : `#${encode(p.cfg)}`;
9401
9453
  const url = `http://127.0.0.1:${port}/?load=${encodeURIComponent(`/__archive/${id}.zip`)}&sync=${id}${screen ? `&screen=${encodeURIComponent(screen)}` : ""}${hash}`;
9402
- openInBrowser(url);
9454
+ if (!argv.includes("--no-browser")) openInBrowser(url);
9403
9455
  return { content: [{
9404
9456
  type: "text",
9405
9457
  text: JSON.stringify({
@@ -9549,8 +9601,8 @@ server.registerPrompt("try", {
9549
9601
  }
9550
9602
  }] }));
9551
9603
  var argv = process.argv.slice(2);
9552
- if (argv[0] === "open" && argv[1]) {
9553
- const target = argv[1];
9604
+ if (argv[0] === "open") {
9605
+ const target = argv.slice(1).find((a) => !a.startsWith("--")) ?? ".";
9554
9606
  let bytes, name;
9555
9607
  if (statSync(target).isDirectory()) {
9556
9608
  const { zipFolder } = await Promise.resolve().then(() => (init_zipdir(), zipdir_exports));
@@ -9580,8 +9632,8 @@ if (argv[0] === "open" && argv[1]) {
9580
9632
  });
9581
9633
  const { port } = await localServer();
9582
9634
  const url = `http://127.0.0.1:${port}/?load=${encodeURIComponent(`/__archive/${id}.zip`)}&sync=${id}`;
9583
- openInBrowser(url);
9584
- console.log(`UISandbox is open: ${url}\n${project.screens.length} screens · ${project.table.entries.length} values · brand ${report.baseline.cfg.cPrimary}\nCtrl-C to stop.`);
9635
+ if (!argv.includes("--no-browser")) openInBrowser(url);
9636
+ console.log(`UISandbox is open: ${url}\n${project.root ? `build found at ${project.root}/ · ` : ""}${project.screens.length} screens · ${project.table.entries.length} values · brand ${report.baseline.cfg.cPrimary}\nCtrl-C to stop.`);
9585
9637
  await new Promise(() => {});
9586
9638
  }
9587
9639
  var transport = new StdioServerTransport();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uisandbox-mcp",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "UISandbox as an MCP server: open the real sandbox in your browser with your built web app loaded, turn its own knobs, verify 1:1, export CSS/patch/tokens/Swift/Android. Test your design on the real thing.",
5
5
  "type": "module",
6
6
  "bin": {