Compare commits

..

3 Commits

Author SHA1 Message Date
realZachi
4490b0341d Merge origin/main and unify the Worker entry
main gained a Worker script (scripts/shotluma-worker.ts) for the OpenCode
same-origin proxy while this branch added its own for the share API — a
Worker has exactly one entry, so the share API is now a module
(scripts/share-api.ts) mounted by the existing entry, and run_worker_first
carries the union of both route sets. The dev proxy map combines the
Moonshot/OpenCode proxies with the share passthrough.

Also keys the share dialog state to the inputs that produced it, so a
project change while the dialog is open (for example an AI run mutating
slides) renders as pending instead of surfacing the previous link.
2026-08-20 19:29:16 +02:00
realZachi
1ceff81885 fix(share): harden share flow after review
- Add request timeouts to all share API calls so a stalled Worker degrades
  to the inline fallback instead of hanging the dialog or the import.
- Strip the static og:/twitter: tags from index.html before injecting
  per-share tags; crawlers honor the first tag they see. Propagate a failed
  asset fetch instead of serving its body as a 200 page.
- Reject oversized uploads from the content-length header before buffering,
  add x-content-type-options: nosniff to stored-bytes responses, and add an
  optional per-IP rate-limit binding for share writes.
- Settle the one-shot shared import after it is applied so a re-run of the
  hydration effect cannot re-apply the imported project, and surface a toast
  when hydration fails after the share fragment was already consumed.
- Track clipboard failures separately in the share dialog, keep the link
  visible, and offer a selectable fallback field.
- Give dropped project-name words a visible ellipsis in the OG preview.
- Document the #s= fragment as a consumed compatibility format.
2026-08-20 19:15:04 +02:00
realZachi
36c80ac60c feat(share): add project share links with short URLs and OG previews
Projects can be shared as links from the project menu. The share payload is
the whole project as deflate-raw compressed JSON with every image inlined,
capped at export resolution and re-encoded as WebP when smaller.

Short /s/<id> links store the payload opaquely in Cloudflare KV (90-day TTL,
10 MB cap) through a share API running as the script of the existing
shotluma-app Worker; /s/<id> also serves per-share Open Graph tags with a
client-rendered 1200x630 unfurl image composed from the live artboards.
When the share API is unreachable the link degrades to a self-contained
#share= fragment that carries the payload itself.

Opening a link imports an independent local copy, so the recipient can edit
or delete without affecting the sender. Share payloads are treated as
untrusted input: decoding re-sanitizes AI screen markup and rich text, drops
malformed records and unsafe image schemes, and caps decompressed size. The
import consumes the URL exactly once and is cached module-wide because React
StrictMode double-invokes the hydration effect in development.
2026-08-20 19:02:03 +02:00
44 changed files with 243 additions and 1200 deletions

1
.gitignore vendored
View File

@ -6,7 +6,6 @@ coverage/
*.tsbuildinfo
.eslintcache
playwright-report/
.playwright-mcp/
test-results/
.claude/

170
bun.lock
View File

