feat(assistant): the book designer works from a brief, with archetype covers, lively spreads and stickers

- design_book takes a brief (energy, decoration, collages, theme), a cover
  archetype and a cover lockup, and pages.overrides that give single pages of
  the plan another beat or layout. Directives written before parse as they
  did, and a design asked for none of it is composed exactly as before.
- The engine composes the seven cover archetypes from the book's own photos,
  words, theme faces and colours, lockups, shapes and stickers, varied by the
  seed: spine band, poster pop, cut-out, illustrated postcard, grid and
  badge, minimal serif and stamp collage. A title the directives give a
  display tier is held to it, and the notes say when a band, a badge or a
  stamp holds it smaller or a cover leaves a layout out.
- A lively or loud book turns two in five hero and grid spreads into
  collages, script overlays, badge grids, stamp rows or two-tone splits, the
  first of them always, turns and frames the prints of its other pages, sets
  its cover title larger and takes one or two, or three to six, stickers of
  its theme's motifs a spread, never over words, a photo's detail or the
  fold. A calm book asked for collages gets them and nothing else.
- Every turn the engine gives a print or a sticker stays within what the
  brief's energy takes, a calm book's within its theme's own, so a design is
  never judged against its own brief.
- New checks name a flat cover, a page without a lead, colours or faces off
  the theme and, for a design made with a brief, a book livelier or calmer
  than it asked, on the pages the design made and on a page revised in the
  draft. Page edits answer with the art checks too, and the assistant's
  cards name them in every language.
- list_book_assets lists the shapes, faces, lockups, themes and patterns
  beside the stickers, and the Studio's shape groups and photo frames are one
  list the assistant reads too.
- The Studio prompt gains an index of themes, archetypes and faces and JSON
  recipes of the elements to add and style for each cover and three lively
  spreads, and a turn that designs the book may preview sixteen pages, still
  three images a request; a viewer is told of none of it.
