Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(writers-room): per-work world style for image gen with curated presets
Adam Eivy62d2314b4c6f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 6f20d157d5..fa3bcaa9b8 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Added+- **Writers Room — per-work world style for image gen.** Each Work now carries an `imageStyle = { presetId, prompt, negativePrompt }` field that gets prepended to every scene's image-gen prompt, keeping the storyboard visually consistent across scenes. Ships with 9 curated presets (cinematic, film noir, cyberpunk neon, Studio Ghibli, Pixar 3D, graphic novel, watercolor storybook, comic book, photorealistic) defined in `server/lib/writersRoomStylePresets.js` — code-shipped reference data, not gitignored, so every install gets the same starting set. Picking a preset fills editable prompt + negative-prompt textareas in the storyboard's existing image-gen settings popover; editing the text flips the discriminator to `'custom'` so the dropdown reflects that the prompt no longer matches the curated text. Style is the FIRST token in the composed prompt because diffusion models weight early tokens heaviest (`{worldStyle}. {workTitle}. Featuring — {chars}. {scene.visualPrompt}`). The `negativePrompt` flows through the existing `generateImage` route and is honored by all three runners (local FLUX, codex, external SDAPI). A `🎨 <preset>` chip appears next to the storyboard's scene-count when a style is active. New endpoint `GET /api/writers-room/style-presets`. Touched: `server/lib/{writersRoomStylePresets.js,validation.js}`, `server/services/writersRoom/local.js`, `server/routes/writersRoom.js`, `client/src/components/writers-room/{StoryboardPanel,SceneCard,sceneCardHelpers,WorkEditor}.jsx`, `client/src/services/apiWritersRoom.js`.+- **Writers Room — vertical Storyboard companion + UX cleanup.** The AI/Outline/Versions tabbed sidebar is replaced with an always-on `StoryboardPanel` that shows the latest Adapt analysis as a vertical column of scene cards (heading, slugline, image, summary, character chips, visual prompt). Each card has a per-scene image regenerate button and a "Debug" overflow menu that scopes follow-up tools (Why this image / Check characters / Editorial pass / Jump to prose) to that one scene. Stale banner appears when the active draft's `contentHash` differs from the analysis's `sourceContentHash`, with a one-click re-run. Click a card heading to jump the prose textarea to that scene — falls back to scene-summary substring or scene-index proportional scroll when the LLM heading doesn't match the user's prose verbatim. The header collapses to title + status + Save + Snapshot + a single `(•••)` overflow menu (AI section: Run Adapt / Refresh characters / Editorial pass / Format pass · Open section: Outline / Versions / Characters [badge count] / Analysis history · View section: reading-theme toggle / Write-for-10 toggle). Outline, Versions, Characters, and Analysis history each open as a slide-over `Drawer` instead of competing with the storyboard for sidebar real estate. Mobile (<lg): a Writing/Storyboard segmented toggle replaces the previous stacked layout, fixing the double-scroll problem. The page-level Write-for-10 button moves into the work overflow menu so the Writers Room shell header is now title-only. New files: `StoryboardPanel.jsx`, `SceneCard.jsx`, `CharactersBible.jsx`, `AnalysisHistory.jsx`, `sceneCardHelpers.js`. Removed: `AiPanel.jsx` (decomposed into the above). Touched: `client/src/components/writers-room/WorkEditor.jsx`, `client/src/pages/WritersRoom.jsx`.- **Writers Room — character bible with image-gen prompt injection.** New `Characters` AI action extracts a per-work character roster (name, aliases, role, image-gen-ready physical description, personality, background) and merges it into an editable bible at `data/writers-room/works/<id>/characters.json`. Re-running the pass preserves any field the writer has already filled in (matched by canonical name OR alias, case-insensitive) and only fills blanks; prose-derived metadata (`firstAppearance`, `evidence`, `missingFromProse`) refreshes every run so the writer can see which fields the prose still doesn't support. Inline editor in the AI panel for create/edit/delete. The script-stage `SceneCard` now matches each scene's `characters` list against the bible and prepends `Featuring — <Name>: <physical description>` to the image-gen prompt before render, so the same character looks consistent across scenes. Matched character chips on the scene card show a port-accent border so the writer can see at a glance which characters in a scene have linked profiles. New routes: `GET/POST /api/writers-room/works/:id/characters`, `PATCH/DELETE /api/writers-room/works/:id/characters/:characterId`. New prompt stage `writers-room-characters` (sample + live). Touched: `server/services/writersRoom/{characters.js,evaluator.js}`, `server/routes/writersRoom.js`, `server/lib/{validation,writersRoomPresets}.js`, `client/src/components/writers-room/AiPanel.jsx`, `client/src/services/apiWritersRoom.js`, `data{,sample}/prompts/{stages/writers-room-characters.md,stage-config.json}`, `server/services/writersRoom/characters.test.js`.diff --git a/client/src/components/writers-room/SceneCard.jsx b/client/src/components/writers-room/SceneCard.jsxindex 63e3437e2d..8f0666076f 100644--- a/client/src/components/writers-room/SceneCard.jsx+++ b/client/src/components/writers-room/SceneCard.jsx@@ -28,6 +28,7 @@ export default function SceneCard({analysisId,workTitle,imageCfg = WR_IMAGE_DEFAULTS,+ imageStyle = null,initialImage = null,readingTheme = 'dark',charByKey = null,@@ -142,9 +143,10 @@ export default function SceneCard({setError(null);setProgress(null);setGenerated(null);- const prompt = buildScenePromptWithCharacters(workTitle, scene, matchedCharacters);+ const prompt = buildScenePromptWithCharacters(workTitle, scene, matchedCharacters, imageStyle?.prompt || '');const res = await generateImage({prompt,+ negativePrompt: imageStyle?.negativePrompt || '',modelId: imageCfg.modelId,mode: imageCfg.mode,width: imageCfg.width,diff --git a/client/src/components/writers-room/StoryboardPanel.jsx b/client/src/components/writers-room/StoryboardPanel.jsxindex 0c16dcc5dd..638fb0b449 100644--- a/client/src/components/writers-room/StoryboardPanel.jsx+++ b/client/src/components/writers-room/StoryboardPanel.jsx@@ -1,9 +1,10 @@import { useCallback, useEffect, useMemo, useRef, useState } from 'react';-import { Clapperboard, Loader2, RefreshCcw, Settings as SettingsIcon, AlertTriangle } from 'lucide-react';+import { Clapperboard, Loader2, RefreshCcw, Settings as SettingsIcon, AlertTriangle, Palette, Check } from 'lucide-react';import toast from '../ui/Toast';import {listWritersRoomAnalyses,getWritersRoomAnalysis,+ listWritersRoomStylePresets,} from '../../services/apiWritersRoom';import { getSettings, updateSettings } from '../../services/apiSystem';import { listImageModels } from '../../services/apiImageVideo';@@ -16,6 +17,8 @@ import {readWrImageSettings,} from './sceneCardHelpers';+const EMPTY_STYLE = { presetId: 'none', prompt: '', negativePrompt: '' };+export default function StoryboardPanel({work,characters = [],@@ -25,23 +28,29 @@ export default function StoryboardPanel({runningAdapt = false,readingTheme = 'dark',activeSceneId = null,+ onStyleChange,}) {const [latestScript, setLatestScript] = useState(null);const [loading, setLoading] = useState(false);const [imageCfg, setImageCfg] = useState(WR_IMAGE_DEFAULTS);const [models, setModels] = useState([]);const [showSettings, setShowSettings] = useState(false);+ const [stylePresets, setStylePresets] = useState([]);const mountedRef = useMounted();+ const imageStyle = work.imageStyle || EMPTY_STYLE;+useEffect(() => {let cancelled = false;Promise.all([getSettings().catch(() => ({})),listImageModels().catch(() => []),- ]).then(([settings, modelList]) => {+ listWritersRoomStylePresets().catch(() => []),+ ]).then(([settings, modelList, presets]) => {if (cancelled) return;setImageCfg(readWrImageSettings(settings));setModels(Array.isArray(modelList) ? modelList : []);+ setStylePresets(Array.isArray(presets) ? presets : []);});return () => { cancelled = true; };}, []);@@ -103,6 +112,15 @@ export default function StoryboardPanel({{scenes.length} scene{scenes.length === 1 ? '' : 's'} · {timeAgo(latestScript.completedAt || latestScript.createdAt, 'never')}</span>)}+ {imageStyle.presetId !== 'none' && (+ <button+ onClick={() => setShowSettings((v) => !v)}+ className="text-port-accent/80 hover:text-port-accent flex items-center gap-1 text-[10px]"+ title="World style applied — click to edit"+ >+ <Palette size={11} /> {styleChip(imageStyle, stylePresets)}+ </button>+ )}<buttononClick={() => setShowSettings((v) => !v)}className="ml-auto text-gray-500 hover:text-white"@@ -114,7 +132,12 @@ export default function StoryboardPanel({</div>{showSettings && (- <div className="px-3 py-2 border-b border-port-border bg-port-card/30 shrink-0">+ <div className="px-3 py-2 border-b border-port-border bg-port-card/30 shrink-0 space-y-3">+ <WorldStyleRow+ value={imageStyle}+ presets={stylePresets}+ onChange={onStyleChange}+ /><ImageGenSettingsRow cfg={imageCfg} models={models} onChange={persistCfg} /></div>)}@@ -150,6 +173,7 @@ export default function StoryboardPanel({analysisId={latestScript.id}workTitle={work.title}imageCfg={imageCfg}+ imageStyle={imageStyle}initialImage={sceneImages[sceneId] || null}readingTheme={readingTheme}charByKey={charByKey}@@ -204,6 +228,124 @@ function StaleBanner({ onRunAdapt, runningAdapt }) {);}+function styleChip(style, presets) {+ if (!style || style.presetId === 'none') return null;+ if (style.presetId === 'custom') return 'Custom style';+ const p = presets.find((x) => x.id === style.presetId);+ return p?.label || style.presetId;+}++// World style picker — dropdown of curated presets + Custom + None.+// Selecting a preset fills the prompt textarea; the user can edit it freely+// from there, which flips the presetId to 'custom' the moment text diverges.+// Saves are debounced into a single PATCH on blur (not per-keystroke) — the+// onChange contract is "give me the next imageStyle" not "save it now."+function WorldStyleRow({ value, presets, onChange }) {+ const [draftPrompt, setDraftPrompt] = useState(value.prompt || '');+ const [draftNeg, setDraftNeg] = useState(value.negativePrompt || '');++ // Pull the saved value down when the work id swaps (or anything else that+ // replaces the value object identity from the parent).+ useEffect(() => {+ setDraftPrompt(value.prompt || '');+ setDraftNeg(value.negativePrompt || '');+ }, [value.presetId, value.prompt, value.negativePrompt]);++ const pickPreset = (presetId) => {+ if (presetId === 'none') {+ onChange?.({ presetId: 'none', prompt: '', negativePrompt: '' });+ return;+ }+ if (presetId === 'custom') {+ // Keep whatever's in the textarea — just flip the discriminator.+ onChange?.({ presetId: 'custom', prompt: draftPrompt, negativePrompt: draftNeg });+ return;+ }+ const preset = presets.find((p) => p.id === presetId);+ if (!preset) return;+ onChange?.({ presetId: preset.id, prompt: preset.prompt, negativePrompt: preset.negativePrompt });+ };++ const commitDraft = () => {+ if (draftPrompt === value.prompt && draftNeg === value.negativePrompt) return;+ // If the user edited a preset's text, flip to 'custom' so the dropdown+ // reflects that the prompt no longer matches the curated preset.+ const matchingPreset = presets.find((p) => p.id === value.presetId);+ const stillMatchesPreset = matchingPreset+ && matchingPreset.prompt === draftPrompt+ && matchingPreset.negativePrompt === draftNeg;+ onChange?.({+ presetId: stillMatchesPreset ? value.presetId : 'custom',+ prompt: draftPrompt,+ negativePrompt: draftNeg,+ });+ };++ return (+ <div className="space-y-1.5">+ <div className="flex items-center justify-between">+ <span className="text-[9px] uppercase tracking-wider text-gray-500 flex items-center gap-1">+ <Palette size={10} /> World style+ </span>+ {value.presetId !== 'none' && (+ <button+ type="button"+ onClick={() => pickPreset('none')}+ className="text-[9px] text-gray-500 hover:text-port-error"+ title="Clear style"+ >+ Clear+ </button>+ )}+ </div>+ <select+ value={value.presetId}+ onChange={(e) => pickPreset(e.target.value)}+ className="w-full bg-port-bg border border-port-border rounded px-2 py-1 text-[11px] text-gray-200"+ >+ <option value="none">None — use scene visualPrompt only</option>+ <optgroup label="Presets">+ {presets.map((p) => (+ <option key={p.id} value={p.id}>{p.label}</option>+ ))}+ </optgroup>+ <option value="custom">Custom</option>+ </select>+ {value.presetId !== 'none' && (+ <>+ <label className="block">+ <span className="text-[9px] uppercase tracking-wider text-gray-500">+ Style prompt {value.presetId === 'custom' && <Check size={9} className="inline text-port-accent" />}+ </span>+ <textarea+ value={draftPrompt}+ onChange={(e) => setDraftPrompt(e.target.value)}+ onBlur={commitDraft}+ rows={3}+ placeholder="cinematic still, anamorphic lens…"+ className="w-full mt-0.5 bg-port-bg border border-port-border rounded px-2 py-1 text-[11px] text-gray-200 font-sans resize-y"+ />+ </label>+ <label className="block">+ <span className="text-[9px] uppercase tracking-wider text-gray-500">Negative prompt (optional)</span>+ <textarea+ value={draftNeg}+ onChange={(e) => setDraftNeg(e.target.value)}+ onBlur={commitDraft}+ rows={2}+ placeholder="cartoon, low quality…"+ className="w-full mt-0.5 bg-port-bg border border-port-border rounded px-2 py-1 text-[11px] text-gray-200 font-sans resize-y"+ />+ </label>+ <div className="text-[10px] text-gray-500">+ Style is prepended to every scene's image prompt. Re-render scenes to see the change.+ </div>+ </>+ )}+ </div>+ );+}+function ImageGenSettingsRow({ cfg, models, onChange }) {const RES_PRESETS = [{ label: '768×512 (3:2)', width: 768, height: 512 },diff --git a/client/src/components/writers-room/WorkEditor.jsx b/client/src/components/writers-room/WorkEditor.jsxindex 4ca01e8b06..83488e3b04 100644--- a/client/src/components/writers-room/WorkEditor.jsx+++ b/client/src/components/writers-room/WorkEditor.jsx@@ -175,6 +175,17 @@ export default function WorkEditor({ work, onChange, onToggleExercise, exerciseOonChange?.({ ...updated, activeDraftBody: body });};+ const commitImageStyle = async (next) => {+ const updated = await updateWritersRoomWork(work.id, { imageStyle: next }).catch((err) => {+ if (mountedRef.current) toast.error(`Style save failed: ${err.message}`);+ return null;+ });+ if (updated && mountedRef.current) {+ onChange?.({ ...updated, activeDraftBody: body });+ toast.success(next.presetId === 'none' ? 'World style cleared' : 'World style saved');+ }+ };+const commitStatus = async (next) => {if (next === status) return;setStatus(next);@@ -486,6 +497,7 @@ export default function WorkEditor({ work, onChange, onToggleExercise, exerciseOrunningAdapt={runningKind === ANALYSIS_KIND.SCRIPT}readingTheme={readingTheme}activeSceneId={activeSceneId}+ onStyleChange={commitImageStyle}/></aside></div>diff --git a/client/src/components/writers-room/sceneCardHelpers.js b/client/src/components/writers-room/sceneCardHelpers.jsindex 0ed6a67388..5b3c35c0ca 100644--- a/client/src/components/writers-room/sceneCardHelpers.js+++ b/client/src/components/writers-room/sceneCardHelpers.js@@ -52,17 +52,19 @@ export function matchSceneCharacters(sceneCharacterNames = [], charByKey) {const PROMPT_MAX = 1900;// scene.visualPrompt is the load-bearing part of the image prompt — it must-// always survive truncation. Reserve room for title + visual prompt first,-// then fit the "Featuring" block into whatever is left, dropping characters-// one-by-one if needed.-export function buildScenePromptWithCharacters(workTitle, scene, matchedCharacters) {+// always survive truncation. Reserve room for style + title + visual prompt+// first, then fit the "Featuring" block into whatever is left, dropping+// characters one-by-one if needed. The world style goes FIRST because+// diffusion models weight early tokens heaviest.+export function buildScenePromptWithCharacters(workTitle, scene, matchedCharacters, worldStyle = '') {+ const stylePart = worldStyle && worldStyle.trim() ? `${worldStyle.trim()}. ` : '';const titlePart = workTitle ? `${workTitle}. ` : '';const visual = scene.visualPrompt || '';const featuringFragments = (matchedCharacters || []).filter((c) => c.physicalDescription && c.physicalDescription.trim()).map((c) => `${c.name}: ${c.physicalDescription.trim()}`);const PREFIX = 'Featuring — ';- const reserveForVisual = titlePart.length + visual.length + 1;+ const reserveForVisual = stylePart.length + titlePart.length + visual.length + 1;let budget = PROMPT_MAX - reserveForVisual - PREFIX.length;const fitFragments = [];for (const frag of featuringFragments) {@@ -71,7 +73,9 @@ export function buildScenePromptWithCharacters(workTitle, scene, matchedCharactefitFragments.push(frag);budget -= cost;}- const segs = [titlePart.trim()];+ const segs = [];+ if (stylePart) segs.push(stylePart.trim());+ if (titlePart) segs.push(titlePart.trim());if (fitFragments.length > 0) segs.push(`${PREFIX}${fitFragments.join(' ')}`);if (visual) segs.push(visual);return segs.filter(Boolean).join(' ').slice(0, PROMPT_MAX);diff --git a/client/src/services/apiWritersRoom.js b/client/src/services/apiWritersRoom.jsindex 380c1b524d..3310e61d4c 100644--- a/client/src/services/apiWritersRoom.js+++ b/client/src/services/apiWritersRoom.js@@ -2,6 +2,9 @@ import { request } from './apiCore.js';const enc = encodeURIComponent;+// Style presets — curated reference data for the world-style picker.+export const listWritersRoomStylePresets = () => request('/writers-room/style-presets');+// Foldersexport const listWritersRoomFolders = () => request('/writers-room/folders');export const createWritersRoomFolder = (data) => request('/writers-room/folders', {diff --git a/server/lib/validation.js b/server/lib/validation.jsindex dcf7f42d72..1a66fc3a7f 100644--- a/server/lib/validation.js+++ b/server/lib/validation.js@@ -2,6 +2,7 @@ import { z } from 'zod';import { ServerError } from './errorHandler.js';import { ASPECT_RATIOS, QUALITIES, PROJECT_STATUSES, SCENE_STATUSES } from './creativeDirectorPresets.js';import { WORK_KINDS, WORK_STATUSES, ANALYSIS_KINDS } from './writersRoomPresets.js';+import { STYLE_PRESET_IDS, SPECIAL_STYLE_IDS } from './writersRoomStylePresets.js';// =============================================================================// AGENT PERSONALITY SCHEMAS@@ -492,11 +493,22 @@ export const writersRoomWorkCreateSchema = z.object({folderId: wrIdNullable.optional()}).strict();+export const writersRoomImageStyleSchema = z.object({+ // 'none' (no style applied), 'custom' (user-authored prompt with no preset),+ // or one of the curated preset ids. The resolved prompt text lives on the+ // work — picking a preset later doesn't retroactively change historical+ // works' rendering.+ presetId: z.enum(['none', ...SPECIAL_STYLE_IDS.filter((id) => id !== 'none'), ...STYLE_PRESET_IDS]).default('none'),+ prompt: z.string().max(2000).default(''),+ negativePrompt: z.string().max(2000).default(''),+}).strict();+export const writersRoomWorkUpdateSchema = z.object({title: z.string().trim().min(1).max(300).optional(),kind: writersRoomWorkKindSchema.optional(),status: writersRoomWorkStatusSchema.optional(),- folderId: wrIdNullable.optional()+ folderId: wrIdNullable.optional(),+ imageStyle: writersRoomImageStyleSchema.optional(),}).strict();export const writersRoomDraftSaveSchema = z.object({diff --git a/server/lib/writersRoomStylePresets.js b/server/lib/writersRoomStylePresets.jsnew file mode 100644index 0000000000..eb9f45e311--- /dev/null+++ b/server/lib/writersRoomStylePresets.js@@ -0,0 +1,81 @@+// Style presets for the per-Work "world style" image-gen prompt prefix.+// These ship as code (not gitignored data) so every install gets the same+// curated starting set. Each work stores the *resolved* prompt text on its+// manifest, not the preset id alone — so editing a preset here doesn't+// silently change historical works.++export const STYLE_PRESETS = [+ {+ id: 'cinematic',+ label: 'Cinematic',+ description: 'Film-still aesthetic. Anamorphic lenses, color grading, 35mm.',+ prompt: 'cinematic still, anamorphic lens, shallow depth of field, dramatic lighting, film grain, color graded, 35mm photography, atmospheric',+ negativePrompt: 'cartoon, anime, illustration, painting, low quality, blurry',+ },+ {+ id: 'noir',+ label: 'Film noir',+ description: 'High-contrast black and white, 1940s detective drama.',+ prompt: 'black and white film noir, high contrast chiaroscuro, deep shadows, venetian blind lighting, 1940s detective aesthetic, smoky atmosphere, cinematic composition',+ negativePrompt: 'color photo, modern, cartoon, anime, low contrast',+ },+ {+ id: 'cyberpunk-neon',+ label: 'Cyberpunk neon',+ description: 'Neon-soaked future cities, holograms, wet streets.',+ prompt: 'neon-soaked cyberpunk cityscape, wet rain-slick streets, holographic signage, RGB rim lighting, blade runner aesthetic, dense atmosphere, hyperdetailed',+ negativePrompt: 'natural daylight, rural, vintage, bright sky, cartoon',+ },+ {+ id: 'ghibli',+ label: 'Studio Ghibli',+ description: 'Hand-painted watercolor backgrounds, expressive characters.',+ prompt: 'studio ghibli animation, hand-painted watercolor backgrounds, soft pastel palette, expressive characters, miyazaki style, whimsical, gentle lighting',+ negativePrompt: 'photorealistic, photograph, 3d render, realistic, harsh shadows, gritty',+ },+ {+ id: 'pixar',+ label: 'Pixar 3D',+ description: 'Vibrant 3D animated movie style with soft lighting.',+ prompt: 'pixar 3d animation style, expressive cartoon characters, vibrant saturated colors, soft volumetric lighting, polished render, cinematic depth of field',+ negativePrompt: 'photorealistic, photograph, anime, hand-drawn, sketch',+ },+ {+ id: 'graphic-novel',+ label: 'Graphic novel',+ description: 'Bold ink linework, halftone shading, limited palette.',+ prompt: 'graphic novel illustration, bold ink outlines, halftone shading, limited muted color palette, sequential art panels, mike mignola influence, cinematic framing',+ negativePrompt: 'photorealistic, photograph, 3d render, soft watercolor, anime',+ },+ {+ id: 'watercolor-storybook',+ label: 'Watercolor storybook',+ description: "Children's-book illustration, soft edges, warm palette.",+ prompt: "watercolor children's storybook illustration, soft watercolor edges, warm pastel palette, hand-drawn ink lines, cozy and whimsical, gentle composition",+ negativePrompt: 'photorealistic, photograph, dark, gritty, cyberpunk, harsh',+ },+ {+ id: 'comic-book',+ label: 'Comic book',+ description: 'American comic book art, ink and color, dynamic angles.',+ prompt: 'american comic book art, dynamic poses, bold ink and flat color, ben-day dots, dramatic angles, action-oriented composition, jim lee influence',+ negativePrompt: 'photorealistic, photograph, soft watercolor, anime, low contrast',+ },+ {+ id: 'photorealistic',+ label: 'Photorealistic',+ description: 'Photographic realism, natural lighting, hyperdetailed.',+ prompt: 'photorealistic, hyperdetailed, natural lighting, professional photography, sharp focus, 8k, high dynamic range',+ negativePrompt: 'cartoon, anime, illustration, painting, sketch, 3d render',+ },+];++export const STYLE_PRESET_IDS = STYLE_PRESETS.map((p) => p.id);++// 'custom' = user wrote their own prompt without picking a preset.+// 'none' = no style applied (image-gen uses scene visualPrompt verbatim).+export const SPECIAL_STYLE_IDS = ['none', 'custom'];++export function findStylePreset(id) {+ return STYLE_PRESETS.find((p) => p.id === id) || null;+}diff --git a/server/routes/writersRoom.js b/server/routes/writersRoom.jsindex 43feea69df..4ed95f1002 100644--- a/server/routes/writersRoom.js+++ b/server/routes/writersRoom.js@@ -32,9 +32,14 @@ import {listCharacters, createCharacter, updateCharacter, deleteCharacter,} from '../services/writersRoom/characters.js';import { addItem as addCollectionItem, ERR_DUPLICATE } from '../services/mediaCollections.js';+import { STYLE_PRESETS } from '../lib/writersRoomStylePresets.js';const router = Router();+// Curated world-style presets for image gen — code-shipped reference data,+// not user-mutable, so a simple GET is enough.+router.get('/style-presets', (_req, res) => res.json(STYLE_PRESETS));+// ---------- folders ----------router.get('/folders', asyncHandler(async (_req, res) => {diff --git a/server/services/writersRoom/local.js b/server/services/writersRoom/local.jsindex b18f1a2e88..53d4885c56 100644--- a/server/services/writersRoom/local.js+++ b/server/services/writersRoom/local.js@@ -313,7 +313,7 @@ export async function createWork({ folderId = null, title, kind = 'short-story'export async function updateWork(id, patch) {const manifest = await getWork(id);- const allowed = ['title', 'folderId', 'kind', 'status'];+ const allowed = ['title', 'folderId', 'kind', 'status', 'imageStyle'];const next = { ...manifest, updatedAt: nowIso() };for (const key of allowed) {if (patch[key] === undefined) continue;