Port GenerateImage, GenerateVideo and GenerateSpeech from ../ai, with
their chat cards (js/media.js): pending card with a timer, image grid for
several versions, full-screen image viewer, Download / Open, and replay
of past generations when a chat is reopened.
- generated files live in a per-chat .media/<chatId> folder beside the
project, so version snapshots and restores never touch them; deleting
a chat removes it, duplicating a chat copies it
- save_to_project puts a file into the site (counts as a project change);
copy and ViewImage can read from the chat's media folder
- system prompt: custom imagery for sites (max 4 images per turn), video
only on explicit request, speech only (no music or sound effects)
- Plausible events: Image/Video/Audio Generated and ... Generation Failed,
one per request, with the request's options and a failure reason;
prompts and file names are never sent
- tests: generated-media (incl. analytics) plus ai's card, lightbox and
read-URL tests; path-scoping and load-media-urls updated