@ -56,7 +56,7 @@
"@types/react": "latest",
"@types/react-dom": "latest",
"@vitejs/plugin-react": "latest",
"@vitest/coverage-v8": "^4.1.12",
"@vitest/coverage-v8": "^4.1.6",
"eslint": "latest",
"eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-import-x": "^4.17.1",
@ -68,29 +68,21 @@
"typescript": "5.9.3",
"typescript-eslint": "latest",
"vite": "latest",
"vitest": "^4.1.12",
"vitest": "^4.1.6",
"wrangler": "4.118.0",
},
},
},
"overrides": {
"@hono/node-server": "2.0.10",
"@modelcontextprotocol/sdk": "1.32.1",
"baseline-browser-mapping": "2.11.30",
"brace-expansion": "5.0.12",
"browserslist": "4.29.4",
"fast-uri": "3.1.8",
"hono": "4.13.13",
"ip-address": "10.7.4",
"js-yaml": "4.3.2",
"brace-expansion": "5.0.9",
"fast-uri": "3.1.5",
"hono": "4.12.34",
"ip-address": "10.4.0",
"js-yaml": "4.3.1",
"nanoid": "3.3.18",
"postcss": "8.5.25",
"postcss-selector-parser": "7.1.6",
"proxy-addr": "2.0.8",
"qs": "6.16.1",
"sharp": "0.35.5",
"source-map-js": "1.2.2",
"undici": "7.29.1",
"undici": "7.29.0",
},
"packages": {
"@ai-sdk/alibaba": ["@ai-sdk/alibaba@2.0.16", "", { "dependencies": { "@ai-sdk/openai-compatible": "3.0.14", "@ai-sdk/provider": "4.0.3", "@ai-sdk/provider-utils": "5.0.12" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-5m22ATiDlaJRKzgGIm2jXfBFbtOJ+PaUDUVzXLkU3Np2QisNVL6+kK28jQwEZLIj3vaef3c9gjoNt1CC7+qlGg=="],
@ -361,57 +353,57 @@
"@img/colour": ["@img/colour@1.1.0", "", {}, "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ=="],
"@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.4" }, "os": "darwin", "cpu": "arm64" }, "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg=="],
"@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.1" }, "os": "darwin", "cpu": "arm64" }, "sha512-eEieHsMksAW4IiO5NzauESRl2D2qz3J/kwUxUrSfV06A93eEaRfMpHXyUb1mAqrR7i8U9A0GRqE9pjn6u1Jjpg=="],
"@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.4" }, "os": "darwin", "cpu": "x64" }, "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw=="],
"@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.1" }, "os": "darwin", "cpu": "x64" }, "sha512-BaktuGPCeHJMARpodR8jK4uKiZrPAy9WrfQW0sdI37clracq8Bp01AYS3SZgi5FS/y5twa9t4+LIuuxQjqRrWw=="],
"@img/sharp-freebsd-wasm32": ["@img/sharp-freebsd-wasm32@0.35.5", "", { "dependencies": { "@img/sharp-wasm32": "0.35.5" }, "os": "freebsd" }, "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw=="],
"@img/sharp-freebsd-wasm32": ["@img/sharp-freebsd-wasm32@0.35.2", "", { "dependencies": { "@img/sharp-wasm32": "0.35.2" }, "os": "freebsd" }, "sha512-YoAxdnd8hPUkvLHd3bWY+YA8nw3xM/RyRopYucNsWHVSan8NLVM3X2volsfoRDcXdUJPg6tXahSd7HXPK7lRnw=="],
"@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.3.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw=="],
"@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.3.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-4V/M3roRMTYjiwZY9IOVQOE8OyeCxFAkYmyZDrZl51uOKjibm3oeEJ4WAmLxutAfzFbC9jqUiPs2gbnGflH+7g=="],
"@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.3.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ=="],
"@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.3.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-c0/DxItpJv2+dGhgycJBBgotdqruGYDvA79drdh0MD1dFpy7JzJ/PlXwi1H4rFf0eTy8tgbI91aHDnZIceY3jQ=="],
"@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.3.4", "", { "os": "linux", "cpu": "arm" }, "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw=="],
"@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.3.1", "", { "os": "linux", "cpu": "arm" }, "sha512-aGGy9aWzXgHBG7HNyQPWorZthlp7+x6fDRoPAQbGO3ThcttuTyKIx3NuSHb6zb4gBNq6/yNn9f1cy9nFKS/Vmg=="],
"@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.3.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A=="],
"@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.3.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-JznefmcK9j1JKPz8AkQDh89kjojubyfOasWBPKfzMIhPwsgDy9evpE/naJTXXXmghS1iFwR8u/kTwh/I2/+GCw=="],
"@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.3.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ=="],
"@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.3.1", "", { "os": "linux", "cpu": "ppc64" }, "sha512-1EkwGNCZk6iWNCMWqrvdJ+r1j0PT1zIz60CNPhYnJlK/zyeWqlsPZIe+ocBVqPF8k/Ssee/NCk+tE9Ryrko6ng=="],
"@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.3.4", "", { "os": "linux", "cpu": "none" }, "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q=="],
"@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.3.1", "", { "os": "linux", "cpu": "none" }, "sha512-Ilays+w2bXdnxzxtQdmXR62u8o8GYa3eL4+Gr+1KiE4xperMZUslRaVPJwwPkzlHEjGfXAfRVAa/7CYCtSqsBw=="],
"@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.3.4", "", { "os": "linux", "cpu": "s390x" }, "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ=="],
"@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.3.1", "", { "os": "linux", "cpu": "s390x" }, "sha512-VfBwVHQTbRoj4XlpA/KLZ7ltgMpz+4WSejFzQ+GnoImjo1PtEJ59QB2qR1xQEeRPYIkNrPIm2L4cICMvz4C2ew=="],
"@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.3.4", "", { "os": "linux", "cpu": "x64" }, "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw=="],
"@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.3.1", "", { "os": "linux", "cpu": "x64" }, "sha512-+c8ukgwU62DS54nCAjw7keOfHUkmr0B5QHEdcOqRnodF/MNXJbVI8Eopoj4B/0H8Asr65I+A4Amrn7a85/md6A=="],
"@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.3.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA=="],
"@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.3.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-qlKb/pwbkAi1WMsJrYHk7CuDrd12s27U2QnRhFYUoJNrRCmkosMTttuRFat/DDB3IlDm5qE1TJgZ4JDnHX8Ldw=="],
"@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.3.4", "", { "os": "linux", "cpu": "x64" }, "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg=="],
"@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.3.1", "", { "os": "linux", "cpu": "x64" }, "sha512-yO21HwoUVLN8Qa+/SBjQLMYwBWAVJjeGPNe+hc0OUeMeifEtJqu5a1c4HayE1nNpDih9y3/KkoltfkDodmKAlg=="],
"@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.4" }, "os": "linux", "cpu": "arm" }, "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ=="],
"@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.1" }, "os": "linux", "cpu": "arm" }, "sha512-SE4kzF2mepn6z+6E7L6lsV8FzuLL6IPQdyX8ZiwROAG/G8td+hP/m7FsFPwidtrF19gvajuC9l6TxAVcsA4S7A=="],
"@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.4" }, "os": "linux", "cpu": "arm64" }, "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ=="],
"@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.1" }, "os": "linux", "cpu": "arm64" }, "sha512-af12Pnd0ZGu2HfP8NayB0kk6eC/lrfbQE6HlR4jD+34wdJ1Vw9TF6TMn6ZvffT+WgqVsl0hRbmNvz2u/23VmwA=="],
"@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.4" }, "os": "linux", "cpu": "ppc64" }, "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA=="],
"@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.1" }, "os": "linux", "cpu": "ppc64" }, "sha512-hYSBm7zcNtDCozCxQHYZJiu63b/bXsgRZuOxCIBZsStMM9Vap47iFHdbX4kCvQsblPB/k+clhELpdQJHQLSHvg=="],
"@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.4" }, "os": "linux", "cpu": "none" }, "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ=="],
"@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.1" }, "os": "linux", "cpu": "none" }, "sha512-qQt0Kc13+Hoan/Awq/qMSQw3L+RI1NCRPgD5cUJ/1WSSmIoysLOc72jlRM3E0OHN9Yr313jgeQ2T+zW+F03QFA=="],
"@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.4" }, "os": "linux", "cpu": "s390x" }, "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA=="],
"@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.1" }, "os": "linux", "cpu": "s390x" }, "sha512-E4fLLfRPzDLlEeDaTzI98OFLcv++WL5ChLLMwPoVd0CIoZQqupBSNbOisPL5am9XsbQ9T84+iiMpUvbFtkunbA=="],
"@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.4" }, "os": "linux", "cpu": "x64" }, "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog=="],
"@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.1" }, "os": "linux", "cpu": "x64" }, "sha512-gi0zFJJRLswfCZmHtJdikXPOc5u7qamSOS3NHedLqLd4W8Q0NqjdBr6TTRIgsfFjqfTsHFgdfvJ9LwqSgcHiAA=="],
"@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" }, "os": "linux", "cpu": "arm64" }, "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg=="],
"@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.1" }, "os": "linux", "cpu": "arm64" }, "sha512-siWbOW1u6HFnFLrp0waKyW7VEf7jYvcDWdrXEFa8AkdAQgEvuu5Fz8/Y70w9EeqAdwDtfU012BhEHHaDqvQNzg=="],
"@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.4" }, "os": "linux", "cpu": "x64" }, "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A=="],
"@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.35.2", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.1" }, "os": "linux", "cpu": "x64" }, "sha512-YBqMMcjDi4QGYiSn4vNOYBhmlC4z5AXqkOUUqI2e0AFA4urNv4ESgOgwNl3K+4etQhha0twXlzeF20bbULm9Yg=="],
"@img/sharp-wasm32": ["@img/sharp-wasm32@0.35.5", "", { "dependencies": { "@emnapi/runtime": "^1.11.3" } }, "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ=="],
"@img/sharp-wasm32": ["@img/sharp-wasm32@0.35.2", "", { "dependencies": { "@emnapi/runtime": "^1.11.1" } }, "sha512-Mrv4JQNYVQ94xH+jzZ9r+gowleN8mv2FTgKT+PI6bx5C0G8TdNYndu161pg2i7uoBwxy2ImPMHrJOM2LZef7Bw=="],
"@img/sharp-webcontainers-wasm32": ["@img/sharp-webcontainers-wasm32@0.35.5", "", { "dependencies": { "@img/sharp-wasm32": "0.35.5" }, "cpu": "none" }, "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA=="],
"@img/sharp-webcontainers-wasm32": ["@img/sharp-webcontainers-wasm32@0.35.2", "", { "dependencies": { "@img/sharp-wasm32": "0.35.2" }, "cpu": "none" }, "sha512-QNV27pxs9wpApEiCfvHM1RDoP1w1+2KrUWWDPEhEwg+latvOrfuhWrHWZKwdSFwU6jh3myjw/yOCRsUIuOft3g=="],
"@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.35.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q=="],
"@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.35.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-BiVRYc/t6/Vl3e1hBx0hugG4oN9Pydf4fgMSpxTQJmwGUg/YoXTWHiFeRymHfCZzifxu4F4rpk/I67D0LQ20wQ=="],
"@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.35.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A=="],
"@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.35.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-YYEhx9PImCC7T0tI8JDMi4DB9LwLCXCU5OWNYEXAxh5Q1ShKkyC6byxzoBJ3gEFDnH2lQckWuDe70G7mB2XJog=="],
"@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.5", "", { "os": "win32", "cpu": "x64" }, "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg=="],
"@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.2", "", { "os": "win32", "cpu": "x64" }, "sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ=="],
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
@ -423,7 +415,7 @@
"@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
"@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.32.1", "", { "dependencies": { "@hono/node-server": "^1.19.9 || ^2.0.5", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-2DdE+SJDtzLEEWzY1ZjY7Q+VcPhcV1KisD3zI4u0XZyktsjHum1mwbMI+JaulUBi2OZk+KJAi2uPXzxichPkdw=="],
"@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.29.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ=="],
"@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.6", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg=="],
@ -547,7 +539,7 @@
"@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.65.0", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.65.0", "@typescript-eslint/types": "^8.65.0", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-SxnPhbTsGahizDgbu7oqFH/xVtzIqMd/s+WtnSxNxJZJpLbdT5IPdzg8EZxO3+PoKahXmwJLeNQOpKJb3/bi7Q=="],
"@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.65.0", "", { "dependencies": { "@typescript-eslint/types": "8.65.0", "@typescript-eslint/visitor-keys": "8.65.0" } }, "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg=="],
"@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.64.0", "", { "dependencies": { "@typescript-eslint/types": "8.64.0", "@typescript-eslint/visitor-keys": "8.64.0" } }, "sha512-CXEaFdYXjSTgKhisNkwCcJwTP8Pl+fmRrEQrri4nm3vU743bALrxzLmq7fHG/7e6a5xO0lDYeURpZmBuhHk54w=="],
"@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.65.0", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-j6GzGqCiRdA7Qhur2VVmKZAkBLfnHFQfx4TaJGL9RMveZqCo48jSHHO0DTgizEnGhtWnqmbtCUSrqSkdiY/0Hg=="],
@ -557,7 +549,7 @@
"@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.65.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.65.0", "@typescript-eslint/tsconfig-utils": "8.65.0", "@typescript-eslint/types": "8.65.0", "@typescript-eslint/visitor-keys": "8.65.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-JboAE2swaYt4tb1fHhHTABE2K+OLy09XfcTbhnk4Pw96f9dd2e9iYsJ28gBggHlo5z5x1rkyWvcPoTuNTd4oGg=="],
"@typescript-eslint/utils": ["@typescript-eslint/utils@8.65.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.65.0", "@typescript-eslint/types": "8.65.0", "@typescript-eslint/typescript-estree": "8.65.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA=="],
"@typescript-eslint/utils": ["@typescript-eslint/utils@8.64.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.64.0", "@typescript-eslint/types": "8.64.0", "@typescript-eslint/typescript-estree": "8.64.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-aJUGVB3+U0htrrCjoA8qukw8cm8fNCGAxK/tVoS70k8aeb7DETKeFozRiVFIwEeN9WJLsjaP3ph8I60tY2XZoQ=="],
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.65.0", "", { "dependencies": { "@typescript-eslint/types": "8.65.0", "eslint-visitor-keys": "^5.0.0" } }, "sha512-8C71BQkGjiMmXtop7pHVJu1l2NNShFdkCyD6a2ezzs5vU/L3LRtb69EtcteFwz0mYMPzIgOw0n6OV4VBUWZd7A=="],
@ -609,21 +601,21 @@
"@vitejs/plugin-react": ["@vitejs/plugin-react@6.0.3", "", { "dependencies": { "@rolldown/pluginutils": "^1.0.1" }, "peerDependencies": { "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", "babel-plugin-react-compiler": "^1.0.0", "vite": "^8.0.0" }, "optionalPeers": ["@rolldown/plugin-babel", "babel-plugin-react-compiler"] }, "sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg=="],
"@vitest/coverage-v8": ["@vitest/coverage-v8@4.1.12", "", { "dependencies": { "@bcoe/v8-coverage": "^1.0.2", "@vitest/utils": "4.1.12", "ast-v8-to-istanbul": "^1.0.0", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.2.0", "magicast": "^0.5.2", "obug": "^2.1.1", "std-env": "^4.0.0-rc.1", "tinyrainbow": "^3.1.0" }, "peerDependencies": { "@vitest/browser": "4.1.12", "vitest": "4.1.12" }, "optionalPeers": ["@vitest/browser"] }, "sha512-6S7/iVknKglLAxMFxQGNppBI0iqJS2NgM6FBxavitj7KaDq/vywOWGf6dGu7F2L1Qy0G6S3uTp7aGshHrzK8JA=="],
"@vitest/coverage-v8": ["@vitest/coverage-v8@4.1.10", "", { "dependencies": { "@bcoe/v8-coverage": "^1.0.2", "@vitest/utils": "4.1.10", "ast-v8-to-istanbul": "^1.0.0", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.2.0", "magicast": "^0.5.2", "obug": "^2.1.1", "std-env": "^4.0.0-rc.1", "tinyrainbow": "^3.1.0" }, "peerDependencies": { "@vitest/browser": "4.1.10", "vitest": "4.1.10" }, "optionalPeers": ["@vitest/browser"] }, "sha512-IM49HmthevbgAO4anp1hwtoT9wYe59w0LR00gr+eagHE+ZJ5lK4sLPeO0ubgoJcwLk6dehU3R24N+FbEEKDc8g=="],
"@vitest/expect": ["@vitest/expect@4.1.12", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.1.12", "@vitest/utils": "4.1.12", "chai": "^6.2.2", "tinyrainbow": "^3.1.0" } }, "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ=="],
"@vitest/expect": ["@vitest/expect@4.1.10", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.1.10", "@vitest/utils": "4.1.10", "chai": "^6.2.2", "tinyrainbow": "^3.1.0" } }, "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA=="],
"@vitest/mocker": ["@vitest/mocker@4.1.12", "", { "dependencies": { "@vitest/spy": "4.1.12", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA=="],
"@vitest/mocker": ["@vitest/mocker@4.1.10", "", { "dependencies": { "@vitest/spy": "4.1.10", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow=="],
"@vitest/pretty-format": ["@vitest/pretty-format@4.1.12", "", { "dependencies": { "tinyrainbow": "^3.1.0" } }, "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA=="],
"@vitest/pretty-format": ["@vitest/pretty-format@4.1.10", "", { "dependencies": { "tinyrainbow": "^3.1.0" } }, "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q=="],
"@vitest/runner": ["@vitest/runner@4.1.12", "", { "dependencies": { "@vitest/utils": "4.1.12", "pathe": "^2.0.3" } }, "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w=="],
"@vitest/runner": ["@vitest/runner@4.1.10", "", { "dependencies": { "@vitest/utils": "4.1.10", "pathe": "^2.0.3" } }, "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg=="],
"@vitest/snapshot": ["@vitest/snapshot@4.1.12", "", { "dependencies": { "@vitest/pretty-format": "4.1.12", "@vitest/utils": "4.1.12", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw=="],
"@vitest/snapshot": ["@vitest/snapshot@4.1.10", "", { "dependencies": { "@vitest/pretty-format": "4.1.10", "@vitest/utils": "4.1.10", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw=="],
"@vitest/spy": ["@vitest/spy@4.1.12", "", {}, "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg=="],
"@vitest/spy": ["@vitest/spy@4.1.10", "", {}, "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw=="],
"@vitest/utils": ["@vitest/utils@4.1.12", "", { "dependencies": { "@vitest/pretty-format": "4.1.12", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" } }, "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA=="],
"@vitest/utils": ["@vitest/utils@4.1.10", "", { "dependencies": { "@vitest/pretty-format": "4.1.10", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" } }, "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA=="],
"@workflow/serde": ["@workflow/serde@4.1.0", "", {}, "sha512-pav4F2BoirECWR7Nf1TKt+2eETcBj7jj4cBefQ8VXQCA6NPkaKeLfj/zMgi+3zYV5ZIBT4GuUiphsj0/b9hPQQ=="],
@ -655,7 +647,7 @@
"balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],
"baseline-browser-mapping": ["baseline-browser-mapping@2.11.30", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-YJs6Pz17RMNv8HoyKREtCY38E3BV1nPkWVmIb+XN1uHC1Vqt3KZCH/uJH9ZKRoiKb/icZ6tvehyee6RZNbFfRA=="],
"baseline-browser-mapping": ["baseline-browser-mapping@2.10.44", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-T3ghW+sl/ZJ8w1v/yQx3qvJ9040DWoLBz8JT/CILbAKcFyG9b2MRe75v6W5uXjv6uH1lumK2Kv46y2zSkcej0Q=="],
"bidi-js": ["bidi-js@1.0.3", "", { "dependencies": { "require-from-string": "^2.0.2" } }, "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw=="],
@ -663,11 +655,11 @@
"body-parser": ["body-parser@2.3.0", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="],
"brace-expansion": ["brace-expansion@5.0.12", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ=="],
"brace-expansion": ["brace-expansion@5.0.9", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg=="],
"braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
"browserslist": ["browserslist@4.29.4", "", { "dependencies": { "baseline-browser-mapping": "^2.11.29", "caniuse-lite": "^1.0.30001816", "electron-to-chromium": "^1.5.459", "node-releases": "^2.0.59", "update-browserslist-db": "^1.3.4" }, "bin": { "browserslist": "cli.js" } }, "sha512-2TcbbiwXEq+N0kD36tykpCfyyQigUXmuwNQbnPp4Xk4PX9JOqVIKjJlIDjpH7uY6tmRGoAd+apeT1p60T8wsdA=="],
"browserslist": ["browserslist@4.28.6", "", { "dependencies": { "baseline-browser-mapping": "^2.10.42", "caniuse-lite": "^1.0.30001803", "electron-to-chromium": "^1.5.389", "node-releases": "^2.0.51", "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw=="],
"bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],
@ -679,7 +671,7 @@
"callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],
"caniuse-lite": ["caniuse-lite@1.0.30001816", "", {}, "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw=="],
"caniuse-lite": ["caniuse-lite@1.0.30001806", "", {}, "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw=="],
"chai": ["chai@6.2.2", "", {}, "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg=="],
@ -759,7 +751,7 @@
"ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
"electron-to-chromium": ["electron-to-chromium@1.5.459", "", {}, "sha512-4SC9HHSFjO/liAhifpdOL5hG9b4BP7/5G3y3UPZVO8trlAXr1CaUEEJL0gWK3kOcYcZrOA5rkwG45Gra/lTIgg=="],
"electron-to-chromium": ["electron-to-chromium@1.5.393", "", {}, "sha512-kiDJdIUawuEIcp9XoICKp1iTYDEbgguIPq526N1Q7jIQDeQ3CqoMx71025PI/7E48Ddtw2HuWsVjY7afEgNxmg=="],
"emoji-regex": ["emoji-regex@10.6.0", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="],
@ -847,7 +839,7 @@
"fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="],
"fast-uri": ["fast-uri@3.1.8", "", {}, "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg=="],
"fast-uri": ["fast-uri@3.1.5", "", {}, "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw=="],
"fastq": ["fastq@1.20.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="],
@ -911,7 +903,7 @@
"hermes-parser": ["hermes-parser@0.25.1", "", { "dependencies": { "hermes-estree": "0.25.1" } }, "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA=="],
"hono": ["hono@4.13.13", "", {}, "sha512-CQ46U0ZkAGmbT/4UxdzzGJpacP2IeKgY4a5/tOI9AABbpOMfK739wfDXmv1usCk+3RkKj1hQy4/fjhiwa2xlrA=="],
"hono": ["hono@4.12.34", "", {}, "sha512-GqXJqY/xJkJmuloTrnV1ZEXG3fqte+VjkUqoRNZXcrUidiUOP4fMSIHHY4tsqZBK++kVyWmt/AAfSUuy57/eSA=="],
"html-encoding-sniffer": ["html-encoding-sniffer@6.0.0", "", { "dependencies": { "@exodus/bytes": "^1.6.0" } }, "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg=="],
@ -935,7 +927,7 @@
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
"ip-address": ["ip-address@10.7.4", "", {}, "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg=="],
"ip-address": ["ip-address@10.4.0", "", {}, "sha512-oSK96Grm3aP6OrS263xVxbNDGVL7rzBtYdpGqlDG8iQdoenDoTs/nkki+DflYbAEE8Xl6o5YxhxlrKvI3nqKXQ=="],
"ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
@ -989,7 +981,7 @@
"js-tokens": ["js-tokens@10.0.0", "", {}, "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q=="],
"js-yaml": ["js-yaml@4.3.2", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA=="],
"js-yaml": ["js-yaml@4.3.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ=="],
"jsdom": ["jsdom@29.1.1", "", { "dependencies": { "@asamuzakjp/css-color": "^5.1.11", "@asamuzakjp/dom-selector": "^7.1.1", "@bramus/specificity": "^2.4.2", "@csstools/css-syntax-patches-for-csstree": "^1.1.3", "@exodus/bytes": "^1.15.0", "css-tree": "^3.2.1", "data-urls": "^7.0.0", "decimal.js": "^10.6.0", "html-encoding-sniffer": "^6.0.0", "is-potential-custom-element-name": "^1.0.1", "lru-cache": "^11.3.5", "parse5": "^8.0.1", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^6.0.1", "undici": "^7.25.0", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^8.0.1", "whatwg-mimetype": "^5.0.0", "whatwg-url": "^16.0.1", "xml-name-validator": "^5.0.0" }, "peerDependencies": { "canvas": "^3.0.0" }, "optionalPeers": ["canvas"] }, "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q=="],
@ -1097,7 +1089,7 @@
"negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="],
"node-releases": ["node-releases@2.0.59", "", {}, "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA=="],
"node-releases": ["node-releases@2.0.51", "", {}, "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ=="],
"npm-run-path": ["npm-run-path@6.0.0", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="],
@ -1159,7 +1151,7 @@
"postcss": ["postcss@8.5.25", "", { "dependencies": { "nanoid": "^3.3.16", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw=="],
"postcss-selector-parser": ["postcss-selector-parser@7.1.6", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw=="],
"postcss-selector-parser": ["postcss-selector-parser@7.1.4", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg=="],
"powershell-utils": ["powershell-utils@0.1.0", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="],
@ -1171,11 +1163,11 @@
"prompts": ["prompts@2.4.2", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="],
"proxy-addr": ["proxy-addr@2.0.8", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ=="],
"proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="],
"punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
"qs": ["qs@6.16.1", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg=="],
"qs": ["qs@6.15.3", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A=="],
"queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="],
@ -1231,7 +1223,7 @@
"shadcn": ["shadcn@4.16.2", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/parser": "^7.28.0", "@babel/plugin-transform-typescript": "^7.28.0", "@babel/preset-typescript": "^7.27.1", "@dotenvx/dotenvx": "^1.48.4", "@modelcontextprotocol/sdk": "^1.26.0", "@types/validate-npm-package-name": "^4.0.2", "browserslist": "^4.26.2", "commander": "^14.0.0", "cosmiconfig": "^9.0.0", "dedent": "^1.6.0", "deepmerge": "^4.3.1", "diff": "^8.0.2", "execa": "^9.6.0", "fast-glob": "^3.3.3", "fs-extra": "^11.3.1", "fuzzysort": "^3.1.0", "kleur": "^4.1.5", "open": "^11.0.0", "ora": "^8.2.0", "postcss": "^8.5.6", "postcss-selector-parser": "^7.1.0", "prompts": "^2.4.2", "recast": "^0.23.11", "stringify-object": "^5.0.0", "tailwind-merge": "^3.0.1", "ts-morph": "^26.0.0", "tsconfig-paths": "^4.2.0", "undici": "^7.27.2", "validate-npm-package-name": "^7.0.1", "zod": "^3.24.1", "zod-to-json-schema": "^3.24.6" }, "bin": { "shadcn": "dist/index.js" } }, "sha512-M1AvZKFWcCzWRDoyApIqJMSLIpY8Ev4uBGuiPLSFmiTbixXhPmzotSTvLzFmBrfoIxG9aIg2dZOETblEaXGUnQ=="],
"sharp": ["sharp@0.35.5", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.5", "@img/sharp-darwin-x64": "0.35.5", "@img/sharp-freebsd-wasm32": "0.35.5", "@img/sharp-libvips-darwin-arm64": "1.3.4", "@img/sharp-libvips-darwin-x64": "1.3.4", "@img/sharp-libvips-linux-arm": "1.3.4", "@img/sharp-libvips-linux-arm64": "1.3.4", "@img/sharp-libvips-linux-ppc64": "1.3.4", "@img/sharp-libvips-linux-riscv64": "1.3.4", "@img/sharp-libvips-linux-s390x": "1.3.4", "@img/sharp-libvips-linux-x64": "1.3.4", "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", "@img/sharp-libvips-linuxmusl-x64": "1.3.4", "@img/sharp-linux-arm": "0.35.5", "@img/sharp-linux-arm64": "0.35.5", "@img/sharp-linux-ppc64": "0.35.5", "@img/sharp-linux-riscv64": "0.35.5", "@img/sharp-linux-s390x": "0.35.5", "@img/sharp-linux-x64": "0.35.5", "@img/sharp-linuxmusl-arm64": "0.35.5", "@img/sharp-linuxmusl-x64": "0.35.5", "@img/sharp-webcontainers-wasm32": "0.35.5", "@img/sharp-win32-arm64": "0.35.5", "@img/sharp-win32-ia32": "0.35.5", "@img/sharp-win32-x64": "0.35.5" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g=="],
"sharp": ["sharp@0.35.2", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.4" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.2", "@img/sharp-darwin-x64": "0.35.2", "@img/sharp-freebsd-wasm32": "0.35.2", "@img/sharp-libvips-darwin-arm64": "1.3.1", "@img/sharp-libvips-darwin-x64": "1.3.1", "@img/sharp-libvips-linux-arm": "1.3.1", "@img/sharp-libvips-linux-arm64": "1.3.1", "@img/sharp-libvips-linux-ppc64": "1.3.1", "@img/sharp-libvips-linux-riscv64": "1.3.1", "@img/sharp-libvips-linux-s390x": "1.3.1", "@img/sharp-libvips-linux-x64": "1.3.1", "@img/sharp-libvips-linuxmusl-arm64": "1.3.1", "@img/sharp-libvips-linuxmusl-x64": "1.3.1", "@img/sharp-linux-arm": "0.35.2", "@img/sharp-linux-arm64": "0.35.2", "@img/sharp-linux-ppc64": "0.35.2", "@img/sharp-linux-riscv64": "0.35.2", "@img/sharp-linux-s390x": "0.35.2", "@img/sharp-linux-x64": "0.35.2", "@img/sharp-linuxmusl-arm64": "0.35.2", "@img/sharp-linuxmusl-x64": "0.35.2", "@img/sharp-webcontainers-wasm32": "0.35.2", "@img/sharp-win32-arm64": "0.35.2", "@img/sharp-win32-ia32": "0.35.2", "@img/sharp-win32-x64": "0.35.2" } }, "sha512-FVtFjtBCMiJS6yb5CX7Sop45WFMpeGw6oRKuJnXYgf/f1ms/D7LE/ZUSNxnW7rZ/dbslQWYkoqFHGPaDBtaK4w=="],
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
@ -1253,7 +1245,7 @@
"source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
"source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="],
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
"stable-hash-x": ["stable-hash-x@0.2.0", "", {}, "sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ=="],
@ -1329,7 +1321,7 @@
"typescript-eslint": ["typescript-eslint@8.65.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.65.0", "@typescript-eslint/parser": "8.65.0", "@typescript-eslint/typescript-estree": "8.65.0", "@typescript-eslint/utils": "8.65.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-/ggrHAwyjENDusvyxbuqxAC2dTnZg/Z8F+fgQtYIz+L6n/9HfSlEZcFGV/NsMNa6CkGk0xUjUAFwC0vHOflvIA=="],
"undici": ["undici@7.29.1", "", {}, "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q=="],
"undici": ["undici@7.29.0", "", {}, "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw=="],
"undici-types": ["undici-types@7.28.0", "", {}, "sha512-LJAfY+2w6HGeT8d8J1wNQsUGUEGio6NWWpwdwurQe4f6oojzCFuGLizl1KSve4irsTxyLly1QhEeE6iapdaIvQ=="],
@ -1343,7 +1335,7 @@
"unrs-resolver": ["unrs-resolver@1.12.2", "", { "dependencies": { "napi-postinstall": "^0.3.4" }, "optionalDependencies": { "@unrs/resolver-binding-android-arm-eabi": "1.12.2", "@unrs/resolver-binding-android-arm64": "1.12.2", "@unrs/resolver-binding-darwin-arm64": "1.12.2", "@unrs/resolver-binding-darwin-x64": "1.12.2", "@unrs/resolver-binding-freebsd-x64": "1.12.2", "@unrs/resolver-binding-linux-arm-gnueabihf": "1.12.2", "@unrs/resolver-binding-linux-arm-musleabihf": "1.12.2", "@unrs/resolver-binding-linux-arm64-gnu": "1.12.2", "@unrs/resolver-binding-linux-arm64-musl": "1.12.2", "@unrs/resolver-binding-linux-loong64-gnu": "1.12.2", "@unrs/resolver-binding-linux-loong64-musl": "1.12.2", "@unrs/resolver-binding-linux-ppc64-gnu": "1.12.2", "@unrs/resolver-binding-linux-riscv64-gnu": "1.12.2", "@unrs/resolver-binding-linux-riscv64-musl": "1.12.2", "@unrs/resolver-binding-linux-s390x-gnu": "1.12.2", "@unrs/resolver-binding-linux-x64-gnu": "1.12.2", "@unrs/resolver-binding-linux-x64-musl": "1.12.2", "@unrs/resolver-binding-openharmony-arm64": "1.12.2", "@unrs/resolver-binding-wasm32-wasi": "1.12.2", "@unrs/resolver-binding-win32-arm64-msvc": "1.12.2", "@unrs/resolver-binding-win32-ia32-msvc": "1.12.2", "@unrs/resolver-binding-win32-x64-msvc": "1.12.2" } }, "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ=="],
"update-browserslist-db": ["update-browserslist-db@1.3.4", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A=="],
"update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
"uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="],
@ -1357,7 +1349,7 @@
"vite": ["vite@8.1.5", "", { "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.5", "postcss": "^8.5.17", "rolldown": "~1.1.5", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.3.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw=="],
"vitest": ["vitest@4.1.12", "", { "dependencies": { "@vitest/expect": "4.1.12", "@vitest/mocker": "4.1.12", "@vitest/pretty-format": "4.1.12", "@vitest/runner": "4.1.12", "@vitest/snapshot": "4.1.12", "@vitest/spy": "4.1.12", "@vitest/utils": "4.1.12", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.1.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.1.12", "@vitest/browser-preview": "4.1.12", "@vitest/browser-webdriverio": "^4.1.11", "@vitest/coverage-istanbul": "4.1.12", "@vitest/coverage-v8": "4.1.12", "@vitest/ui": "4.1.12", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "./vitest.mjs" } }, "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA=="],
"vitest": ["vitest@4.1.10", "", { "dependencies": { "@vitest/expect": "4.1.10", "@vitest/mocker": "4.1.10", "@vitest/pretty-format": "4.1.10", "@vitest/runner": "4.1.10", "@vitest/snapshot": "4.1.10", "@vitest/spy": "4.1.10", "@vitest/utils": "4.1.10", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.1.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.1.10", "@vitest/browser-preview": "4.1.10", "@vitest/browser-webdriverio": "4.1.10", "@vitest/coverage-istanbul": "4.1.10", "@vitest/coverage-v8": "4.1.10", "@vitest/ui": "4.1.10", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "./vitest.mjs" } }, "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw=="],
"w3c-xmlserializer": ["w3c-xmlserializer@5.0.0", "", { "dependencies": { "xml-name-validator": "^5.0.0" } }, "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA=="],
@ -1433,7 +1425,7 @@
"@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
"@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="],
"@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw=="],
"@modelcontextprotocol/sdk/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="],
@ -1459,19 +1451,27 @@
"@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.65.0", "", { "dependencies": { "@typescript-eslint/types": "8.65.0", "@typescript-eslint/visitor-keys": "8.65.0" } }, "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/utils": ["@typescript-eslint/utils@8.65.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.65.0", "@typescript-eslint/types": "8.65.0", "@typescript-eslint/typescript-estree": "8.65.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA=="],
"@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.6", "", {}, "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw=="],
"@typescript-eslint/parser/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.65.0", "", { "dependencies": { "@typescript-eslint/types": "8.65.0", "@typescript-eslint/visitor-keys": "8.65.0" } }, "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg=="],
"@typescript-eslint/parser/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/project-service/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/scope-manager/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.64.0", "", { "dependencies": { "@typescript-eslint/types": "8.64.0", "eslint-visitor-keys": "^5.0.0" } }, "sha512-mrtuL8Nsn6gi2H4mo5KMTp823M+3Q19Ew/i+Zlikq20tIMm99C3Ez0dCmkWWnxut20esQvTg8aUSEhMcAOXhEw=="],
"@typescript-eslint/type-utils/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/type-utils/@typescript-eslint/utils": ["@typescript-eslint/utils@8.65.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.65.0", "@typescript-eslint/types": "8.65.0", "@typescript-eslint/typescript-estree": "8.65.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA=="],
"@typescript-eslint/typescript-estree/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.64.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.64.0", "@typescript-eslint/tsconfig-utils": "8.64.0", "@typescript-eslint/types": "8.64.0", "@typescript-eslint/visitor-keys": "8.64.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-Pztpsn1aCE1oWDvDEfUk31nngvvF7vUB5SwHFEaZIFpvw7WJtqUHHL4plBZDA9HfWJJjL13BdG0YrJInTUvoVA=="],
"@typescript-eslint/visitor-keys/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
@ -1523,6 +1523,8 @@
"type-is/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],
"typescript-eslint/@typescript-eslint/utils": ["@typescript-eslint/utils@8.65.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.65.0", "@typescript-eslint/types": "8.65.0", "@typescript-eslint/typescript-estree": "8.65.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA=="],
"wsl-utils/is-wsl": ["is-wsl@3.1.1", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw=="],
"@dotenvx/dotenvx/execa/get-stream": ["get-stream@6.0.1", "", {}, "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="],
@ -1567,6 +1569,20 @@
"@tailwindcss/node/lightningcss/lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/eslint-plugin/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="],
"@typescript-eslint/type-utils/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.65.0", "", { "dependencies": { "@typescript-eslint/types": "8.65.0", "@typescript-eslint/visitor-keys": "8.65.0" } }, "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg=="],
"@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.64.0", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.64.0", "@typescript-eslint/types": "^8.64.0", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-tk4WpOJ6IEbGrVHaNmM0YRrwAD3exZlIK3iadQNAxh4YKk6jvUQ4ecq18n+v7+meh+cJ3j+D8nbk8sRKhlwLQg=="],
"@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.64.0", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-2yo8rRNKuzbVWQp5kslhANqZ2uDAeROQHBRZNPu8JDsHmeFNj/XJJhX/FhNUWmkHHvoNsKa6+tHJiig87EzsQw=="],
"@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.64.0", "", { "dependencies": { "@typescript-eslint/types": "8.64.0", "eslint-visitor-keys": "^5.0.0" } }, "sha512-mrtuL8Nsn6gi2H4mo5KMTp823M+3Q19Ew/i+Zlikq20tIMm99C3Ez0dCmkWWnxut20esQvTg8aUSEhMcAOXhEw=="],
"ajv-formats/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
"conf/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
@ -1575,6 +1591,12 @@
"pkg-up/find-up/locate-path": ["locate-path@3.0.0", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="],
"typescript-eslint/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.65.0", "", { "dependencies": { "@typescript-eslint/types": "8.65.0", "@typescript-eslint/visitor-keys": "8.65.0" } }, "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg=="],
"typescript-eslint/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.65.0", "", {}, "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg=="],
"@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="],
"pkg-up/find-up/locate-path/p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="],
"pkg-up/find-up/locate-path/path-exists": ["path-exists@3.0.0", "", {}, "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="],

View File

@ -107,8 +107,7 @@ as WebP when that is smaller). Two link forms exist:
never send fragments: `GET /s/<id>` serves the editor's index.html with
per-share Open Graph tags injected (project name plus a 1200 × 630 unfurl
image that `src/app/share-preview.ts` renders client-side from the live
artboards, using colors sampled from the rendered first screen for its
backdrop, and uploads best-effort at share time). The app consumes the path
artboards and uploads best-effort at share time). The app consumes the path
on boot and rewrites the URL back to `/`. The equivalent `#s=<id>` fragment
form is also consumed on boot as a compatibility format — it just cannot
carry per-share OG tags because crawlers never send fragments. During local
@ -211,7 +210,7 @@ Rich text is built from structured highlight input. The model never writes raw H
The generate dialog covers input only. Once a run starts it closes and `src/components/AiRunBand.tsx` takes over as a band floating over the canvas: assistant prose and reasoning at reading size (accumulated per sentence by `src/ai/run-narration.ts`), a screen rail fed by the model's `declare_plan` call and reconciled against reality by `src/ai/run-plan.ts`, and an action count in place of a tool log. The band is also where a finished or failed run reports its result, so no run hands control back to the centered dialog.
`src/ai/provider-catalog.ts` owns the selectable providers, models, transport metadata, and model-specific reasoning-effort choices. `src/ai/provider-config.ts` resolves keys from browser `localStorage` (API keys dialog) with optional `.env.local` `VITE_*` fallback, and `src/ai/runner.ts` routes either to the Codex bridge or a lazily loaded native AI SDK provider. The runner passes portable efforts through the AI SDK's standardized `reasoning` option so each native provider can map it to its own API; OpenAI GPT-6 Astra, GPT-5.6, and Moonshot/Kimi K3 `max` go through OpenAI-compat `providerOptions` because the shared option has no `max`. The generate modal presents one model picker grouped by provider, with reasoning effort as secondary chips when the model supports it, a Codex connection tutorial, and an API keys dialog for key-based providers. Requests go directly from the local browser to Google, Alibaba/Qwen, OpenAI, Anthropic, xAI, or OpenRouter. Moonshot uses the OpenAI chat provider through the local Vite proxy. OpenCode Zen and Go share one API key, call chat-completions through `/api/opencode`, and describe images with a second vision model when the selected model has no native vision.
`src/ai/provider-catalog.ts` owns the selectable providers, models, transport metadata, and model-specific reasoning-effort choices. `src/ai/provider-config.ts` resolves keys from browser `localStorage` (API keys dialog) with optional `.env.local` `VITE_*` fallback, and `src/ai/runner.ts` routes either to the Codex bridge or a lazily loaded native AI SDK provider. The runner passes portable efforts through the AI SDK's standardized `reasoning` option so each native provider can map it to its own API; OpenAI GPT-5.6 and Moonshot/Kimi K3 `max` go through OpenAI-compat `providerOptions` because the shared option has no `max`. The generate modal presents one model picker grouped by provider, with reasoning effort as secondary chips when the model supports it, a Codex connection tutorial, and an API keys dialog for key-based providers. Requests go directly from the local browser to Google, Alibaba/Qwen, OpenAI, Anthropic, xAI, or OpenRouter. Moonshot uses the OpenAI chat provider through the local Vite proxy. OpenCode Zen and Go share one API key, call chat-completions through `/api/opencode`, and describe images with a second vision model when the selected model has no native vision.
Codex pairing is deliberately not OAuth inside Shotluma. The setup prompt downloads the connector asset emitted with the hosted app, asks Codex to inspect it, and starts it as a detached user process. The browser stores a random pairing token and the exact app origin. The connector binds only `127.0.0.1:47447`, stores its matching configuration with user-only permissions, requires both the exact `Origin` header and bearer pairing token, and never reads Codex authentication files. It starts `codex app-server` over stdio and allowlists only account/rate-limit/model reads plus ephemeral thread and turn methods. Thread and turn requests are overwritten to use an empty read-only workspace, no approvals, and no network. The model can change the canvas only through the same `createEditorTools` dynamic tools used by direct providers.

View File

@ -5,7 +5,7 @@
Every step of a multi-step AI run re-reads the growing conversation history, so the input token count scales quadratically with the number of turns. Prompt caching converts most of that re-read cost into 90% discounted cache reads. The runner applies provider-specific cache routing:
- **Anthropic**: one fixed `cacheControl` breakpoint on the system instructions caches tools plus the static prompt, while a second breakpoint moves to the last message through `prepareStep` (`src/ai/prompt-caching.ts`). The fixed breakpoint protects the reusable prefix when a large parallel-tool turn exceeds Anthropic's moving lookback window.
- **OpenAI**: a browser-session `promptCacheKey` is partitioned by model, mode, and overlay-tool availability. GPT-6 Astra and GPT-5.6 receive an explicit breakpoint after the stable instructions while implicit mode continues caching the growing tool loop. This allows cross-run static-prefix hits without giving up within-run history hits; the session id also shards traffic below OpenAI's per-key routing guidance.
- **OpenAI**: a browser-session `promptCacheKey` is partitioned by model, mode, and overlay-tool availability. GPT-5.6 receives an explicit breakpoint after the stable instructions while implicit mode continues caching the growing tool loop. This allows cross-run static-prefix hits without giving up within-run history hits; the session id also shards traffic below OpenAI's per-key routing guidance.
- **Alibaba/Qwen**: explicit `cacheControl` uses the same fixed-instruction plus moving-message pattern as Anthropic through the Alibaba provider namespace.
- **Google Gemini**: implicit caching is automatic on 2.5+ models. No configuration needed; savings are passed through when request prefixes match.
@ -86,10 +86,6 @@ An opt-in generate-dialog toggle lets the model author whole screens as HTML doc
The controller adapter must update `slidesRef` synchronously before React state because multiple tool calls can read and write in one tick. Preserve the non-history adapter and create one checkpoint before a run so the entire generation remains one undo step.
A run belongs to exactly one project, and the slide/upload refs are shared across project switches. `useAiWorkflow` therefore owns the run lifecycle: the modal registers a cancel handle for the live run (`onRunStateChange`), controller writes are gated on that registration, and `cancelActiveRun` must be called before any path that swaps the refs to another project — the confirm dialog covers user-initiated switches, and `handleProjectReplaced` is the unconditional safety net. Never let a generation write into a project it was not started in.
Project switch, creation, and duplication during a live run go through the `AiRunCancelDialog` confirm; project deletion is disabled until the run ends; `beforeunload` warns only while a run is active. Saves during a run carry `PersistedProject.interruptedGeneration`, which is cleared by one save after the run ends and otherwise consumed on the next load with a one-time toast explaining the half-finished screens.
Clear selection before generation and preview capture. Any live overlay must carry `data-ai-overlay` and remain filtered from preview and export.
## Canvas and prompt contract
@ -119,7 +115,7 @@ While a run is live, the editor shows `src/components/AiRunBand.tsx` — a float
In edit mode there is one target screen and no plan, so the rail is omitted and the band renders narrow. The run band is also the result and error surface — a finished run stays in place instead of handing back to the centered dialog.
Reasoning-effort choices belong to the model catalog. Offer only values supported by the selected model (never a provider-default option) and default to `high` when the model supports it, otherwise `medium`. Pass portable efforts through the AI SDK's top-level `reasoning` option. OpenAI GPT-6 Astra, GPT-5.6 (Luna/Terra/Sol), and Moonshot/Kimi K3 also offer `max`, which the runner sends via OpenAI-compat `providerOptions.openai.reasoningEffort` because the shared SDK option has no `max`. Do not duplicate provider-specific effort mapping in the UI. The generate modal exposes one model picker grouped by provider; reasoning effort appears as secondary chips only when the selected model supports it.
Reasoning-effort choices belong to the model catalog. Offer only values supported by the selected model (never a provider-default option) and default to `high` when the model supports it, otherwise `medium`. Pass portable efforts through the AI SDK's top-level `reasoning` option. OpenAI GPT-5.6 (Luna/Terra/Sol) and Moonshot/Kimi K3 also offer `max`, which the runner sends via OpenAI-compat `providerOptions.openai.reasoningEffort` because the shared SDK option has no `max`. Do not duplicate provider-specific effort mapping in the UI. The generate modal exposes one model picker grouped by provider; reasoning effort appears as secondary chips only when the selected model supports it.
Reasoning **visibility** is a separate switch from reasoning **effort**, and providers are asymmetric about it. OpenAI's Responses API defaults `reasoningSummary` to `'detailed'` as soon as an effort is set, so thoughts stream without being asked for. Google does not: in `@ai-sdk/google`, `thinkingLevel` and `thinkingBudget` fall back to the mapped top-level `reasoning` value, but `includeThoughts` reads *only* from `providerOptions.google.thinkingConfig` with no fallback. Omit it and Gemini still thinks and still bills the tokens while withholding every thought summary — the run band stays empty for the whole run. `buildStreamRequestOptions` (`src/ai/prompt-caching.ts`) therefore always sends `thinkingConfig: { includeThoughts: true }` for Google, across all Gemini generations (the `thinkingLevel`/`thinkingBudget` split is generation-specific; `includeThoughts` is not). Keep that object limited to `includeThoughts`: adding `thinkingLevel` or `thinkingBudget` there would take full precedence over the portable `reasoning` option and silently discard the user's effort choice.

View File

@ -15,8 +15,6 @@ Do not broaden a task through opportunistic rewrites. A prerequisite refactor is
- Add a dependency only when platform APIs and current dependencies cannot solve the problem cleanly.
- Prefer maintained, typed packages with compatible licenses and a narrow runtime footprint.
- Run `bun audit` after dependency changes.
- Keep the `overrides` entries on the lowest patched release; they exist only to replace versions that dependents still pin.
- The audit script ignores `GHSA-vfj7-8cjw-p6xm` (`braces`), which has no patched release upstream and only reaches the project through the shadcn CLI. Remove the ignore once `braces` publishes a fix.
- Do not remove the `@hono/node-server` override without testing shadcn add/apply, the build, and the audit.
- Do not edit `dist/`, coverage output, lockfile internals, or shadcn-generated source manually.

View File

@ -2,27 +2,19 @@
"name": "shotluma",
"description": "An AI-first, local-first canvas editor for editable App Store screenshot sets.",
"private": true,
"version": "0.5.0",
"version": "0.4.0",
"license": "MIT",
"packageManager": "bun@1.3.9",
"overrides": {
"@hono/node-server": "2.0.10",
"@modelcontextprotocol/sdk": "1.32.1",
"baseline-browser-mapping": "2.11.30",
"brace-expansion": "5.0.12",
"browserslist": "4.29.4",
"fast-uri": "3.1.8",
"hono": "4.13.13",
"ip-address": "10.7.4",
"js-yaml": "4.3.2",
"brace-expansion": "5.0.9",
"fast-uri": "3.1.5",
"hono": "4.12.34",
"ip-address": "10.4.0",
"js-yaml": "4.3.1",
"nanoid": "3.3.18",
"postcss": "8.5.25",
"postcss-selector-parser": "7.1.6",
"proxy-addr": "2.0.8",
"qs": "6.16.1",
"sharp": "0.35.5",
"source-map-js": "1.2.2",
"undici": "7.29.1"
"undici": "7.29.0"
},
"type": "module",
"scripts": {
@ -39,7 +31,7 @@
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"audit": "bun audit --ignore=GHSA-vfj7-8cjw-p6xm",
"audit": "bun audit",
"check": "bun run structure && bun run lint && bun run test:coverage && bun run build && bun run audit"
},
"dependencies": {
@ -94,7 +86,7 @@
"@types/react": "latest",
"@types/react-dom": "latest",
"@vitejs/plugin-react": "latest",
"@vitest/coverage-v8": "^4.1.12",
"@vitest/coverage-v8": "^4.1.6",
"eslint": "latest",
"eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-import-x": "^4.17.1",
@ -106,7 +98,7 @@
"typescript": "5.9.3",
"typescript-eslint": "latest",
"vite": "latest",
"vitest": "^4.1.12",
"vitest": "^4.1.6",
"wrangler": "4.118.0"
}
}

View File

@ -50,7 +50,6 @@ describe('OpenCode CORS proxy headers and methods', () => {
authorization: 'Bearer test-key',
'content-type': 'application/json',
accept: 'text/event-stream',
'x-opencode-session': 'shotluma-test-session',
cookie: 'session=secret',
host: 'app.shotluma.com',
}))
@ -58,7 +57,6 @@ describe('OpenCode CORS proxy headers and methods', () => {
authorization: 'Bearer test-key',
'content-type': 'application/json',
accept: 'text/event-stream',
'x-opencode-session': 'shotluma-test-session',
})
})

View File

@ -9,15 +9,13 @@ const ZEN_PREFIX = '/api/opencode/zen'
* the auth and versioning headers of all of them: `authorization` for the
* OpenAI Responses and Chat Completions endpoints, `x-api-key` plus the
* `anthropic-*` headers for `/v1/messages`, and `x-goog-api-key` for the Gemini
* endpoint. `x-opencode-session` carries the client session id OpenCode uses
* for routing and prompt caching. Anything outside this list (cookies, origin,
* client hints) is dropped so the proxy stays a pure credential passthrough.
* endpoint. Anything outside this list (cookies, origin, client hints) is
* dropped so the proxy stays a pure credential passthrough.
*/
export const OPENCODE_FORWARDED_HEADERS = [
'authorization',
'content-type',
'accept',
'x-opencode-session',
'x-api-key',
'anthropic-version',
'anthropic-beta',

View File

@ -1 +0,0 @@
{"result":null,"success":false,"errors":[{"code":10000,"message":"Authentication error"}],"messages":[]}

View File

@ -1,6 +1,5 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import { useAiWorkflow } from './ai/use-ai-workflow'
import { AiRunCancelDialog } from './app/AiRunCancelDialog'
import { AppHeader } from './app/AppHeader'
import { loadInitialState } from './app/project-utils'
import { ProjectDeleteDialog } from './app/ProjectDeleteDialog'
@ -59,15 +58,12 @@ export default function App() {
clearSelection,
setToast,
})
const { close: closeAi, handleActivity: handleAiActivity, cancelActiveRun: cancelAiRun, isRunActive: isAiRunActive } = ai
const { close: closeAi, handleActivity: handleAiActivity } = ai
const { commit, resetHistory } = history
const handleProjectReplaced = useCallback((project: {
slides: Slide[]
}) => {
// Safety net: whatever replaced the project, a still-running generation
// must never write into the incoming project's slides.
cancelAiRun()
const firstSlide = project.slides[0]
setActiveSlideId(firstSlide?.id ?? '')
clearSelection()
@ -75,7 +71,7 @@ export default function App() {
closeAi()
resetHistory()
if (project.slides.length === 0) setIsSidebarOpen(false)
}, [cancelAiRun, clearSelection, closeAi, handleAiActivity, resetHistory])
}, [clearSelection, closeAi, handleAiActivity, resetHistory])
const project = useProjectWorkspace({
initialProjectName: initial.projectName,
@ -87,26 +83,8 @@ export default function App() {
uploadsRef,
onProjectReplaced: handleProjectReplaced,
setToast,
isAiRunActive,
})
// A project action requested while a generation is live first asks the user
// to give up the run; the confirmed action runs after the run is cancelled.
const [pendingProjectAction, setPendingProjectAction] = useState<{ run: () => void } | null>(null)
const guardProjectAction = useCallback((action: () => void) => {
if (isAiRunActive()) setPendingProjectAction({ run: action })
else action()
}, [isAiRunActive])
const { saveCurrentProject } = project
const wasAiRunActiveRef = useRef(false)
useEffect(() => {
// Autosaves during a run carry the interrupted-generation marker; one save
// after the run ends clears it so the next load shows no stale notice.
if (wasAiRunActiveRef.current && !ai.runActive) void saveCurrentProject()
wasAiRunActiveRef.current = ai.runActive
}, [ai.runActive, saveCurrentProject])
const activeSlide = getActiveSlide(slides, activeSlideId)
const selectedElement = activeSlide?.elements.find(
(element) => element.id === selectedElementId,
@ -241,11 +219,10 @@ export default function App() {
canUndo={history.canUndo}
canRedo={history.canRedo}
aiDisabled={aiActionsDisabled}
aiRunActive={ai.runActive}
onProjectNameChange={project.setProjectName}
onOpenProject={(projectId) => guardProjectAction(() => project.openProject(projectId))}
onCreateProject={() => guardProjectAction(project.createNewProject)}
onDuplicateProject={() => guardProjectAction(project.duplicateCurrentProject)}
onOpenProject={project.openProject}
onCreateProject={project.createNewProject}
onDuplicateProject={project.duplicateCurrentProject}
onShareProject={() => setShareDialogOpen(true)}
onSaveProject={() => void project.saveCurrentProject(true)}
onRequestProjectDeletion={() => project.setDeleteDialogOpen(true)}
@ -353,20 +330,6 @@ export default function App() {
onOpenChange={project.setDeleteDialogOpen}
onConfirm={() => void project.deleteCurrentProject()}
/>
<AiRunCancelDialog
open={pendingProjectAction !== null}
projectName={project.projectName}
onOpenChange={(nextOpen) => {
if (!nextOpen) setPendingProjectAction(null)
}}
onConfirm={() => {
const pending = pendingProjectAction
setPendingProjectAction(null)
if (!pending) return
cancelAiRun()
pending.run()
}}
/>
{ai.controller && ai.open && (
<AiGenerateModal
open={ai.open}
@ -374,12 +337,8 @@ export default function App() {
controller={ai.controller}
{...(ai.targetSlide ? { targetSlide: ai.targetSlide } : {})}
onPrepareRun={ai.prepareRun}
onFinished={(result) => {
ai.handleFinished(result.slidesCreated)
if (result.appName) project.applyGeneratedProjectName(result.appName)
}}
onFinished={ai.handleFinished}
onActivity={ai.handleActivity}
onRunStateChange={ai.handleRunStateChange}
/>
)}
<div className="mobile-blocker">

View File

@ -222,41 +222,6 @@ describe('Codex App Server adapter', () => {
})
})
it('forwards GPT-6 Astra to the Codex thread and turn', async () => {
const { client, requests } = createClient((method, _params, _signal, emit) => {
if (method === 'account/read') {
return { account: { type: 'chatgpt', email: null, planType: 'plus' } }
}
if (method === 'thread/start') return { thread: { id: 'thread-1' } }
if (method === 'turn/start') {
emit({
method: 'turn/completed',
params: { threadId: 'thread-1', turnId: 'turn-1', turn: { status: 'completed' } },
})
return { turn: { id: 'turn-1' } }
}
return {}
})
await runCodexAppServerGeneration({
...baseGenerationOptions(),
selection: {
provider: 'codex',
model: 'codex/gpt-6-astra',
reasoningEffort: 'max',
},
client,
})
expect(requests.find((request) => request.method === 'thread/start')?.params).toMatchObject({
model: 'gpt-6-astra',
})
expect(requests.find((request) => request.method === 'turn/start')?.params).toMatchObject({
model: 'gpt-6-astra',
effort: 'max',
})
})
it('interrupts a turn when cancellation lands before the turn id is assigned', async () => {
const abortController = new AbortController()
let markTurnStarted: (() => void) | null = null

View File

@ -32,13 +32,4 @@ describe('buildHtmlInstructions', () => {
it('shares the bundled font library with the element prompt', () => {
expect(buildHtmlInstructions()).toContain('Bricolage Grotesque Variable')
})
it('does not prescribe a bold design or favor saturated palettes', () => {
const instructions = buildHtmlInstructions()
expect(instructions).toContain('design a cohesive set')
expect(instructions).not.toContain('design a bold, cohesive set')
expect(instructions).not.toContain('a saturated brand color or rich dark tone')
expect(instructions).not.toContain('beats a timid neutral')
})
})

View File

@ -15,7 +15,7 @@ export function buildHtmlInstructions(options: HtmlPromptOptions = {}): string {
const { targetSlideId } = options
const mission = targetSlideId
? `Your job is to edit the existing App Store screen with id "${targetSlideId}" by revising its HTML according to the user's request.`
: 'Your job is to design a cohesive set of App Store screenshots for the app the user describes, authoring each screen as one complete HTML document.'
: 'Your job is to design a bold, cohesive set of App Store screenshots for the app the user describes, authoring each screen as one complete HTML document.'
const process = targetSlideId
? `1. Call get_canvas_state first. It contains only the target screen — including its full current HTML — and the uploaded asset ids available to this run.
@ -27,7 +27,7 @@ export function buildHtmlInstructions(options: HtmlPromptOptions = {}): string {
: `1. Call get_canvas_state first. It shows the screens that already exist and the ids of every uploaded asset (screenshots and app logo).
2. Do NOT modify or delete the user's existing screens. Only create NEW screens with add_html_screen.
3. Decide how many screens to build yourself - typically 3 to 6, depending on how many screenshots were provided and how much story the app has to tell. Do not pad the set with filler screens.
4. ART DIRECTION - commit to a concept before you build anything. Study the uploaded screenshots first: unless the user asks for a different style, ADAPT THE APP'S OWN VISUAL STYLE - derive the palette (background, text color, one accent), mood, and shape language from the app's actual UI, logo, and subject so the set feels native to the app. Pick one font pairing from the list below, one highlight treatment to hold in reserve (see Design system rules for how sparingly to use it), and a composition plan that serves each screen's story role.
4. ART DIRECTION - commit to a concept before you build anything: a palette (background, text color, one accent - a saturated brand color or rich dark tone as a full-bleed background almost always beats a timid neutral), one font pairing from the list below, one highlight treatment, and a composition plan where no two adjacent screens share the same layout.
5. Call declare_plan once the plan is fixed and BEFORE the first add_html_screen, listing the screens in build order with a short name and role each ("Hero", "Ritual" - labels, not sentences).
6. Build each screen as ONE add_html_screen call carrying its complete markup, then verify it (see below) before moving to the next.
@ -94,8 +94,8 @@ After composing each screen, study the preview image: does the headline fit with
${COPYWRITING_RULES}
## Design system rules
Consistency comes first: across every screen keep the same palette, the same font pairing, the same accent color, the same highlight treatment, and a consistent shape vocabulary. Repeating a layout is fine when it serves the story - a cohesive set beats forced variety.
- Emphasis inside a headline comes first from type: size jumps between lines, weight contrast, and where the line breaks. A word highlight (accent color or one pill/underline treatment) is a scarce device on top of that - at most two screens in the whole set get one: the hero, plus at most one screen where a claim or statistic earns it. Every other headline stays a single color. When you do highlight, do not reflexively take the closing words - pick the word that carries the claim wherever it sits, keep it to one or two words, leave the sentence-final period outside it, and use the same treatment both times.
Consistency lives in the SYSTEM, not in repeating one layout. Across every screen keep the same palette, the same font pairing, the same accent color, the same highlight treatment, and a consistent shape vocabulary - while the composition changes from screen to screen.
- Style the 1-2 most meaningful words of most headlines differently: the accent color, or one pill/highlight treatment used consistently across the set. A flat single-color headline on every screen looks generic.
- Density lives inside the phone, sparsity outside: keep the canvas around the device to the headline, supporting copy, and a few deliberate accents.
- A slight device rotation (transform: rotate(-8deg) to rotate(8deg)) adds energy; alternate the direction between screens.

View File

@ -1,24 +1,7 @@
import { describe, expect, it } from 'vitest'
import {
OPENCODE_SESSION_ID,
OPENCODE_SESSION_STORAGE_KEY,
opencodeBaseUrl,
opencodeRequestHeaders,
readOpencodeSessionId,
} from './opencode-client'
import { opencodeBaseUrl } from './opencode-client'
import { opencodeRequestModelId } from './opencode-models'
const createMemoryStorage = (initial: Record<string, string> = {}) => {
const entries = new Map(Object.entries(initial))
return {
entries,
getItem: (key: string) => entries.get(key) ?? null,
setItem: (key: string, value: string) => {
entries.set(key, value)
},
}
}
describe('OpenCode client routing', () => {
it('builds same-origin proxy base URLs for Zen and Go', () => {
expect(opencodeBaseUrl('opencode-zen', 'https://app.shotluma.com'))
@ -31,28 +14,4 @@ describe('OpenCode client routing', () => {
expect(opencodeRequestModelId('opencode-go/glm-5.3', 'glm-5.3')).toBe('glm-5.3')
expect(opencodeRequestModelId('opencode-zen/kimi-k3')).toBe('kimi-k3')
})
it('identifies every request with a stable session header', () => {
const headers = opencodeRequestHeaders()
expect(headers['x-opencode-session']).toBe(OPENCODE_SESSION_ID)
expect(opencodeRequestHeaders()['x-opencode-session']).toBe(OPENCODE_SESSION_ID)
})
it('reuses a stored session id so it survives a full page reload', () => {
const storage = createMemoryStorage({ [OPENCODE_SESSION_STORAGE_KEY]: 'shotluma-stored' })
expect(readOpencodeSessionId(storage)).toBe('shotluma-stored')
})
it('generates and persists a session id when storage is empty', () => {
const storage = createMemoryStorage()
const generated = readOpencodeSessionId(storage)
expect(generated).toMatch(/^shotluma-/u)
expect(storage.entries.get(OPENCODE_SESSION_STORAGE_KEY)).toBe(generated)
expect(readOpencodeSessionId(storage)).toBe(generated)
})
it('falls back to a per-page-load id when storage is unavailable', () => {
expect(readOpencodeSessionId(null)).toMatch(/^shotluma-/u)
expect(readOpencodeSessionId(null)).not.toBe(readOpencodeSessionId(null))
})
})

View File

@ -1,56 +1,8 @@
import { generateText, type FilePart } from 'ai'
import { uid } from '../utils'
import { OPENCODE_VISION_PROMPT, toVisionFilePart } from './describe-images'
import { opencodeModelDialect } from './opencode-dialects'
import type { OpencodeProviderId } from './opencode-models'
export const OPENCODE_SESSION_STORAGE_KEY = 'shotluma-opencode-session'
type SessionIdStorage = Pick<Storage, 'getItem' | 'setItem'>
const getSessionStorage = (): SessionIdStorage | null => {
try {
return typeof sessionStorage === 'undefined' ? null : sessionStorage
} catch {
return null
}
}
/**
* OpenCode Go and Zen expect a stable session id on every request so the
* gateway can route traffic and reuse prompt caches:
* https://opencode.ai/docs/go/#where-can-i-use-it
*
* sessionStorage keeps the id stable across full page reloads in one browser
* tab while naturally sharding traffic across clients. Storage that is
* unavailable or throws degrades to an id that only survives the page load.
*/
export const readOpencodeSessionId = (
storage: SessionIdStorage | null = getSessionStorage(),
): string => {
if (!storage) return uid('shotluma')
try {
const stored = storage.getItem(OPENCODE_SESSION_STORAGE_KEY)
if (stored) return stored
} catch {
return uid('shotluma')
}
const generated = uid('shotluma')
try {
storage.setItem(OPENCODE_SESSION_STORAGE_KEY, generated)
} catch {
// The id still serves this page load; only persistence is unavailable.
}
return generated
}
export const OPENCODE_SESSION_ID = readOpencodeSessionId()
/** Identifies Shotluma traffic to the OpenCode gateways on every request. */
export const opencodeRequestHeaders = (): Record<string, string> => ({
'x-opencode-session': OPENCODE_SESSION_ID,
})
export const opencodeBaseUrl = (
providerId: OpencodeProviderId,
origin: string,
@ -73,19 +25,19 @@ export const createOpencodeModel = async (options: {
switch (opencodeModelDialect(providerId, modelId)) {
case 'responses': {
const { createOpenAI } = await import('@ai-sdk/openai')
return createOpenAI({ apiKey, baseURL, headers: opencodeRequestHeaders() }).responses(modelId)
return createOpenAI({ apiKey, baseURL }).responses(modelId)
}
case 'messages': {
const { createAnthropic } = await import('@ai-sdk/anthropic')
return createAnthropic({ apiKey, baseURL, headers: opencodeRequestHeaders() })(modelId)
return createAnthropic({ apiKey, baseURL })(modelId)
}
case 'google': {
const { createGoogle } = await import('@ai-sdk/google')
return createGoogle({ apiKey, baseURL, headers: opencodeRequestHeaders() })(modelId)
return createGoogle({ apiKey, baseURL })(modelId)
}
case 'chat': {
const { createOpenAI } = await import('@ai-sdk/openai')
return createOpenAI({ apiKey, baseURL, headers: opencodeRequestHeaders() }).chat(modelId)
return createOpenAI({ apiKey, baseURL }).chat(modelId)
}
}
}

View File

@ -26,17 +26,6 @@ describe('AI prompt language', () => {
})
})
describe('AI prompt art direction', () => {
it('does not prescribe a bold design or favor saturated palettes', () => {
const instructions = buildInstructions()
expect(instructions).toContain('design a cohesive set')
expect(instructions).not.toContain('design a bold, cohesive set')
expect(instructions).not.toContain('a saturated brand color or a rich dark tone')
expect(instructions).not.toContain('beats a timid neutral')
})
})
describe('AI prompt branding', () => {
it('requires logo placement via add_image in generate mode', () => {
const instructions = buildInstructions()

View File

@ -48,7 +48,7 @@ export function buildInstructions(options: AiPromptOptions = {}): string {
const { targetSlideId, enableOverlayAssets } = options
const mission = targetSlideId
? `Your job is to edit the existing App Store screen with id "${targetSlideId}" according to the user's request.`
: 'Your job is to design a cohesive set of App Store screenshots for the app the user describes.'
: 'Your job is to design a bold, cohesive set of App Store screenshots for the app the user describes.'
const process = targetSlideId
? `1. Call get_canvas_state first. It contains only the target screen and the uploaded asset ids available to this run.
2. Work ONLY on slide "${targetSlideId}". You cannot create or delete slides, and you must not attempt to access another slide id.
@ -59,10 +59,9 @@ export function buildInstructions(options: AiPromptOptions = {}): string {
: `1. The user message already lists every screenshot and logo asset available to this run. Do NOT modify or delete existing slides; create only NEW slides for this design.
2. Decide how many screens to build yourself - typically 3 to 6, depending on how many screenshots were provided and how much story the app has to tell. Do not pad the set with filler screens just to hit a number.
3. ART DIRECTION - commit to a concept before you build anything:
- Study the uploaded screenshots first. Unless the user asks for a different style, ADAPT THE APP'S OWN VISUAL STYLE: derive the palette, mood, and shape language from the app's actual UI, logo, and subject so the set feels native to the app rather than imposed on it.
- Palette: background, text color, one accent - taken from that app style.
- Palette: background, text color, one accent. Be confident - a saturated brand color or a rich dark tone as a full-bleed background almost always beats a timid neutral. Take cues from the app's own screenshots, logo, and subject.
- One font pairing (a display face for headlines, a quieter face for supporting copy) and ONE highlight treatment.
- A composition plan: assign every slide an archetype from the library below, chosen to serve each slide's story role.
- A composition plan: assign every slide an archetype from the library below. No two adjacent slides may use the same archetype, and a set should use at least 3 different ones.
4. In your FIRST tool turn, call declare_plan and add_slides together, in that order and exactly once each. Their screen lists must match. add_slides creates every planned screen at once and returns all ids in build order.
5. In the next turn, build using those returned ids. Emit each slide's full planned composition as ONE batched turn (see "Batch your tool calls"), then run the verify routine before moving on.`
const layoutContext = targetSlideId
@ -77,7 +76,7 @@ export function buildInstructions(options: AiPromptOptions = {}): string {
: 'After the LAST slide, do not re-render screens that already passed their preview. Their latest previews remain in the conversation; request another preview only if a later change affected that screen.'
const consistency = targetSlideId
? 'Keep the screen consistent with its existing visual system unless the user explicitly requests a redesign.'
: 'Consistency comes first: across every slide keep the same palette, the same font pairing, the same accent color, the same highlight treatment, the same device screenTheme, and a consistent shape vocabulary. Repeating an archetype is fine when it serves the story - a cohesive set beats forced variety.'
: 'Consistency lives in the SYSTEM, not in repeating one layout. Across every slide keep the same palette, the same font pairing, the same accent color, the same highlight treatment, the same device screenTheme, and a consistent shape vocabulary - while the composition changes from slide to slide via the archetypes.'
const brandRule = targetSlideId
? 'If the user provides an app name or logo for this edit, use them only when the requested change calls for branding updates.'
: `BRANDING is required when the user provides an app name and/or logo:
@ -194,7 +193,7 @@ ${finalReview}
## Design system rules
${consistency}
- Backgrounds: the same treatment on every slide, or a single deliberate progression (e.g. darkening, or cycling through a fixed palette) - never random colors per slide. Solid fills, linear/radial gradients, or uploaded images with an overlay; subtle dots, grid, diagonal, or wave patterns are available.
- Typography should feel designed, not typed. Emphasis comes first from type itself: size jumps between lines, weight contrast, and where you break the line. add_text and update_element also accept a "highlights" array that styles individual words inside a text (a different color, a background pill via backgroundColor + backgroundOpacity + borderRadius + padding, bold/italic/underline contrast, or reduced opacity) - treat that as a scarce device, not a default. At most two slides in the whole set carry a word highlight: the hero, plus at most one slide where a claim or statistic genuinely earns it. Every other headline stays a single color. When you do highlight, do not reflexively take the closing words - pick the word that actually carries the claim wherever it sits, keep it to one or two words, and leave the sentence-final period outside the highlight. Use the same treatment for both.
- Typography should feel designed, not typed. add_text and update_element accept a "highlights" array that styles individual words inside a text: a different color, a background pill (backgroundColor + backgroundOpacity + borderRadius + padding), bold/italic/underline contrast, or reduced opacity for de-emphasis. In most headlines, set the 1-2 most meaningful words apart — typically in the accent color, or with a highlight pill for one hero moment or a statistic. A flat single-color headline on every slide looks generic. Pick ONE highlight treatment and keep it consistent across the set.
- Use the expanded vector library intentionally: geometric forms, stars/bursts, blobs/arches, rings, lines, arrows, and waves. Decorative elements should clarify flow or establish rhythm, not fill empty space at random. A large blob, arch, or wave running behind a device and off the canvas edge adds depth cheaply.
- Use Hugeicons (add_icon) for feature bullets, status indicators, social proof marks, rating stars, and UI-style accents. Icons render as crisp vector SVG at any size. Common uses: a check or badge-check icon next to a feature line, a star icon for ratings, a lock/shield icon for security claims, a rocket or zap icon for performance messaging. Keep icon sizing consistent within a slide (e.g. all feature-row icons at width 6-8) and pick a single color for the set (usually the accent color or white). NEVER use emoji characters on canvas — always use add_icon instead.
- Text can use a colored box, padding, rounded corners, outline, and shadow. Reserve these treatments for labels, statistics, or one deliberate hero treatment; ordinary body copy should remain clean.

View File

@ -56,26 +56,6 @@ describe('AI provider catalog', () => {
id: 'codex/gpt-5.6-terra',
providerModelId: 'gpt-5.6-terra',
})
expect(getAiProvider('codex').models.map((model) => model.id)).toEqual([
'codex/gpt-5.6-terra',
'codex/gpt-6-astra',
'codex/gpt-5.6-sol',
'codex/gpt-5.6-luna',
])
expect(getAiProvider('openai').models.map((model) => model.id)).toEqual([
'gpt-5.6-terra',
'gpt-6-astra',
'gpt-5.6-sol',
'gpt-5.6-luna',
])
expect(getAiModel({ provider: 'codex', model: 'codex/gpt-6-astra' })).toMatchObject({
providerModelId: 'gpt-6-astra',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
})
expect(getAiModel({ provider: 'openai', model: 'gpt-6-astra' })).toMatchObject({
label: 'GPT-6 Astra',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
})
expect(getAiProvider('xai').models.map((model) => model.id)).toEqual([
'grok-4.6',
'grok-4.5',
@ -180,7 +160,6 @@ describe('AI provider catalog', () => {
['low', 'medium', 'high', 'xhigh', 'max'],
['low', 'medium', 'high', 'xhigh', 'max'],
['low', 'medium', 'high', 'xhigh', 'max'],
['low', 'medium', 'high', 'xhigh', 'max'],
])
expect(getAiProvider('moonshot').models[0]?.reasoningEfforts).toEqual([
'low',
@ -206,16 +185,6 @@ describe('AI provider catalog', () => {
model: 'gpt-5.6-sol',
reasoningEffort: 'xhigh',
})).toBe('xhigh')
expect(getAiSdkReasoningEffort({
provider: 'openai',
model: 'gpt-6-astra',
reasoningEffort: 'minimal',
})).toBe('high')
expect(getAiSdkReasoningEffort({
provider: 'openai',
model: 'gpt-6-astra',
reasoningEffort: 'max',
})).toBe('max')
expect(getAiSdkReasoningEffort({
provider: 'openai',
model: 'gpt-5.6-luna',

View File

@ -81,7 +81,7 @@ const STANDARD_REASONING_EFFORTS = [
'xhigh',
] as const satisfies readonly AiReasoningEffort[]
/** GPT-6 Astra and GPT-5.6: low … xhigh / max (`max` via providerOptions). */
/** GPT-5.6 Luna / Terra / Sol: low … xhigh / max (`max` via providerOptions). */
const OPENAI_REASONING_EFFORTS = [
'low',
'medium',
@ -126,18 +126,11 @@ export const AI_PROVIDERS: readonly AiProviderOption[] = [
description: 'Recommended · uses your ChatGPT plan, no API key',
reasoningEfforts: OPENAI_REASONING_EFFORTS,
},
{
id: 'codex/gpt-6-astra',
providerModelId: 'gpt-6-astra',
label: 'GPT-6 Astra',
description: 'Most capable · uses your ChatGPT plan',
reasoningEfforts: OPENAI_REASONING_EFFORTS,
},
{
id: 'codex/gpt-5.6-sol',
providerModelId: 'gpt-5.6-sol',
label: 'GPT-5.6 Sol',
description: 'Previous flagship · uses your ChatGPT plan',
description: 'Highest quality · uses your ChatGPT plan',
reasoningEfforts: OPENAI_REASONING_EFFORTS,
},
{
@ -231,16 +224,10 @@ export const AI_PROVIDERS: readonly AiProviderOption[] = [
description: 'Recommended · balanced quality and cost',
reasoningEfforts: OPENAI_REASONING_EFFORTS,
},
{
id: 'gpt-6-astra',
label: 'GPT-6 Astra',
description: 'Most capable for complex agentic work',
reasoningEfforts: OPENAI_REASONING_EFFORTS,
},
{
id: 'gpt-5.6-sol',
label: 'GPT-5.6 Sol',
description: 'Previous flagship for agentic work',
description: 'Highest quality for agentic work',
reasoningEfforts: OPENAI_REASONING_EFFORTS,
},
{

View File

@ -75,25 +75,17 @@ export function useAiWorkflow({
const activitySequence = useRef(0)
const followedSlideId = useRef<string | null>(null)
const preRunSlideIds = useRef<Set<string>>(new Set())
const [runActive, setRunActive] = useState(false)
const runControlRef = useRef<{ cancel: () => void } | null>(null)
const runActiveRef = useRef(false)
useEffect(() => {
setController(createAiController({
getSlides: () => slidesRef.current,
// Writes are gated on the registered run: after an external cancel (for
// example a project switch) an in-flight tool result must not land in
// whatever project the refs point to by then.
setSlides: (updater) => {
if (!runActiveRef.current) return
const next = updater(slidesRef.current)
slidesRef.current = next
setSlides(next)
},
getUploads: () => uploadsRef.current,
setUploads: (updater) => {
if (!runActiveRef.current) return
const next = updater(uploadsRef.current)
uploadsRef.current = next
setUploads(next)
@ -101,33 +93,6 @@ export function useAiWorkflow({
}))
}, [setSlides, setUploads, slidesRef, uploadsRef])
const handleRunStateChange = useCallback((control: { cancel: () => void } | null) => {
runControlRef.current = control
runActiveRef.current = control !== null
setRunActive(control !== null)
}, [])
const isRunActive = useCallback(() => runActiveRef.current, [])
const cancelActiveRun = useCallback(() => {
const control = runControlRef.current
runControlRef.current = null
runActiveRef.current = false
setRunActive(false)
control?.cancel()
followedSlideId.current = null
setActivity(null)
}, [])
useEffect(() => {
if (!runActive) return
const warnBeforeUnload = (event: BeforeUnloadEvent) => {
event.preventDefault()
}
window.addEventListener('beforeunload', warnBeforeUnload)
return () => window.removeEventListener('beforeunload', warnBeforeUnload)
}, [runActive])
const targetSlide = targetSlideId
? slides.find((slide) => slide.id === targetSlideId)
: undefined
@ -231,10 +196,6 @@ export function useAiWorkflow({
open,
targetSlide,
activity,
runActive,
isRunActive,
cancelActiveRun,
handleRunStateChange,
handleActivity,
prepareRun,
openGenerator,

View File

@ -1,58 +0,0 @@
import { AiGenerative } from '../components/icons'
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogMedia,
AlertDialogTitle,
} from '../components/ui/alert-dialog'
type AiRunCancelDialogProps = {
open: boolean
projectName: string
onOpenChange: (open: boolean) => void
onConfirm: () => void
}
/**
* Asks before a project switch, creation, or duplication is allowed to end a
* live AI generation. Dismissing keeps the run going; confirming cancels the
* run and then performs the requested project action.
*/
export function AiRunCancelDialog({
open,
projectName,
onOpenChange,
onConfirm,
}: AiRunCancelDialogProps) {
return (
<AlertDialog open={open} onOpenChange={onOpenChange}>
<AlertDialogContent className="ai-run-cancel-dialog">
<AlertDialogHeader>
<AlertDialogMedia><AiGenerative size={17} /></AlertDialogMedia>
<AlertDialogTitle>Stop the AI generation?</AlertDialogTitle>
<AlertDialogDescription>
An AI generation is still running in “{projectName}”. Leaving now cancels it —
finished screens are kept, the screen being built is lost.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel className="ai-run-cancel-keep">
Keep generating
</AlertDialogCancel>
<AlertDialogAction
className="ai-run-cancel-confirm"
variant="destructive"
onClick={onConfirm}
>
Stop and continue
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
)
}

View File

@ -42,7 +42,6 @@ const headerProps = {
canUndo: false,
canRedo: false,
aiDisabled: false,
aiRunActive: false,
onProjectNameChange: () => undefined,
onOpenProject: () => undefined,
onCreateProject: () => undefined,
@ -99,24 +98,4 @@ describe('App header', () => {
expect(markup).toMatch(/aria-label="New project"[^>]*disabled/)
})
it('holds back project deletion while an AI generation is running', () => {
const markup = renderToStaticMarkup(
<AppHeader
{...headerProps}
projects={[...headerProps.projects, {
id: 'project-2',
projectName: 'Second project',
createdAt: 1_700_000_000_000,
savedAt: 1_700_000_000_000,
}]}
aiRunActive
saveStatus="saved"
persistenceReady
/>,
)
expect(markup).toContain('Delete waits for the AI run')
expect(markup).not.toContain('Delete current project')
})
})

View File

@ -43,8 +43,6 @@ type AppHeaderProps = {
canUndo: boolean
canRedo: boolean
aiDisabled: boolean
/** True while an AI generation is running; project deletion is held back until it ends. */
aiRunActive: boolean
onProjectNameChange: (name: string) => void
onOpenProject: (projectId: string) => void
onCreateProject: () => void
@ -63,7 +61,6 @@ function ProjectMenu({
projects,
currentProjectId,
disabled,
aiRunActive,
onOpenProject,
onCreateProject,
onDuplicateProject,
@ -74,7 +71,6 @@ function ProjectMenu({
AppHeaderProps,
| 'projects'
| 'currentProjectId'
| 'aiRunActive'
| 'onOpenProject'
| 'onCreateProject'
| 'onDuplicateProject'
@ -137,11 +133,11 @@ function ProjectMenu({
<DropdownMenuItem
className="project-menu-action"
variant="destructive"
disabled={disabled || projects.length <= 1 || aiRunActive}
disabled={disabled || projects.length <= 1}
onClick={onRequestProjectDeletion}
>
<Trash2 size={15} />
<span>{aiRunActive ? 'Delete waits for the AI run' : 'Delete current project'}</span>
<span>Delete current project</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@ -216,7 +212,6 @@ export function AppHeader({
canUndo,
canRedo,
aiDisabled,
aiRunActive,
onProjectNameChange,
onOpenProject,
onCreateProject,
@ -267,7 +262,6 @@ export function AppHeader({
projects={projects}
currentProjectId={currentProjectId}
disabled={projectMenuDisabled}
aiRunActive={aiRunActive}
onOpenProject={onOpenProject}
onCreateProject={onCreateProject}
onDuplicateProject={onDuplicateProject}

View File

@ -1,10 +1,8 @@
import { beforeEach, describe, expect, it } from 'vitest'
import {
consumeInterruptedGeneration,
DEFAULT_PROJECT_NAME,
getUniqueProjectName,
loadInitialState,
resolveGeneratedProjectName,
sortProjectSummaries,
upsertProjectSummary,
} from './project-utils'
@ -107,61 +105,3 @@ describe('project utilities', () => {
expect(getUniqueProjectName(projects, 'Launch')).toBe('Launch')
})
})
describe('generated project names', () => {
const projects = [
summary('current', 'New Project 2', 3),
summary('other', 'Aurora', 2),
summary('third', 'Aurora 2', 1),
]
it('adopts the app name while the title is still auto-assigned', () => {
expect(resolveGeneratedProjectName(projects, 'current', 'New Project 2', 'Lumen'))
.toBe('Lumen')
expect(resolveGeneratedProjectName(projects, 'current', 'New Project', 'Lumen'))
.toBe('Lumen')
expect(resolveGeneratedProjectName(projects, 'current', DEFAULT_PROJECT_NAME, 'Lumen'))
.toBe('Lumen')
expect(resolveGeneratedProjectName(projects, 'current', ' ', 'Lumen'))
.toBe('Lumen')
})
it('numbers the app name past the other projects that already use it', () => {
expect(resolveGeneratedProjectName(projects, 'current', 'New Project 2', 'aurora'))
.toBe('aurora 3')
})
it('ignores the current project when deduplicating', () => {
const named = [summary('current', 'New Project', 1)]
expect(resolveGeneratedProjectName(named, 'current', 'New Project', 'New Project'))
.toBe('New Project')
})
it('keeps a title the user typed', () => {
expect(resolveGeneratedProjectName(projects, 'other', 'Aurora', 'Lumen')).toBe(null)
expect(resolveGeneratedProjectName(projects, 'current', 'New Project Ideas', 'Lumen'))
.toBe(null)
})
it('keeps the title when no app name was entered', () => {
expect(resolveGeneratedProjectName(projects, 'current', 'New Project 2', ' '))
.toBe(null)
})
})
describe('consumeInterruptedGeneration', () => {
it('returns null for a project without the marker', () => {
expect(consumeInterruptedGeneration(persistedProject('p1', 'Aurora', 10))).toBe(null)
})
it('strips the marker and keeps everything else', () => {
const project = { ...persistedProject('p1', 'Aurora', 10), interruptedGeneration: true as const }
const cleared = consumeInterruptedGeneration(project)
expect(cleared).toEqual(persistedProject('p1', 'Aurora', 10))
expect(cleared && 'interruptedGeneration' in cleared).toBe(false)
expect(project.interruptedGeneration).toBe(true)
})
})

View File

@ -32,20 +32,6 @@ export const upsertProjectSummary = (
},
])
/**
* Returns a copy of the project without the interrupted-generation marker, or
* null when the project carries none. The caller persists the cleared copy and
* shows the one-time interruption notice, so the marker never fires twice.
*/
export const consumeInterruptedGeneration = (
project: PersistedProject,
): PersistedProject | null => {
if (!project.interruptedGeneration) return null
const { interruptedGeneration, ...cleared } = project
void interruptedGeneration
return cleared
}
export const getUniqueProjectName = (
projects: ProjectSummary[],
desiredName: string,
@ -58,36 +44,6 @@ export const getUniqueProjectName = (
return `${desiredName} ${suffix}`
}
const AUTO_PROJECT_NAME_PATTERN = /^new project(?: \d+)?$/
/**
* True while the title is still one the app assigned itself — the seed project,
* an untitled one, or a "New Project 3". Only those may be replaced silently.
*/
const isAutoProjectName = (name: string) => {
const normalized = name.trim().toLocaleLowerCase('en-US')
return normalized === ''
|| normalized === DEFAULT_PROJECT_NAME.toLocaleLowerCase('en-US')
|| AUTO_PROJECT_NAME_PATTERN.test(normalized)
}
/**
* The title an AI generation run should leave behind: the app name the user
* entered, deduplicated against the other projects. Returns `null` when the
* title must stay untouched, so a name the user typed is never overwritten.
*/
export const resolveGeneratedProjectName = (
projects: ProjectSummary[],
currentProjectId: string,
currentName: string,
appName: string,
): string | null => {
const desiredName = appName.trim()
if (!desiredName || !isAutoProjectName(currentName)) return null
const otherProjects = projects.filter((project) => project.id !== currentProjectId)
return getUniqueProjectName(otherProjects, desiredName)
}
export const formatProjectTime = (timestamp: number) => new Date(timestamp).toLocaleString('en-US', {
day: 'numeric',
month: 'short',

View File

@ -1,61 +0,0 @@
import { describe, expect, it } from 'vitest'
import { deriveSharePreviewPalette } from './share-preview-palette'
type Rgb = readonly [number, number, number]
const makePixels = (width: number, height: number, color: Rgb, alpha = 255) => {
const pixels = new Uint8ClampedArray(width * height * 4)
for (let index = 0; index < width * height; index += 1) {
const offset = index * 4
pixels[offset] = color[0]
pixels[offset + 1] = color[1]
pixels[offset + 2] = color[2]
pixels[offset + 3] = alpha
}
return pixels
}
const setPixel = (pixels: Uint8ClampedArray, width: number, x: number, y: number, color: Rgb) => {
const offset = (y * width + x) * 4
pixels[offset] = color[0]
pixels[offset + 1] = color[1]
pixels[offset + 2] = color[2]
pixels[offset + 3] = 255
}
describe('deriveSharePreviewPalette', () => {
it('uses the dominant and contrasting colors from the rendered screen edges', () => {
const width = 10
const height = 10
const pixels = makePixels(width, height, [244, 236, 215])
for (let y = 0; y < 2; y += 1) {
for (let x = 0; x < width; x += 1) setPixel(pixels, width, x, y, [242, 165, 55])
}
expect(deriveSharePreviewPalette(pixels, width, height)).toEqual({
color1: '#f4ecd7',
color2: '#f2a537',
})
})
it('ignores focal content in the center and insignificant edge noise', () => {
const width = 12
const height = 12
const pixels = makePixels(width, height, [223, 232, 218])
for (let y = 4; y < 8; y += 1) {
for (let x = 4; x < 8; x += 1) setPixel(pixels, width, x, y, [12, 13, 18])
}
setPixel(pixels, width, 0, 0, [255, 0, 255])
expect(deriveSharePreviewPalette(pixels, width, height)).toEqual({
color1: '#dfe8da',
color2: '#dfe8da',
})
})
it('returns no palette when dimensions or visible pixels are unavailable', () => {
expect(deriveSharePreviewPalette(new Uint8ClampedArray(), 0, 0)).toBeNull()
expect(deriveSharePreviewPalette(new Uint8ClampedArray(3), 1, 1)).toBeNull()
expect(deriveSharePreviewPalette(makePixels(2, 2, [255, 255, 255], 0), 2, 2)).toBeNull()
})
})

View File

@ -1,97 +0,0 @@
export type SharePreviewPalette = {
color1: string
color2: string
}
type ColorBucket = {
count: number
red: number
green: number
blue: number
}
const EDGE_INSET_RATIO = 0.18
const MIN_SECONDARY_SHARE = 0.03
const MIN_SECONDARY_DISTANCE = 36
const QUANTIZATION_SHIFT = 4
const isEdgePixel = (x: number, y: number, width: number, height: number) => {
const horizontalInset = Math.max(1, Math.ceil(width * EDGE_INSET_RATIO))
const verticalInset = Math.max(1, Math.ceil(height * EDGE_INSET_RATIO))
return x < horizontalInset
|| x >= width - horizontalInset
|| y < verticalInset
|| y >= height - verticalInset
}
const colorDistance = (left: ColorBucket, right: ColorBucket) => Math.hypot(
left.red / left.count - right.red / right.count,
left.green / left.count - right.green / right.count,
left.blue / left.count - right.blue / right.count,
)
const toHex = (value: number) => Math.round(value).toString(16).padStart(2, '0')
const bucketToHex = ({ red, green, blue, count }: ColorBucket) =>
`#${toHex(red / count)}${toHex(green / count)}${toHex(blue / count)}`
const chooseSecondary = (primary: ColorBucket, buckets: ColorBucket[]) => {
const minimumCount = Math.max(2, Math.ceil(primary.count * MIN_SECONDARY_SHARE))
let best = primary
let bestScore = 0
for (const bucket of buckets) {
if (bucket === primary || bucket.count < minimumCount) continue
const distance = colorDistance(primary, bucket)
const score = bucket.count * distance
if (distance >= MIN_SECONDARY_DISTANCE && score > bestScore) {
best = bucket
bestScore = score
}
}
return best
}
/**
* Finds representative colors along a rendered screen's perimeter. Sampling
* the perimeter favors the design surface over text, devices, and other focal
* content in the middle of the artboard.
*/
export const deriveSharePreviewPalette = (
pixels: Uint8ClampedArray,
width: number,
height: number,
): SharePreviewPalette | null => {
if (!Number.isInteger(width) || !Number.isInteger(height) || width <= 0 || height <= 0) return null
if (pixels.length < width * height * 4) return null
const buckets = new Map<number, ColorBucket>()
for (let y = 0; y < height; y += 1) {
for (let x = 0; x < width; x += 1) {
if (!isEdgePixel(x, y, width, height)) continue
const offset = (y * width + x) * 4
const alpha = pixels[offset + 3] ?? 0
if (alpha < 128) continue
const red = pixels[offset] ?? 0
const green = pixels[offset + 1] ?? 0
const blue = pixels[offset + 2] ?? 0
const key = ((red >> QUANTIZATION_SHIFT) << 8)
| ((green >> QUANTIZATION_SHIFT) << 4)
| (blue >> QUANTIZATION_SHIFT)
const bucket = buckets.get(key)
if (bucket) {
bucket.count += 1
bucket.red += red
bucket.green += green
bucket.blue += blue
} else {
buckets.set(key, { count: 1, red, green, blue })
}
}
}
const sorted = [...buckets.values()].sort((left, right) => right.count - left.count)
const primary = sorted[0]
if (!primary) return null
const secondary = chooseSecondary(primary, sorted)
return { color1: bucketToHex(primary), color2: bucketToHex(secondary) }
}

View File

@ -1,12 +1,11 @@
import { toCanvas } from 'html-to-image'
import { EXPORT_ARTBOARD_WIDTH, EXPORT_FORMATS } from './export-formats'
import { deriveSharePreviewPalette, type SharePreviewPalette } from './share-preview-palette'
import type { Slide } from '../types'
/**
* Renders the Open Graph preview image for a share link: up to three screens
* captured from the live artboard DOM, composed on a gradient sampled from the
* rendered first screen, with the project name set in the UI face.
* captured from the live artboard DOM, composed on a gradient drawn from the
* first screen's background colors, with the project name set in the UI face.
* The share flow treats the preview as best-effort — any failure returns null
* and the link still works, it just unfurls without an image.
*/
@ -134,25 +133,9 @@ const wrapProjectName = (
})
}
const fallbackPalette = (slide: Slide | undefined): SharePreviewPalette => ({
color1: slide?.background.color1 ?? '#101014',
color2: slide?.background.color2 ?? '#1c1c26',
})
const renderedPalette = (screen: HTMLCanvasElement | null | undefined): SharePreviewPalette | null => {
if (!screen) return null
const context = screen.getContext('2d', { willReadFrequently: true })
if (!context) return null
try {
const pixels = context.getImageData(0, 0, screen.width, screen.height).data
return deriveSharePreviewPalette(pixels, screen.width, screen.height)
} catch {
return null
}
}
const drawBackdrop = (context: CanvasRenderingContext2D, palette: SharePreviewPalette) => {
const { color1, color2 } = palette
const drawBackdrop = (context: CanvasRenderingContext2D, slide: Slide | undefined) => {
const color1 = slide?.background.color1 ?? '#101014'
const color2 = slide?.background.color2 ?? '#1c1c26'
const gradient = context.createLinearGradient(0, 0, SHARE_PREVIEW_WIDTH, SHARE_PREVIEW_HEIGHT)
gradient.addColorStop(0, parseHexColor(color1) ? color1 : '#101014')
gradient.addColorStop(1, parseHexColor(color2) ? color2 : '#1c1c26')
@ -225,8 +208,7 @@ export const createSharePreviewImage = async (
const context = canvas.getContext('2d')
if (!context) return null
const palette = renderedPalette(screens[0]) ?? fallbackPalette(shown[0])
const onLight = drawBackdrop(context, palette)
const onLight = drawBackdrop(context, shown[0])
screens
.map((screen, index) => ({ screen, placement: placements[index] }))
.filter((entry): entry is { screen: HTMLCanvasElement; placement: ScreenPlacement } =>

View File

@ -12,13 +12,7 @@ import {
type ProjectSummary,
} from '../persistence'
import { uid } from '../utils'
import {
consumeInterruptedGeneration,
DEFAULT_PROJECT_NAME,
getUniqueProjectName,
resolveGeneratedProjectName,
upsertProjectSummary,
} from './project-utils'
import { DEFAULT_PROJECT_NAME, getUniqueProjectName, upsertProjectSummary } from './project-utils'
import { consumeShareLinkHash, decodeSharePayload } from './share-link'
import type { Slide, UploadAsset } from '../types'
import type { SaveStatus } from './project-types'
@ -33,17 +27,8 @@ type ProjectWorkspaceOptions = {
uploadsRef: RefObject<UploadAsset[]>
onProjectReplaced: (project: PersistedProject) => void
setToast: Dispatch<SetStateAction<string | null>>
/**
* True while an AI generation is running. Saves made during a run carry the
* interrupted-generation marker, so a project closed mid-run can explain the
* half-finished screens on its next load.
*/
isAiRunActive: () => boolean
}
const INTERRUPTED_GENERATION_MESSAGE =
'The last AI generation was interrupted — finished screens were kept'
const makeNewProject = (
projectName: string,
slides: Slide[],
@ -121,7 +106,6 @@ export function useProjectWorkspace({
uploadsRef,
onProjectReplaced,
setToast,
isAiRunActive,
}: ProjectWorkspaceOptions) {
const [projectName, setProjectNameState] = useState(initialProjectName)
const projectNameRef = useRef(initialProjectName)
@ -179,17 +163,12 @@ export function useProjectWorkspace({
const sharedImport = await importSharedProjectOnce(workspace.projects)
const imported = sharedImport.status === 'imported' ? sharedImport.project : null
let project = imported ?? workspace.activeProject ?? makeNewProject(
const project = imported ?? workspace.activeProject ?? makeNewProject(
projectNameRef.current,
slidesRef.current,
uploadsRef.current,
)
if (!imported && !workspace.activeProject) await saveProject(project)
const interrupted = consumeInterruptedGeneration(project)
if (interrupted) {
project = interrupted
await saveProject(project)
}
await setActiveProjectId(project.id)
if (isCancelled()) return
@ -201,8 +180,6 @@ export function useProjectWorkspace({
setToast('Shared project imported as your own local copy')
} else if (sharedImport.status === 'invalid') {
setToast('Couldn’t open the shared project link')
} else if (interrupted) {
setToast(INTERRUPTED_GENERATION_MESSAGE)
}
if (sharedImport.status !== 'none') settleSharedImport()
removeLegacyProject()
@ -245,7 +222,6 @@ export function useProjectWorkspace({
uploads: uploadsRef.current,
createdAt: currentProjectCreatedAtRef.current,
savedAt,
...(isAiRunActive() ? { interruptedGeneration: true as const } : {}),
}
setSaveStatus('saving')
@ -271,7 +247,7 @@ export function useProjectWorkspace({
if (showConfirmation) setToast('Couldn’t save locally')
return false
}
}, [isAiRunActive, setToast, slidesRef, uploadsRef])
}, [setToast, slidesRef, uploadsRef])
const runProjectTransition = useCallback(async (
operation: () => Promise<PersistedProject>,
@ -287,18 +263,13 @@ export function useProjectWorkspace({
projectTransitionRef.current = true
try {
let project = await operation()
const interrupted = consumeInterruptedGeneration(project)
if (interrupted) {
project = interrupted
await saveProject(project)
}
const project = await operation()
await setActiveProjectId(project.id)
skipNextAutoSaveRef.current = true
replaceProject(project)
setProjects((current) => upsertProjectSummary(current, project))
setSaveStatus('saved')
setToast(interrupted ? INTERRUPTED_GENERATION_MESSAGE : successMessage)
setToast(successMessage)
} catch {
setSaveStatus('error')
setToast(errorMessage)
@ -328,16 +299,6 @@ export function useProjectWorkspace({
}, 'New project created', 'Couldn’t create project')
}, [projects, runProjectTransition])
const applyGeneratedProjectName = useCallback((appName: string) => {
const nextName = resolveGeneratedProjectName(
projects,
currentProjectIdRef.current,
projectNameRef.current,
appName,
)
if (nextName) setProjectName(nextName)
}, [projects, setProjectName])
const duplicateCurrentProject = useCallback(() => {
const project = makeNewProject(
getUniqueProjectName(
@ -430,7 +391,6 @@ export function useProjectWorkspace({
setDeleteDialogOpen,
deletingProject,
saveCurrentProject,
applyGeneratedProjectName,
openProject,
createNewProject,
duplicateCurrentProject,

View File

@ -90,15 +90,8 @@ export type AiGenerateModalProps = {
/** `html` set means the target is an AI-authored HTML screen; edits then run the HTML toolset. */
targetSlide?: { id: string; name: string; html?: string }
onPrepareRun: (files: { name: string; dataUrl: string }[]) => Promise<{ assetId: string; name: string; dataUrl: string }[]>
/** `appName` is carried only by a generate run, so the project can adopt it as its title. */
onFinished: (result: { slidesCreated: number; appName?: string }) => void
onFinished: (slidesCreated: number) => void
onActivity?: (activity: AiToolActivity | null) => void
/**
* Reports the live run to the owner: a cancel handle while a run is active,
* null once it ends. The owner uses it to guard project switches and page
* unloads and to abort the run from outside the modal.
*/
onRunStateChange: (control: { cancel: () => void } | null) => void
}
type ImageDropzoneProps = {
@ -335,11 +328,11 @@ const IdleContent = ({
onCheckedChange={onEnableHtmlScreensChange}
/>
<label htmlFor="ai-modal-html-screens" className="ai-modal-overlay-toggle__copy">
<b>HTML screens <Badge variant="secondary" className="ai-modal-overlay-toggle__badge">Experimental</Badge></b>
<b>HTML screens <Badge variant="secondary">Experimental</Badge></b>
<span>
The AI designs each screen as free-form HTML and CSS instead of canvas elements — often bolder layouts and typography.
</span>
<small className="ai-modal-overlay-toggle__caution">
<small>
HTML screens can only be edited with AI, not by hand.
</small>
</label>
@ -396,7 +389,7 @@ const ModalFooter = ({
</>
)
export const AiGenerateModal = ({ open, onClose, controller, targetSlide, onPrepareRun, onFinished, onActivity, onRunStateChange }: AiGenerateModalProps) => {
export const AiGenerateModal = ({ open, onClose, controller, targetSlide, onPrepareRun, onFinished, onActivity }: AiGenerateModalProps) => {
const [appName, setAppName] = useState('')
const [description, setDescription] = useState('')
const [logo, setLogo] = useState<ImageDraft | null>(null)
@ -410,7 +403,7 @@ export const AiGenerateModal = ({ open, onClose, controller, targetSlide, onPrep
const [errorMessage, setErrorMessage] = useState<string | null>(null)
const [doneInfo, setDoneInfo] = useState<{ summary: string; slidesCreated: number } | null>(null)
const [selection, setSelection] = useState<AiModelSelection>(INITIAL_AI_SELECTION)
const [enableHtmlScreens, setEnableHtmlScreens] = useState(true)
const [enableHtmlScreens, setEnableHtmlScreens] = useState(false)
const [keysRevision, setKeysRevision] = useState(0)
const [keysDialogOpen, setKeysDialogOpen] = useState(false)
const [keysDialogInstance, setKeysDialogInstance] = useState(0)
@ -517,10 +510,7 @@ export const AiGenerateModal = ({ open, onClose, controller, targetSlide, onPrep
setDoneInfo({ summary: event.summary, slidesCreated: event.slidesCreated })
setPhase('done')
onActivity?.(null)
onFinished({
slidesCreated: event.slidesCreated,
...(!isEditMode && appName.trim() ? { appName: appName.trim() } : {}),
})
onFinished(event.slidesCreated)
} else {
setNarration(flushNarration)
setErrorMessage(event.message)
@ -543,14 +533,6 @@ export const AiGenerateModal = ({ open, onClose, controller, targetSlide, onPrep
abortControllerRef.current = abortController
cancelledRef.current = false
const wasCancelled = () => cancelledRef.current
// Registered before the first await so the run is cancellable (and its
// controller writes are permitted) from the very first mutation.
onRunStateChange({
cancel: () => {
cancelledRef.current = true
abortController.abort()
},
})
setAssistantText('')
setNarration(createNarrationState())
setPlan([])
@ -586,14 +568,12 @@ export const AiGenerateModal = ({ open, onClose, controller, targetSlide, onPrep
}
} finally {
runActiveRef.current = false
onRunStateChange(null)
}
}
const handleCancel = () => {
cancelledRef.current = true
abortControllerRef.current?.abort()
onRunStateChange(null)
setPhase('idle')
onActivity?.(null)
}

View File

@ -8,12 +8,10 @@ import {
type PointerEvent as ReactPointerEvent,
} from 'react'
import { photoMockups, type PhotoMockupDefinition } from '../mockups/catalog'
import { createPerspectiveMapping } from '../mockups/perspective'
import { hexToRgba, richTextHasFormatting, richTextToPlain, sanitizeRichText } from '../utils'
import { IconGraphic } from './IconGraphic'
import { Bold, Home01, Italic, LockKeyhole, MoreHorizontal, Search01, Signal, Underline, UserCircle, Wifi01, BatteryFull, Add01 } from './icons'
import { ShapeGraphic } from './ShapeGraphic'
import type { ResizeHandle } from '../editor/resize-element'
import type { CanvasElement } from '../types'
const FakeScreen = ({ theme }: { theme: Extract<CanvasElement, { type: 'device' }>['screenTheme'] }) => (
@ -37,6 +35,82 @@ const FakeScreen = ({ theme }: { theme: Extract<CanvasElement, { type: 'device'
</div>
)
const solveLinearSystem = (matrix: number[][], vector: number[]) => {
const size = vector.length
const augmented = matrix.map((row, index) => [...row, vector[index]])
for (let column = 0; column < size; column += 1) {
let pivot = column
for (let row = column + 1; row < size; row += 1) {
const candidate = augmented[row]?.[column] ?? 0
const currentPivot = augmented[pivot]?.[column] ?? 0
if (Math.abs(candidate) > Math.abs(currentPivot)) pivot = row
}
const columnRow = augmented[column]
const pivotRow = augmented[pivot]
if (!columnRow || !pivotRow) return null
augmented[column] = pivotRow
augmented[pivot] = columnRow
const activeRow = pivotRow
const divisor = activeRow[column]
if (divisor === undefined) return null
if (Math.abs(divisor) < 1e-10) return null
for (let item = column; item <= size; item += 1) {
activeRow[item] = (activeRow[item] ?? 0) / divisor
}
for (let row = 0; row < size; row += 1) {
if (row === column) continue
const targetRow = augmented[row]
if (!targetRow) return null
const factor = targetRow[column] ?? 0
for (let item = column; item <= size; item += 1) {
targetRow[item] = (targetRow[item] ?? 0) - factor * (activeRow[item] ?? 0)
}
}
}
return augmented.map((row) => row[size] ?? 0)
}
const perspectiveMatrix = (width: number, height: number, definition: PhotoMockupDefinition) => {
const sourceWidth = 139.2
const sourceHeight = sourceWidth / definition.sourceAspectRatio
const source: [number, number][] = [
[0, 0],
[sourceWidth, 0],
[sourceWidth, sourceHeight],
[0, sourceHeight],
]
const target: [number, number][] = definition.screenQuad.map(
(point) => [point.x * width, point.y * height],
)
const equations: number[][] = []
const values: number[] = []
for (let index = 0; index < 4; index += 1) {
const sourcePoint = source[index]
const targetPoint = target[index]
if (!sourcePoint || !targetPoint) {
return { transform: 'none', sourceWidth, sourceHeight }
}
const [x, y] = sourcePoint
const [targetX, targetY] = targetPoint
equations.push([x, y, 1, 0, 0, 0, -targetX * x, -targetX * y])
values.push(targetX)
equations.push([0, 0, 0, x, y, 1, -targetY * x, -targetY * y])
values.push(targetY)
}
const solved = solveLinearSystem(equations, values)
if (!solved) return { transform: 'none', sourceWidth, sourceHeight }
const [a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0] = solved
return {
transform: `matrix3d(${a},${d},0,${g},${b},${e},0,${h},0,0,1,0,${c},${f},0,1)`,
sourceWidth,
sourceHeight,
}
}
const runRichTextCommand = (command: string, value?: string) => {
// execCommand is the only browser API that preserves an arbitrary
// contenteditable selection while applying inline formatting.
@ -58,12 +132,7 @@ const PhotoMockup = ({ element, definition }: { element: Extract<CanvasElement,
return () => observer.disconnect()
}, [])
const mapping = createPerspectiveMapping({
width: size.width,
height: size.height,
definition,
hasScreenshot: Boolean(element.screenshot),
})
const mapping = perspectiveMatrix(size.width, size.height, definition)
const screenClip = definition.screenMask
? `inset(${definition.screenMask.top * mapping.sourceHeight}px ${definition.screenMask.right * mapping.sourceWidth}px ${definition.screenMask.bottom * mapping.sourceHeight}px ${definition.screenMask.left * mapping.sourceWidth}px round ${definition.screenMask.cornerRadius * mapping.sourceWidth}px)`
: undefined
@ -179,7 +248,7 @@ type CanvasItemProps = {
exporting: boolean
onSelect: (additive: boolean) => void
onBeginDrag: (event: ReactPointerEvent, element: CanvasElement) => void
onBeginResize: (event: ReactPointerEvent, element: CanvasElement, handle: ResizeHandle) => void
onBeginResize: (event: ReactPointerEvent, element: CanvasElement) => void
onBeginRotate: (event: ReactPointerEvent, element: CanvasElement) => void
onCommitText: (patch: { text: string; html?: string }) => void
}
@ -354,10 +423,10 @@ export const CanvasItem = ({ element, selected, showTransformHandles, exporting,
: showTransformHandles
? (
<>
<button className="resize-handle resize-handle--nw" onPointerDown={(e) => onBeginResize(e, element, 'nw')} tabIndex={-1} />
<button className="resize-handle resize-handle--ne" onPointerDown={(e) => onBeginResize(e, element, 'ne')} tabIndex={-1} />
<button className="resize-handle resize-handle--sw" onPointerDown={(e) => onBeginResize(e, element, 'sw')} tabIndex={-1} />
<button className="resize-handle resize-handle--se" onPointerDown={(e) => onBeginResize(e, element, 'se')} tabIndex={-1} />
<button className="resize-handle resize-handle--nw" onPointerDown={(e) => onBeginResize(e, element)} tabIndex={-1} />
<button className="resize-handle resize-handle--ne" onPointerDown={(e) => onBeginResize(e, element)} tabIndex={-1} />
<button className="resize-handle resize-handle--sw" onPointerDown={(e) => onBeginResize(e, element)} tabIndex={-1} />
<button className="resize-handle resize-handle--se" onPointerDown={(e) => onBeginResize(e, element)} tabIndex={-1} />
<button className="rotate-handle" onPointerDown={(e) => onBeginRotate(e, element)} tabIndex={-1}><span /></button>
</>
)

View File

@ -13,16 +13,8 @@ describe('coding assistant prompt', () => {
expect(CODING_ASSISTANT_PROMPT).toContain('the theme the screenshots should match')
})
it('asks for the hero benefit and the differentiator the story arc builds on', () => {
expect(CODING_ASSISTANT_PROMPT).toContain('single strongest benefit')
expect(CODING_ASSISTANT_PROMPT).toContain('headline the first screenshot')
expect(CODING_ASSISTANT_PROMPT).toContain('sets it apart from similar apps')
expect(CODING_ASSISTANT_PROMPT).toContain('in order of importance')
expect(CODING_ASSISTANT_PROMPT).toContain('pains they remove')
})
it('forbids inventing features and code-level detail', () => {
expect(CODING_ASSISTANT_PROMPT).toContain('do not invent features, claims, or ratings')
expect(CODING_ASSISTANT_PROMPT).toContain('do not invent features')
expect(CODING_ASSISTANT_PROMPT).toContain('not the code, tech stack, or file layout')
})
})

View File

@ -3,14 +3,12 @@ import { Check, Copy } from './icons'
export const CODING_ASSISTANT_PROMPT = `I use Shotluma to generate App Store screenshots from a short written description of my app. Read this codebase and write that description for me.
Return a single plain-prose paragraph (about 80-150 words, no markdown, no bullet lists, no headings) that I can paste straight into the generator. Cover:
Return a single plain-prose paragraph (about 60-120 words, no markdown, no bullet lists, no headings) that I can paste straight into the generator. Cover:
- What the app does and who it is for.
- The single strongest benefit — the one thing that should headline the first screenshot.
- What sets it apart from similar apps, if the codebase makes that clear.
- Its three to five most important features or selling points in order of importance, phrased as user benefits or pains they remove rather than in technical terms.
- Its three to five most important features or selling points, phrased the way a user would understand them rather than in technical terms.
- The overall tone and mood, and if the codebase has a clear visual identity (brand colors, dark or light, playful or serious), the theme the screenshots should match.
Describe the product like a marketer would, not the code, tech stack, or file layout, and do not invent features, claims, or ratings that are not grounded in the codebase.`
Describe the product like a marketer would, not the code, tech stack, or file layout, and do not invent features that are not in the codebase.`
export const CopyCodingPromptButton = () => {
const [copied, setCopied] = useState(false)

View File

@ -1,6 +1,5 @@
import { useRef, useState, type PointerEvent as ReactPointerEvent } from 'react'
import { DRAG_MAX, getDragMaxX, getDragMinX, getDragMinY } from '../editor/drag-bounds'
import { getNorthResizeY, getResizePatch, type ResizeHandle } from '../editor/resize-element'
import { getSpanGhosts } from '../editor/screen-span'
import { clamp, getBackgroundPatternStyle, getBackgroundStyle } from '../utils'
import { AiCursorOverlay } from './AiCursorOverlay'
@ -25,20 +24,6 @@ type Interaction = {
centerX?: number
centerY?: number
startAngle?: number
resizeHandle?: ResizeHandle
resizeNode?: HTMLElement
resizeStartHeightPercent?: number
artboardHeightPx?: number
}
// Text can rewrap and mockups keep an aspect ratio, so the next height is only
// known after layout. Probe the live node, then let React apply the real width.
const measureHeightPercent = (node: HTMLElement, widthPercent: number, artboardHeightPx: number) => {
const previousWidth = node.style.width
node.style.width = `${widthPercent}%`
const heightPercent = (node.offsetHeight / artboardHeightPx) * 100
node.style.width = previousWidth
return heightPercent
}
type Props = {
@ -88,7 +73,7 @@ export const EditorCanvas = ({
const [isInteracting, setIsInteracting] = useState(false)
const [snapGuides, setSnapGuides] = useState<{ slideId: string; vertical: boolean; horizontal: boolean } | null>(null)
const begin = (type: Interaction['type'], event: ReactPointerEvent, slideId: string, element: CanvasElement, resizeHandle?: ResizeHandle) => {
const begin = (type: Interaction['type'], event: ReactPointerEvent, slideId: string, element: CanvasElement) => {
event.preventDefault()
event.stopPropagation()
const artboardNode = event.currentTarget.closest('.artboard-export')
@ -138,20 +123,6 @@ export const EditorCanvas = ({
centerX,
centerY,
startAngle: Math.atan2(event.clientY - centerY, event.clientX - centerX) * (180 / Math.PI),
...(resizeHandle
? {
resizeHandle,
artboardHeightPx: artboardNode.clientHeight,
...(itemNode instanceof HTMLElement
? {
resizeNode: itemNode,
resizeStartHeightPercent: artboardNode.clientHeight > 0
? (itemNode.offsetHeight / artboardNode.clientHeight) * 100
: 0,
}
: {}),
}
: {}),
}
onCheckpoint()
setIsInteracting(true)
@ -192,22 +163,9 @@ export const EditorCanvas = ({
}
if (current.type === 'resize') {
const handle = current.resizeHandle
if (!handle) return
const patch = getResizePatch(current.element, dx, handle)
const { resizeNode, resizeStartHeightPercent, artboardHeightPx } = current
const nextHeightPercent = handle.startsWith('n')
&& resizeNode
&& resizeStartHeightPercent !== undefined
&& artboardHeightPx !== undefined
&& artboardHeightPx > 0
? measureHeightPercent(resizeNode, patch.width, artboardHeightPx)
: undefined
onUpdateElements(current.slideId, [{
id: current.element.id,
patch: nextHeightPercent === undefined || resizeStartHeightPercent === undefined
? patch
: { ...patch, y: getNorthResizeY(current.element.y, resizeStartHeightPercent, nextHeightPercent) },
patch: { width: clamp(current.element.width + dx, 8, 140) },
}])
return
}
@ -324,7 +282,7 @@ export const EditorCanvas = ({
exporting={exporting}
onSelect={(additive) => onSelectElement(element.id, slide.id, additive)}
onBeginDrag={(event, item) => begin('drag', event, slide.id, item)}
onBeginResize={(event, item, handle) => begin('resize', event, slide.id, item, handle)}
onBeginResize={(event, item) => begin('resize', event, slide.id, item)}
onBeginRotate={(event, item) => begin('rotate', event, slide.id, item)}
onCommitText={(patch) => onCommitText(slide.id, element.id, patch)}
/>

View File

@ -1,45 +0,0 @@
import { describe, expect, it } from 'vitest'
import { getNorthResizeY, getResizePatch, type ResizeHandle } from './resize-element'
describe('getResizePatch', () => {
it.each<ResizeHandle>(['nw', 'ne', 'sw', 'se'])(
'resizes outward and inward from the %s handle while fixing the opposite edge',
(handle) => {
const element = { x: 20, width: 40 }
const isLeftHandle = handle.endsWith('w')
const outwardDeltaX = isLeftHandle ? -10 : 10
const inwardDeltaX = -outwardDeltaX
const fixedEdge = isLeftHandle ? element.x + element.width : element.x
const outward = getResizePatch(element, outwardDeltaX, handle)
const inward = getResizePatch(element, inwardDeltaX, handle)
expect(outward.width).toBe(50)
expect(inward.width).toBe(30)
expect(isLeftHandle ? outward.x + outward.width : outward.x).toBe(fixedEdge)
expect(isLeftHandle ? inward.x + inward.width : inward.x).toBe(fixedEdge)
},
)
it('keeps the opposite edge fixed when the width reaches either limit', () => {
const element = { x: 20, width: 40 }
expect(getResizePatch(element, 100, 'nw')).toEqual({ x: 52, width: 8 })
expect(getResizePatch(element, -200, 'nw')).toEqual({ x: -80, width: 140 })
expect(getResizePatch(element, -100, 'se')).toEqual({ x: 20, width: 8 })
expect(getResizePatch(element, 200, 'se')).toEqual({ x: 20, width: 140 })
})
})
describe('getNorthResizeY', () => {
it('moves the top edge up when the element grows so the bottom stays fixed', () => {
expect(getNorthResizeY(20, 30, 40)).toBe(10)
})
it('moves the top edge down when the element shrinks so the bottom stays fixed', () => {
expect(getNorthResizeY(20, 30, 20)).toBe(30)
})
it('keeps y unchanged when the height does not change', () => {
expect(getNorthResizeY(20, 30, 30)).toBe(20)
})
})

View File

@ -1,25 +0,0 @@
import type { BaseElement } from '../types'
export type ResizeHandle = 'nw' | 'ne' | 'sw' | 'se'
export const getResizePatch = (
element: Pick<BaseElement, 'x' | 'width'>,
deltaX: number,
handle: ResizeHandle,
): Pick<BaseElement, 'x' | 'width'> => {
const isLeftHandle = handle.endsWith('w')
const requestedWidth = element.width + (isLeftHandle ? -deltaX : deltaX)
const width = Math.min(140, Math.max(8, requestedWidth))
return {
x: isLeftHandle ? element.x + element.width - width : element.x,
width,
}
}
/** Keeps the bottom edge fixed when a top handle changes the element's height. */
export const getNorthResizeY = (
startY: number,
startHeightPercent: number,
nextHeightPercent: number,
): number => startY + startHeightPercent - nextHeightPercent

View File

@ -39,8 +39,6 @@ Example:
Shotluma calculates a projective `matrix3d` from these points. Uploaded screenshots are therefore distorted into the original Photoshop perspective instead of merely being rotated.
At runtime, real screenshots use a perspective source plane at least as wide as the rendered mockup. This matters for native-size HTML screens that are scaled down in the editor: it prevents the browser from enlarging a small intermediate texture before the outer scale is applied. Placeholder screens retain their fixed reference plane because their generated UI uses absolute CSS pixel sizes.
## What does not work
A single flattened JPG is not enough: the original screen cannot be removed cleanly and there are no reliable perspective coordinates. A flattened transparent PNG can be used only when the display area is already empty and its four corners are supplied manually.

View File

@ -1,55 +0,0 @@
import { describe, expect, it } from 'vitest'
import { createPerspectiveMapping } from './perspective'
import type { PhotoMockupDefinition } from './catalog'
const definition: PhotoMockupDefinition = {
overlay: 'mockup.webp',
canvasAspectRatio: 0.5,
sourceAspectRatio: 0.5,
defaultPlacement: { x: 0, y: 0, width: 100, rotation: 0 },
screenQuad: [
{ x: 0, y: 0 },
{ x: 1, y: 0 },
{ x: 1, y: 1 },
{ x: 0, y: 1 },
],
}
describe('createPerspectiveMapping', () => {
it('uses the rendered mockup width for real screenshots', () => {
const mapping = createPerspectiveMapping({
width: 900,
height: 1800,
definition,
hasScreenshot: true,
})
expect(mapping.sourceWidth).toBe(900)
expect(mapping.sourceHeight).toBe(1800)
expect(mapping.transform).toBe('matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)')
})
it('keeps small screens oversampled', () => {
const mapping = createPerspectiveMapping({
width: 80,
height: 160,
definition,
hasScreenshot: true,
})
expect(mapping.sourceWidth).toBe(139.2)
expect(mapping.sourceHeight).toBe(278.4)
})
it('keeps the fixed coordinate plane for generated placeholders', () => {
const mapping = createPerspectiveMapping({
width: 900,
height: 1800,
definition,
hasScreenshot: false,
})
expect(mapping.sourceWidth).toBe(139.2)
expect(mapping.sourceHeight).toBe(278.4)
})
})

View File

@ -1,95 +0,0 @@
import type { PhotoMockupDefinition } from './catalog'
const PLACEHOLDER_SCREEN_WIDTH = 139.2
type PerspectiveMappingOptions = {
width: number
height: number
definition: PhotoMockupDefinition
hasScreenshot: boolean
}
const solveLinearSystem = (matrix: number[][], vector: number[]) => {
const size = vector.length
const augmented = matrix.map((row, index) => [...row, vector[index]])
for (let column = 0; column < size; column += 1) {
let pivot = column
for (let row = column + 1; row < size; row += 1) {
const candidate = augmented[row]?.[column] ?? 0
const currentPivot = augmented[pivot]?.[column] ?? 0
if (Math.abs(candidate) > Math.abs(currentPivot)) pivot = row
}
const columnRow = augmented[column]
const pivotRow = augmented[pivot]
if (!columnRow || !pivotRow) return null
augmented[column] = pivotRow
augmented[pivot] = columnRow
const activeRow = pivotRow
const divisor = activeRow[column]
if (divisor === undefined || Math.abs(divisor) < 1e-10) return null
for (let item = column; item <= size; item += 1) {
activeRow[item] = (activeRow[item] ?? 0) / divisor
}
for (let row = 0; row < size; row += 1) {
if (row === column) continue
const targetRow = augmented[row]
if (!targetRow) return null
const factor = targetRow[column] ?? 0
for (let item = column; item <= size; item += 1) {
targetRow[item] = (targetRow[item] ?? 0) - factor * (activeRow[item] ?? 0)
}
}
}
return augmented.map((row) => row[size] ?? 0)
}
export const createPerspectiveMapping = ({
width,
height,
definition,
hasScreenshot,
}: PerspectiveMappingOptions) => {
// HTML slides are laid out at export size and scaled down as one surface.
// Giving real screenshots a source plane as wide as the unscaled mockup
// prevents Chromium from enlarging a small intermediate texture first.
const sourceWidth = hasScreenshot
? Math.max(PLACEHOLDER_SCREEN_WIDTH, width)
: PLACEHOLDER_SCREEN_WIDTH
const sourceHeight = sourceWidth / definition.sourceAspectRatio
const source: [number, number][] = [
[0, 0],
[sourceWidth, 0],
[sourceWidth, sourceHeight],
[0, sourceHeight],
]
const target: [number, number][] = definition.screenQuad.map(
(point) => [point.x * width, point.y * height],
)
const equations: number[][] = []
const values: number[] = []
for (let index = 0; index < 4; index += 1) {
const sourcePoint = source[index]
const targetPoint = target[index]
if (!sourcePoint || !targetPoint) {
return { transform: 'none', sourceWidth, sourceHeight }
}
const [x, y] = sourcePoint
const [targetX, targetY] = targetPoint
equations.push([x, y, 1, 0, 0, 0, -targetX * x, -targetX * y])
values.push(targetX)
equations.push([0, 0, 0, x, y, 1, -targetY * x, -targetY * y])
values.push(targetY)
}
const solved = solveLinearSystem(equations, values)
if (!solved) return { transform: 'none', sourceWidth, sourceHeight }
const [a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0] = solved
return {
transform: `matrix3d(${a},${d},0,${g},${b},${e},0,${h},0,0,1,0,${c},${f},0,1)`,
sourceWidth,
sourceHeight,
}
}

View File

@ -28,21 +28,4 @@ describe('persisted project normalization', () => {
savedAt: 20,
})).toBeNull()
})
it('carries the interrupted-generation marker only when it is exactly true', () => {
const record = {
id: 'project-run',
projectName: 'Mid-run project',
slides: [],
uploads: [],
createdAt: 10,
savedAt: 20,
}
expect(normalizePersistedProject({ ...record, interruptedGeneration: true }))
.toMatchObject({ interruptedGeneration: true })
expect(normalizePersistedProject(record)).not.toHaveProperty('interruptedGeneration')
expect(normalizePersistedProject({ ...record, interruptedGeneration: 'yes' }))
.not.toHaveProperty('interruptedGeneration')
})
})

View File

@ -17,12 +17,6 @@ export type PersistedProject = {
uploads: UploadAsset[]
createdAt: number
savedAt: number
/**
* Set on saves that happen while an AI generation is running. A project that
* still carries it on load was closed mid-run, and the editor tells the user
* about the interrupted generation once before clearing it.
*/
interruptedGeneration?: true
}
export type ProjectSummary = Pick<PersistedProject, 'id' | 'projectName' | 'createdAt' | 'savedAt'>
@ -47,7 +41,6 @@ export const normalizePersistedProject = (value: unknown): PersistedProject | nu
uploads: project.uploads,
createdAt: typeof project.createdAt === 'number' ? project.createdAt : project.savedAt,
savedAt: project.savedAt,
...(project.interruptedGeneration === true ? { interruptedGeneration: true as const } : {}),
}
}

View File

@ -712,14 +712,6 @@ button:disabled { cursor: not-allowed; opacity: .35; }
line-height: 1.35;
color: var(--muted);
}
.ai-modal-overlay-toggle__copy .ai-modal-overlay-toggle__caution {
font-weight: 600;
color: #0369a1;
}
.ai-modal-overlay-toggle .ai-modal-overlay-toggle__badge {
background: #e0f2fe;
color: #0369a1;
}
.ai-modal-copy-prompt {
display: inline-flex;
align-items: center;

View File

@ -202,20 +202,6 @@ select:focus-visible {
.project-delete-dialog .project-delete-confirm:hover { color: white; background: color-mix(in oklch, var(--destructive) 88%, black); }
.project-delete-dialog button:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in oklch, var(--ring) 45%, transparent); }
.ai-run-cancel-dialog { width: min(calc(100vw - 32px), 360px); max-width: 360px; gap: 0; padding: 0; overflow: hidden; border-radius: var(--radius-lg); box-shadow: 0 18px 48px oklch(0 0 0 / 18%), 0 2px 8px oklch(0 0 0 / 8%); }
.ai-run-cancel-dialog [data-slot='alert-dialog-header'] { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; place-items: start; gap: 3px 12px; padding: 18px 18px 15px; text-align: left; }
.ai-run-cancel-dialog [data-slot='alert-dialog-media'] { grid-row: 1 / span 2; width: 34px; height: 34px; margin: 0; color: var(--primary); background: color-mix(in oklch, var(--primary) 11%, var(--background)); border-radius: var(--radius-md); }
.ai-run-cancel-dialog [data-slot='alert-dialog-title'] { grid-column: 2; color: var(--foreground); font-size: 13px; font-weight: 580; line-height: 18px; letter-spacing: 0; }
.ai-run-cancel-dialog [data-slot='alert-dialog-description'] { grid-column: 2; color: var(--muted-foreground); font-size: 13px; font-weight: 400; line-height: 18px; text-wrap: pretty; }
.ai-run-cancel-dialog [data-slot='alert-dialog-footer'] { margin: 0; padding: 11px 14px 13px; flex-direction: row; justify-content: flex-end; gap: 7px; background: var(--background); border-top: 1px solid var(--border); border-radius: 0; }
.ai-run-cancel-dialog [data-slot='alert-dialog-action'],
.ai-run-cancel-dialog [data-slot='alert-dialog-cancel'] { min-width: 78px; height: 29px; padding: 0 10px; border-radius: var(--radius-md); font-size: 11px; font-weight: 520; line-height: 1; }
.ai-run-cancel-dialog .ai-run-cancel-keep { color: var(--foreground); background: var(--background); border-color: var(--input); }
.ai-run-cancel-dialog .ai-run-cancel-keep:hover { background: var(--muted); }
.ai-run-cancel-dialog .ai-run-cancel-confirm { color: white; background: var(--destructive); border-color: var(--destructive); box-shadow: 0 1px 2px color-mix(in oklch, var(--destructive) 28%, transparent); }
.ai-run-cancel-dialog .ai-run-cancel-confirm:hover { color: white; background: color-mix(in oklch, var(--destructive) 88%, black); }
.ai-run-cancel-dialog button:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in oklch, var(--ring) 45%, transparent); }
.ai-keys-dialog {
width: min(calc(100vw - 32px), 380px);
max-width: 380px;
@ -911,16 +897,6 @@ select:focus-visible {
.ai-modal-overlay-toggle__copy small,
.ai-modal-copy-prompt { color: var(--muted-foreground); }
/* Light-blue "Experimental" badge and the matching caution line; the sky hue
is mixed with the theme tokens so both light and dark mode stay legible. */
.ai-modal-overlay-toggle .ai-modal-overlay-toggle__badge {
background: color-mix(in oklch, oklch(0.68 0.13 240) 22%, var(--background));
color: color-mix(in oklch, oklch(0.68 0.13 240) 65%, var(--foreground));
}
.ai-modal-overlay-toggle__copy .ai-modal-overlay-toggle__caution {
color: color-mix(in oklch, oklch(0.68 0.13 240) 55%, var(--foreground));
}
.ai-provider-description { color: var(--muted-foreground); }
.ai-provider-warning {

View File

@ -22,14 +22,11 @@ export default defineConfig({
'src/asset-sources.ts',
'src/app/project-utils.ts',
'src/app/share-link.ts',
'src/app/share-preview-palette.ts',
'src/editor/drag-bounds.ts',
'src/editor/element-utils.ts',
'src/editor/nudge.ts',
'src/editor/resize-element.ts',
'src/editor/screen-span.ts',
'src/editor/slide-operations.ts',
'src/mockups/perspective.ts',
],
thresholds: {
lines: 80,