This commit is contained in:
Maurice
2026-10-23 23:14:25 +00:00
parent ff749611c6
commit 5651c11803
141 changed files with 6007 additions and 268 deletions
@@ -0,0 +1,141 @@
import type { BookPattern } from '../book-paint.schema';
import type { BookShapeId } from '../book.schema';
/**
* One English line on each shape and each pattern, for `list_book_assets`: what
* a model picking one it cannot see needs to know. Data, not code: the
* catalogues themselves (the outlines in book-shapes-more.ts and the client's
* shapes.ts, the repeats in the paint renderer) stay where they are drawn.
*/
export const BOOK_SHAPE_LINES: Readonly<Record<BookShapeId, string>> = {
rect: 'A rectangle; with a radius a rounded card, with an edge a stamp or a torn sheet.',
ellipse: 'A circle or an oval: a badge, a sun, a round photo.',
line: 'A straight rule, its height the thickness; for a drawn line with points use the line kind.',
triangle: 'A triangle pointing up: a pennant, a mountain, a sail.',
'triangle-down': 'A triangle pointing down.',
diamond: 'A diamond, a square stood on its corner.',
parallelogram: 'A slanted rectangle, for a band that leans.',
trapezoid: 'A trapezoid, wider at the foot.',
pentagon: 'A five-sided polygon.',
hexagon: 'A six-sided polygon, pointed at the top.',
'hexagon-flat': 'A six-sided polygon, flat at the top.',
heptagon: 'A seven-sided polygon.',
octagon: 'An eight-sided polygon.',
arch: 'A round-topped arch, a window or a door.',
'half-circle': 'A half circle, flat side down: a setting sun.',
'quarter-circle': 'A quarter circle, for a corner.',
capsule: 'A pill shape with round ends: a label, a chip.',
squircle: 'A soft square between a square and a circle.',
'star-4': 'A four-pointed star.',
'star-5': 'A five-pointed star.',
'star-6': 'A six-pointed star.',
'star-8': 'An eight-pointed star.',
'star-12': 'A twelve-pointed star, almost a burst.',
burst: 'A spiky burst, an exclamation behind a word.',
seal: 'A round seal with a wavy rim, a badge or a sticker.',
sparkle: 'A four-armed sparkle that glints beside a title.',
'arrow-right': 'A block arrow pointing right.',
'arrow-left': 'A block arrow pointing left.',
'arrow-up': 'A block arrow pointing up.',
'arrow-down': 'A block arrow pointing down.',
'arrow-both': 'A block arrow pointing both ways.',
'chevron-right': 'A chevron pointing right.',
'chevron-left': 'A chevron pointing left.',
'arrow-bent': 'A block arrow that turns a corner.',
'bubble-round': 'A round speech bubble with a tail.',
'bubble-square': 'A square speech bubble with a tail.',
'bubble-oval': 'An oval speech bubble with a tail.',
'bubble-think': 'A thought bubble of clouds.',
heart: 'A heart.',
cloud: 'A flat cloud.',
'cloud-puffy': 'A puffy cloud of round lobes.',
drop: 'A water drop.',
moon: 'A crescent moon.',
sun: 'A sun with rays.',
'flower-5': 'A flower of five petals.',
'flower-6': 'A flower of six petals.',
leaf: 'A simple leaf.',
cross: 'A diagonal cross, an X.',
plus: 'A plus sign.',
shield: 'A shield, a crest.',
gear: 'A cog wheel.',
ticket: 'A ticket with notched sides.',
wave: 'A band of waves: the sea, or a postmark cancel.',
mountain: 'A mountain with a snow cap.',
compass: 'A compass rose.',
pin: 'A map pin.',
'blob-1': 'An organic blob, a soft splash of colour behind a photo.',
'blob-2': 'An organic blob, rounder.',
'blob-3': 'An organic blob, longer.',
'blob-4': 'An organic blob, lobed.',
'banner-ribbon': 'A ribbon banner with folded ends, for a title across it.',
'banner-pennant': 'A pennant flag.',
'banner-bookmark': 'A bookmark ribbon with a notched foot.',
'banner-flag': 'A waving flag.',
'arch-tall': 'A tall round-topped arch, the Mediterranean window a photo is cut to.',
'arch-pointed': 'A pointed gothic arch.',
'arch-double': 'Two arches side by side.',
'arch-half': 'Half an arch, rounded on one side.',
'arch-rainbow': 'A rainbow arch of bands.',
'leaf-palm': 'A palm leaf cut out of paper.',
'leaf-oak': 'An oak leaf cut out of paper.',
'leaf-long': 'A long narrow leaf cut out of paper.',
'leaf-monstera': 'A monstera leaf with its holes, cut out of paper.',
'coral-1': 'A branching coral cut out of paper, in the manner of Matisse.',
'coral-2': 'A second, bushier coral cut-out.',
seaweed: 'A wavy strand of seaweed cut out of paper.',
'star-organic': 'A hand-cut wonky star.',
'sun-cutout': 'A hand-cut sun with uneven rays.',
'organic-1': 'A hand-cut rounded shape, a pebble.',
'organic-2': 'A hand-cut shape, a soft bean.',
'organic-3': 'A hand-cut shape, an uneven oval.',
'stamp-rect': 'A postage stamp with a perforated edge; masks a photo as a stamp.',
'stamp-circle': 'A round perforated stamp.',
postmark: 'A round postmark of two rings.',
rosette: 'A rosette with a scalloped rim.',
'scallop-circle': 'A circle with a scalloped edge, a label.',
'badge-shield': 'A shield-shaped badge.',
'label-tab': 'A luggage label with a hole.',
'ticket-stub': 'A ticket stub with round notches.',
'sunburst-12': 'A sunburst of twelve rays.',
'sunburst-24': 'A sunburst of twenty-four rays, behind a photo or a title.',
'ribbon-ends': 'A band with forked ends.',
'ribbon-arc': 'A ribbon curved into an arc, for a title over it.',
'wavy-band': 'A wavy band across a page.',
'torn-strip': 'A strip of torn paper.',
'bubble-shout': 'A spiky shout bubble.',
'bubble-side': 'A speech bubble with its tail at the side.',
'bubble-capsule': 'A capsule speech bubble.',
'arrow-curve': 'A drawn arrow that curves.',
'arrow-circle': 'A drawn arrow that circles round.',
'arrow-notched': 'A notched block arrow.',
'arrow-thin': 'A thin drawn arrow.',
'heart-round': 'A round, plump heart.',
'heart-pair': 'Two hearts together.',
'star-rounded': 'A star with rounded points.',
'star-twinkle': 'A twinkling star of thin arms.',
'flower-8': 'A flower of eight petals.',
'frame-notched': 'A frame with notched corners, for a photo.',
'frame-chamfer': 'A frame with cut corners, for a photo.',
'frame-cushion': 'A cushion frame with soft bulging sides, for a photo.',
'flourish-scroll': 'A scrolling flourish, an ornament under a title.',
laurel: 'A laurel wreath, round a date or a number.',
fleuron: "A fleuron, the printer's flower set between paragraphs.",
'corner-flourish': 'A flourish for the corner of a page.',
};
export const BOOK_PATTERN_LINES: Readonly<Record<BookPattern, string>> = {
checker: 'Squares of two colours in a chequerboard, a picnic cloth or a tiled floor.',
gingham: 'Gingham, a woven check of crossing bands.',
stripes: 'Broad stripes, a deckchair or an awning.',
pinstripe: 'Fine stripes, a shirt.',
dots: 'Small dots in rows.',
polka: 'Large polka dots.',
zigzag: 'A zigzag chevron.',
waves: 'Rows of waves.',
grid: 'A fine grid of lines, graph paper.',
scales: 'Overlapping half circles, fish scales or roof tiles.',
sunburst: 'Rays from a centre, a sunburst.',
confetti: 'Scattered confetti.',
};