The overrides pinned exact versions that later advisories flagged. Raise
each to its lowest patched release and cover the packages shadcn, wrangler,
and the AI SDK pin transitively. `braces` has no patched release upstream
and only reaches the project through the shadcn CLI, so the audit script
ignores that one advisory until one ships.
Vitest moves to 4.1.12 for GHSA-82fw-gwwq-j7x9.
A running AI generation used to survive a project switch invisibly: the
run band unmounted without aborting, and because the slide/upload refs
are shared, the remaining tool calls wrote their screens into the newly
opened project (which then even adopted the generated app name). Leaving
the page killed a run without any warning or later explanation.
- useAiWorkflow now owns the run lifecycle: the modal registers a cancel
handle, controller writes are gated on the registered run, and
handleProjectReplaced unconditionally cancels before refs swap.
- Project switch, creation, and duplication during a run first ask via
the new AiRunCancelDialog; deletion is disabled until the run ends.
- beforeunload warns while (and only while) a run is active.
- Saves during a run mark the project with interruptedGeneration; the
marker is cleared by a save after the run ends and otherwise consumed
on the next load with a one-time toast explaining the unfinished
screens.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014fjKLZWb1cqRDEW86V7HJm
* 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.
* 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.
* feat(ai): add OpenCode Zen and Go providers
Add OpenCode as a key-based provider with shared Zen/Go credentials, a same-origin CORS proxy, runtime model catalogs, and a vision-model fallback that describes screenshots for text-only coding models.
* fix(ai): keep OpenCode Zen/Go path prefixes when proxying
Absolute /v1/... suffixes were resolved against the OpenCode origin and dropped /zen and /zen/go. Join relative to those prefixes in the worker and Vite rewrites.
* chore(deps): bump nanoid override to 3.3.18
Clear GHSA-2v37-7h3g-55p8 so bun audit can pass. The previous 3.3.17 pin is now reported as vulnerable.
* fix(ai): surface run status events and cache image descriptions across steps
OpenCode text-only models describe screenshots with a vision model before
generating. The modal dropped 'status' run events, so the band showed
'Starting up …' for the whole describe phase, and each tool-loop step
re-described every image from scratch because the description cache lived
only one prepare call.
* refactor(ai): enhance OpenCode model handling and proxy functionality
* fix: allow images to be used in devices
* fix(ai): defer vision fallback, harden image cache keys, and remount model browser per provider
Address CodeRabbit review on #18:
- resolve the OpenCode vision describer only once a prepared step contains
an image, so text-only models run image-free requests without a fallback
- relay tool preview images whenever the vision fallback is active, not
only for chat-dialect models
- hash full binary payloads for image description cache keys so distinct
same-length images are described separately
- build the unavailable-transport error from the selected provider
- remount AiCatalogModelBrowser per provider so catalogs never leak
between OpenRouter and OpenCode gateways
- bound the OpenCode catalog fetch with a 10s timeout and guard the
catalog-revision state update after unmount
- correct the worker key-handling doc and the vision-default comment
* feat(persistence): store images as disk-backed blobs and load workspaces lazily
Project documents no longer embed images as base64 data URLs. Image bytes
now live as Blobs in a content-addressed IndexedDB asset store (SHA-256
ids), documents persist blob-asset: references, and the app renders
object URLs — so image data stays out of the JS heap and identical
images deduplicate across projects. Legacy documents migrate
transparently on load and persist references on the next save.
Startup no longer deserializes every project via getAll(): a cursor walk
builds the project list one document at a time and only the active
project is fully retained, so tab memory peaks at one project instead of
the sum of all of them.
Uploads store their file Blob directly (with a data URL fallback when
Blob storage is unavailable), AI attachments register blob assets while
keeping data URL provider payloads, and overlay reference images are
converted back to base64 on demand. Deleting a project sweeps blobs no
surviving project references.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: address review findings on run guarding and cache retention
- Mark the AI generate run active before awaiting attachment preparation
so a second click cannot start a parallel run, the close guard applies
during preparation, cancellation is honored before the run starts, and
preparation failures surface in the error view.
- Drop the data-URL-to-asset-id memo map; it pinned full base64 strings
in the heap for the tab lifetime, contradicting the goal of this
change. Re-hashing the rare inline data URL on save is cheaper.
- Guard openDatabase's failure path against a late error clearing a
newer cached database promise after a retry.
- Document the deliberate session-lifetime asset retention (unsaved
state and undo history) and the cross-tab sweep limitation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(ai): add experimental HTML screen mode and Grok 4.6
Let the model author whole screens as sanitized HTML instead of element tools, and surface Grok 4.6 as the default xAI model.
* chore: bump version to 0.4.0
* test(ai): cover new controller surface in slide-tools mock
* fix(ai): harden HTML screen mode after review
Strip non-fragment url() from SVG presentation attributes, collapse
root-selector chains that @scope cannot match, defer a new screen's first
preview until its slideId exists, and only count successfully created
HTML screens.
* fix(app): use shared button for project creation and quiet test warnings
* chore(deps): update @ai-sdk/xai for grok-4.6
* fix(ai): treat CSS comments as selector separators in scope rewrite
Added normalization functions to improve text handling in the AI tools. The `normalizeAiCopy` function processes text to ensure proper line breaks, while `normalizeAiHighlights` standardizes highlight formatting. Updated relevant components to utilize these functions, enhancing the consistency and readability of text elements in the application. Removed unnecessary tool call count state from the AiGenerateModal and AiRunBand components to streamline the UI.
Three problems with the run band, one of them a real provider bug.
Gemini showed "Starting up …" for an entire run. Reasoning visibility is a
separate switch from reasoning effort, and the providers are asymmetric: OpenAI's
Responses API defaults reasoningSummary to 'detailed' once an effort is set,
while @ai-sdk/google reads includeThoughts only from providerOptions.google with
no fallback from the portable reasoning value. We never sent it, so Gemini
thought, billed those tokens, and returned no summaries. Because prompt.ts also
forbids turn-by-turn narration, reasoning is the only live prose during a run —
without it the band had nothing to show. A test now asserts includeThoughts
reaches Google's actual request body, alongside the effort it must not override.
The band resized on almost every delta because the prose box had a min-height and
no upper bound. Its height is now fixed at four lines, bottom-anchored, so older
text scrolls out of view upward instead of moving the whole band. Measured
constant at 196px across one short line, one wrapping line, three lines, and six
overflowing lines.
"18 actions" reported only that something happened. The footer now names the
latest tool detail ("18 Preview checked"), which for a model that streams no
reasoning is the only live signal there is.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The run phase reused the generate dialog shrunk to 320x320, which forced four
streams into two scroll areas: tool calls got the loudest surface for the least
informative lines, reasoning was sliced to a 160-character window and pasted
next to the spinner, and assistant prose piled up as one block whose sentences
collided ("...Noah set.Art direction is set:").
The run now renders as a band over the canvas. Assistant prose and reasoning
share one area at reading size, accumulated per sentence by run-narration so no
scroll area appears and two steps never merge into one line. Tool calls are
reduced to their latest human-readable detail. A screen rail shows the plan the
model declares via the new declare_plan tool, reconciled against the screens
actually built so a drifting run cannot make the rail claim it finished early.
The band is also the result and error surface, so no run hands control back to
the centered dialog.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Integrated OpenRouter as a new AI provider, allowing direct calls to its API.
- Updated the AI provider catalog to include OpenRouter models and reasoning efforts.
- Implemented dynamic model resolution for OpenRouter, enabling runtime fetching of available models.
- Enhanced UI components to support OpenRouter selection and browsing of models.
- Updated tests to validate the new OpenRouter functionality and ensure compatibility with existing providers.
- Added a section on prompt caching and cost optimization, detailing provider-specific cache routing for Anthropic, OpenAI, and Google Gemini.
- Updated the AI generation invariants to emphasize the importance of batching tool calls to reduce input token costs.
- Clarified the usage of the `inspect_slide` tool, indicating it is rarely needed due to existing mutation results.
- Improved instructions in the prompt to encourage batching of tool calls and final passes for efficiency.
- Introduced a new file for per-provider cache routing in `src/ai/prompt-caching.ts`.
- Introduced a new `spansScreens` property for device elements, allowing mockups to continue seamlessly onto adjacent screens.
- Implemented a `SpanGhostItem` component to visually represent the continuation of spanning mockups in the editor.
- Updated relevant components and tests to support and validate the new spanning functionality.
- Enhanced the UI with a toggle button for enabling/disabling the spanning feature.
- Updated the AI generation process to allow API keys to be entered directly in the browser and stored in localStorage, with optional fallback to `.env.local` for local development.
- Improved the user interface to manage API keys, including a new dialog for entering keys and updated messaging to clarify key requirements.
- Refactored components to utilize the new key management system, ensuring a seamless experience for users when configuring AI providers.
- Enhanced documentation to reflect changes in key handling and security practices.
- Updated overlay asset generation to include a per-run budget, limiting the number of `create_overlay_asset` calls to prevent excessive usage of the OpenAI API.
- Enhanced the chroma key processing to measure the actual backdrop color dynamically, improving the accuracy of background removal.
- Added new tests to validate the budget management and chroma key detection functionalities.
- Updated documentation to reflect the new budget constraints and improved chroma key workflow, ensuring clarity for users on the overlay asset generation process.
- Added support for generating overlay assets using OpenAI's gpt-image-2, allowing for custom graphics like badges and stickers.
- Implemented new functions in the AI controller to manage overlay assets, including asset registration and background removal.
- Enhanced the AI generation modal to include an option for enabling overlay assets, with corresponding UI updates for user interaction.
- Updated documentation to reflect the new overlay asset workflow and its integration within the AI generation process.
- Added tests to validate the functionality of overlay asset generation and ensure proper integration with existing tools.
- Introduced 'max' as a new reasoning effort option for the Moonshot/Kimi K3 model, allowing for more granular control.
- Updated relevant functions and types to accommodate the new reasoning effort, ensuring compatibility with the AI SDK.
- Enhanced tests to validate the new reasoning effort options and their integration within the AI provider catalog.
- Adjusted documentation to reflect changes in reasoning effort handling and model-specific options.
- Updated reasoning effort logic to default to 'high' when supported by the selected model, otherwise 'medium'.
- Removed 'provider-default' option from reasoning efforts to streamline user experience.
- Enhanced tests to validate new reasoning effort defaults and clamping behavior.
- Adjusted documentation to reflect changes in reasoning effort selection and defaults.
- Updated the AI generation modal to include a model picker grouped by provider, with reasoning effort displayed as secondary chips.
- Introduced new utility functions `findAiModelById` and `clampAiReasoningEffort` to manage model selection and reasoning effort constraints.
- Refactored provider controls to streamline model selection and reasoning effort changes.
- Enhanced tests to cover new functionality and ensure proper integration of reasoning efforts.
- Updated documentation to reflect changes in the AI model selection process.
- Introduced xAI as a new AI provider in the application.
- Updated environment variables to include VITE_XAI_API_KEY.
- Modified relevant documentation to reflect the addition of xAI.
- Enhanced provider catalog and configuration to support xAI's models and reasoning efforts.
- Updated tests to ensure proper integration of the new provider.
- Introduced IconPicker for selecting icons from a catalog with search functionality.
- Added IconGraphic component to render selected icons with customizable properties.
- Enhanced CanvasElementView to support icon elements, including rendering and toolbar controls.
- Updated ElementToolbar to include icon-specific settings and controls.
- Created new icon-related types and integrated them into the existing CanvasElement structure.
- Implemented icon addition functionality in the editor actions.
- Styled new components and integrated them into the sidebar and properties panel.
- Added new icons to the icon catalog for better selection options.
- Updated SECURITY.md to clarify the handling of AI provider keys and deployment guidelines.
- Modified bun.lock and package.json to include new AI SDK dependencies for Alibaba, Anthropic, Google, and OpenAI.
- Refactored architecture documentation to reflect changes in AI provider integration and proxy usage.
- Revised ai-generation documentation to outline the new direct browser calls to AI providers.
- Enhanced the AI generation logic in runner.ts to support multiple AI providers and their respective models.
- Implemented AiProviderControls component to manage provider and model selection in the UI.
- Added CSS styles for new AI provider controls and warnings.
- Created provider catalog and configuration files to manage AI provider keys and availability.
- Developed unit tests for provider catalog and configuration to ensure correct functionality.
- Translated various UI labels and tooltips from German to English in Sidebar, PropertiesPanel, and other components.
- Updated text presets in use-editor-actions to reflect English phrases.
- Changed error messages in persistence and utils to English.
- Modified shape groups and font categories to use English terms.
- Adjusted mockup labels for device options to English.
- Added unit tests for AI prompt language to ensure English requirements are enforced.