From f24597dfdbf719958e4f27a492b28486f55dae44 Mon Sep 17 00:00:00 2001 From: mnovak Date: Sun, 1 Nov 2026 20:16:59 +0100 Subject: [PATCH] [art-prep] ArtBoard: Build prompts, stand-ins and the art board from the manifest, and accept pictures into art/final tools/art-prep reads art/STYLE.md (draft) and art/manifest.json (25 Phase 1 pictures), refuses forbidden words in any prompt, writes 29 stand-ins and the board files, and cuts and encodes accepted pictures as WebP within budget. --- art/STYLE.md | 192 ++++ art/manifest.json | 235 +++++ art/placeholders/app-icon.svg | 4 + art/placeholders/care-props-sheet.svg | 4 + art/placeholders/fallen-petals.svg | 4 + art/placeholders/garden-chair.svg | 4 + art/placeholders/garden-day.svg | 4 + art/placeholders/garden-morning.svg | 4 + art/placeholders/garden-night.svg | 4 + art/placeholders/garden-sunset.svg | 4 + art/placeholders/petal-folded.svg | 4 + art/placeholders/petal-open.svg | 4 + art/placeholders/rose-blushing.svg | 4 + art/placeholders/rose-bud.svg | 4 + art/placeholders/rose-care-sheet.svg | 4 + art/placeholders/rose-full-bloom.svg | 4 + art/placeholders/rose-half-bloom.svg | 4 + art/placeholders/rose-moments-sheet.svg | 4 + art/placeholders/rose-opening.svg | 4 + art/placeholders/rose-overwatered.svg | 4 + art/placeholders/rose-sheet.svg | 4 + art/placeholders/rose-sleepy.svg | 4 + art/placeholders/rose-speaking.svg | 4 + art/placeholders/rose-stages-sheet.svg | 4 + art/placeholders/rose-thirsty.svg | 4 + art/placeholders/rose-waiting.svg | 4 + art/placeholders/rose-watching-sunset.svg | 4 + art/placeholders/rose-windblown.svg | 4 + art/placeholders/watering-can.svg | 4 + art/placeholders/weed-clump.svg | 4 + art/placeholders/windbreak.svg | 4 + package.json | 4 +- pnpm-lock.yaml | 289 ++++++ pnpm-workspace.yaml | 1 + tools/art-prep/board/index.html | 1108 +++++++++++++++++++++ tools/art-prep/package.json | 21 + tools/art-prep/src/accept.ts | 166 +++ tools/art-prep/src/board.ts | 65 ++ tools/art-prep/src/cli-accept.ts | 36 + tools/art-prep/src/cli-board.ts | 35 + tools/art-prep/src/manifest.ts | 138 +++ tools/art-prep/src/placeholders.ts | 217 ++++ tools/art-prep/src/prompt.ts | 181 ++++ tools/art-prep/src/style.ts | 39 + tools/art-prep/test/accept.test.ts | 120 +++ tools/art-prep/test/board.test.ts | 61 ++ tools/art-prep/test/fixtures.ts | 10 + tools/art-prep/test/manifest.test.ts | 63 ++ tools/art-prep/test/prompt.test.ts | 96 ++ tools/art-prep/tsconfig.json | 7 + 50 files changed, 3199 insertions(+), 1 deletion(-) create mode 100644 art/STYLE.md create mode 100644 art/manifest.json create mode 100644 art/placeholders/app-icon.svg create mode 100644 art/placeholders/care-props-sheet.svg create mode 100644 art/placeholders/fallen-petals.svg create mode 100644 art/placeholders/garden-chair.svg create mode 100644 art/placeholders/garden-day.svg create mode 100644 art/placeholders/garden-morning.svg create mode 100644 art/placeholders/garden-night.svg create mode 100644 art/placeholders/garden-sunset.svg create mode 100644 art/placeholders/petal-folded.svg create mode 100644 art/placeholders/petal-open.svg create mode 100644 art/placeholders/rose-blushing.svg create mode 100644 art/placeholders/rose-bud.svg create mode 100644 art/placeholders/rose-care-sheet.svg create mode 100644 art/placeholders/rose-full-bloom.svg create mode 100644 art/placeholders/rose-half-bloom.svg create mode 100644 art/placeholders/rose-moments-sheet.svg create mode 100644 art/placeholders/rose-opening.svg create mode 100644 art/placeholders/rose-overwatered.svg create mode 100644 art/placeholders/rose-sheet.svg create mode 100644 art/placeholders/rose-sleepy.svg create mode 100644 art/placeholders/rose-speaking.svg create mode 100644 art/placeholders/rose-stages-sheet.svg create mode 100644 art/placeholders/rose-thirsty.svg create mode 100644 art/placeholders/rose-waiting.svg create mode 100644 art/placeholders/rose-watching-sunset.svg create mode 100644 art/placeholders/rose-windblown.svg create mode 100644 art/placeholders/watering-can.svg create mode 100644 art/placeholders/weed-clump.svg create mode 100644 art/placeholders/windbreak.svg create mode 100644 tools/art-prep/board/index.html create mode 100644 tools/art-prep/package.json create mode 100644 tools/art-prep/src/accept.ts create mode 100644 tools/art-prep/src/board.ts create mode 100644 tools/art-prep/src/cli-accept.ts create mode 100644 tools/art-prep/src/cli-board.ts create mode 100644 tools/art-prep/src/manifest.ts create mode 100644 tools/art-prep/src/placeholders.ts create mode 100644 tools/art-prep/src/prompt.ts create mode 100644 tools/art-prep/src/style.ts create mode 100644 tools/art-prep/test/accept.test.ts create mode 100644 tools/art-prep/test/board.test.ts create mode 100644 tools/art-prep/test/fixtures.ts create mode 100644 tools/art-prep/test/manifest.test.ts create mode 100644 tools/art-prep/test/prompt.test.ts create mode 100644 tools/art-prep/tsconfig.json diff --git a/art/STYLE.md b/art/STYLE.md new file mode 100644 index 0000000..447d05f --- /dev/null +++ b/art/STYLE.md @@ -0,0 +1,192 @@ +# STYLE.md — Rosea Domi art style + +The style system prompt for every picture in Rosea Domi. The pipeline that uses it is +[`docs/ART.md`](../docs/ART.md). Every prompt on the art board starts with **§1** word for +word, then adds the picture's own part, generated from [`manifest.json`](manifest.json). +A picture that is off-style goes back for another try. It is never shipped. + +> **Draft, 2026-11-01 — waiting for Mark.** Claude wrote this draft from CLAUDE.md §1 and +> GAMEPLAY.md. The roadmap says STYLE.md is drafted *with Mark*. The open choices are listed in +> §0. The first picture on the board, the rose's character sheet, is the test. If it looks +> wrong, this file changes before anything else is made. + +--- + +## 0. Open choices for Mark + +| # | Choice | The draft says | Why | +|:--|:--|:--|:--| +| S1 | The medium | Matte gouache on warm paper, with soft brush outlines | It is gentle and hand-made like the rest of Domi. It is also clearly not the book's look, which is a thin pen line with loose, pale watercolour. | +| S2 | Where the rose lives | A small garden bed on a hillside meadow, with a low dry-stone wall and a wide sky to the west | The sunset is real, so the scene needs a real horizon. It is an ordinary garden, never a tiny planet. | +| S3 | The rose's face | A face in the middle of the bloom: two small eyes, often half-closed, a tiny mouth and a blush | This is the description in CLAUDE.md §1, drawn as written. | +| S4 | The palette | §2 | It starts from the app's tokens (`--rose #b4485e`, `--paper #fbf6f1`). | +| S5 | The sky | Drawn in code, never painted | The sun moves at the player's real time, and the stars are the real constellations. A painted sky could do neither. | + +--- + +## 1. The system prompt (paste word for word) + +> Soft, hand-made 2D storybook illustration painted in matte gouache with a gentle dry-brush +> texture on warm off-white paper. Simple rounded shapes built from flat, soft colour areas with +> two or three gentle tonal steps; no wet watercolour blooms, no thin scratchy pen line. Outlines +> are soft, slightly irregular brush lines in deep plum-brown, never pure black, never a hard +> vector line. Light is low and warm, as late in the day, coming from the left. The mood is +> quiet, tender and hopeful, with generous calm space that never feels empty or bleak. +> Characters are cute but alive, with small gentle eyes, often half-closed, and tiny mouths. No +> text, letters or numbers anywhere in the image. No humans, no human figures, hands or faces, +> no photographs, no logos, no brand characters. No 3D render look, no glossy highlights, no lens +> effects, no gradients that look digital. Original artwork, not in the style of any existing +> book, illustrator or film. + +--- + +## 2. Palette + +The main tones. Small shades in between are fine. + +| Role | Colour | Hex | +|:--|:--|:--| +| Petals (main) | rose | `#C85A6E` | +| Petal edges and light | pale petal | `#F2B5BE` | +| Blush | warm pink | `#E8899B` | +| Leaves | sage | `#7FA07A` | +| Deep leaves and stem | moss | `#4F6E52` | +| Outlines | deep plum-brown | `#3A2730` | +| Paper | warm off-white | `#FBF6F1` | +| Soil and wall stones | warm umber | `#8A6248` | +| Wood | honey | `#B98A5A` | +| Meadow by day | soft green | `#A9C48E` | +| Sunset light | amber gold | `#F2B860` | +| Sunset glow | coral | `#E9846A` | +| Night | dusk indigo | `#2E3561` | +| Lamps and stars | lamp gold | `#F4D58D` | + +Never use neon, saturated primaries, pure black, pure white or cold greys. + +--- + +## 3. The rose + +The rose is the only character in Phase 1. Every rose picture follows the character sheet +`rose-sheet`, so she looks the same in every one. + +- **One garden rose** on a single slender stem. She is about three blooms tall, from the bloom + down to where the stem meets the soil. She has three leaves, two low and one high, and a few + small thorns with rounded tips. The thorns are part of her and never look threatening. +- **The bloom is her head.** It is made of soft, layered petals in rose (`#C85A6E`) that turn + pale petal (`#F2B5BE`) at the edges. Her face sits in the middle of the bloom: two small dark + eyes, often half-closed, and a tiny mouth. When she is tended, a faint blush (`#E8899B`) shows + on the petals by her cheeks. +- **A little vain.** She holds her head high and keeps her petals neat. Her leaves move like + small arms: one raised when she speaks, both lowered when she is thirsty. +- **Stages:** a tight bud, an opening bud, a half bloom and a full bloom. Each stage has the same + face and the same stem, and only the bloom changes. +- **Drift looks like waiting, never like hurt** (CLAUDE.md §8). Turned a little away, petals + closed a little, eyes looking down. She is never wilted, broken, crying, dead or losing + petals in pain. Fallen petals are a care task, not damage. +- **Expressions:** content, sleepy, blushing, speaking, thirsty, too much water, windblown, + waiting. Never angry, crying hard, frightened or hurt. + +--- + +## 4. The world + +- **The garden:** a small round garden bed on a hillside meadow. A low dry-stone wall sits + behind it, with wild grasses and a few small meadow flowers. The horizon is wide and low in + the west, on the left, where the sun sets. +- **The sky is drawn in code (S5).** Garden pictures are layers: everything above the horizon + is transparent. The sky, the sun, the moon and the real stars are drawn behind them. +- **Times of day:** morning, day, sunset and night. Each is its own layer, with its own light + on the same garden. +- **Care things:** a small watering can, a woven willow windbreak, weeds, fallen petals, and + the folded petal that holds the day's sentence. The words on a petal are added in code and + never painted. +- **The chair:** a small, weathered wooden garden chair. It is the one in the in-game sunset + ("move the chair, watch it again"). +- **Never in any picture:** a glass dome or bell jar over the rose, a folding screen, a tiny + round planet with someone standing on it, a desert, a child, a scarf, a boy with golden hair, + or anything that looks like a drawing from the book (GAMEPLAY.md §8: *a direction only — + never, ever copying the illustrations*). The willow windbreak is the shelter from the wind, + and it must look nothing like a screen. +- No flags, religious symbols, buildings, vehicles or people. + +--- + +## 5. Sizes and backgrounds + +Image generators offer 1024 × 1024, 1536 × 1024 and 1024 × 1536. Every picture is made at one +of those sizes. + +| Kind | Made at (px) | Background | Notes | +|:--|:--|:--|:--| +| Character sheet | 1536 × 1024 | full, plain paper | A reference only, never shown in the app | +| Sprite sheet | 1536 × 1024 | transparent | Cut into cells along its grid (§9) | +| Single picture | 1024 × 1024 | transparent | Centred, whole, about 10 % clear on every side, no ground shadow | +| Garden layer | 1024 × 1536 | transparent above the horizon | Horizon at 40 % from the top; keep the lower middle calm for the rose and the controls | +| App icon | 1024 × 1024 | full | Keep the bloom inside the middle 70 %; phones cut the corners | + +- Accepted pictures go into `art/final/` as WebP, within the size budget in `docs/ART.md` §4. +- One subject per picture. Never crop a petal, leaf or stem. +- Keep the same outline weight and paper texture in every picture. + +--- + +## 6. How a prompt is built + +The art board writes every prompt. Nobody types them by hand. Each prompt is §1, then: + +``` +Asset: +Purpose: +Subject: +Setting / Canvas / Layout: +Size: +Must include: <…> +Must avoid: +``` + +`tools/art-prep` builds the prompts from `art/manifest.json` (`pnpm art:board`), and a test +checks that each one starts with §1 word for word. + +--- + +## 7. Review points + +The board shows these under each card, and Claude's review checks them. Mark doesn't have to +tick them: *Accept* is one tap. + +0. It reads as one living garden rose with a soft face in her bloom: small eyes, a tiny mouth. +1. She matches `rose-sheet`: the same bloom, petal colours, three leaves and rounded thorns. +2. The colours stay within §2, with soft plum-brown outlines, in matte gouache, not wet watercolour. +3. Nothing from the book: no glass dome, screen, tiny planet, desert, child or scarf, and no + look of its drawings. +4. No text, numbers, logos, people or stray symbols. +5. The size and background are right for its kind in §5. +6. It reads clearly at the smallest size it is shown. +7. It is gentle: nothing blames, frightens or looks hurt, and drift looks like waiting. + +--- + +## 8. What Claude checks before Mark sees a picture + +- **Likeness:** the picture is compared with §4's *never* list. A rose under glass, a screen, + a planet the size of a house, or a pen-and-wash look means another try, however pretty it is. +- **Soul:** CLAUDE.md §8, *drift that reads as blame*. A rose who looks hurt or sad because of + the player is refused. +- **Words:** a picture with painted letters is refused, because words come from the copy library. + +--- + +## 9. Sprite sheets + +A sprite sheet is one prompt that makes several pictures at once on a grid. The board shows the +cut lines over the upload. `pnpm art:accept` cuts the sheet apart, and each cell becomes its own +picture in `art/final/`. + +- The cells are equal and invisible. They are read like a book: left to right, top row first. +- Each drawing stays inside its cell's safe box, which keeps 12 % of the cell's shorter side + clear on every side. Nothing crosses a cut line. +- The whole sheet uses one scale. The largest drawing fills its safe box, and every other + drawing is drawn at that same scale. +- When a sheet won't keep to its grid, each cell can be made on its own with its own prompt + (*One at a time* on the board). Each one is then accepted separately. diff --git a/art/manifest.json b/art/manifest.json new file mode 100644 index 0000000..1355493 --- /dev/null +++ b/art/manifest.json @@ -0,0 +1,235 @@ +{ + "//": "Every picture Rosea Domi needs, Phase 1 first. tools/art-prep builds the art board's prompts and stand-ins from this file (docs/ART.md). Status lives on the board, not here: this file says what is wanted, never whether it is done.", + "characters": { + "rose": { + "sheet": "rose-sheet", + "description": "The rose: one garden rose on a single slender stem, about three blooms tall from the bloom down to where the stem would meet the soil, with three leaves (two low, one high) and a few small thorns with rounded tips that never look threatening. Her bloom is her head: soft layered petals in rose (#C85A6E) turning pale petal (#F2B5BE) at the edges, and in the middle of the bloom a soft face with two small dark eyes, often half-closed, and a tiny mouth; a faint blush (#E8899B) on the petals by her cheeks when she is tended. A little vain: head held high, petals neat. Her leaves move like small arms." + } + }, + "avoid": [ + "text, letters, numbers or labels", + "humans, human hands or faces, children", + "logos", + "pure black outlines or a thin scratchy pen line", + "a glass dome or bell jar", + "a folding screen", + "a tiny round planet", + "a desert", + "a scarf", + "the look of any existing book's drawings" + ], + "assets": [ + { + "id": "rose-sheet", + "type": "sheet", + "width": 1536, + "height": 1024, + "background": "full", + "shipped": false, + "smallest": null, + "character": "rose", + "usedBy": ["The reference for every rose picture. Make this first: every rose prompt asks for it as the reference picture."], + "purpose": "Reference sheet that fixes the rose's look; every later rose prompt points to it. Never shown in the app.", + "subject": "The rose at full bloom, as described below. Four full figures: front view, three-quarter view facing left, side view facing left, back view; then three close-ups of the bloom only: content (eyes half-closed, a small smile), sleepy (eyes closed, petals a little folded), blushing (eyes closed happily, blush on the cheek petals).", + "setting": "Isolated on plain warm off-white paper (#FBF6F1), no scenery, no soil, no pot.", + "composition": "Seven figures on one sheet with even spacing: the four full figures in a row across the top two thirds, the three close-ups in a row below, all full figures at the same scale, nothing overlapping.", + "include": ["identical proportions, leaf count and thorns in every view", "the face in the middle of the bloom in every view that shows it"], + "avoid": ["a pot, vase or soil", "wilted, drooping or fallen petals", "sharp, menacing thorns"], + "checks": [0, 2, 3, 4, 5, 7] + }, + { + "id": "rose-stages-sheet", + "type": "spritesheet", + "width": 1536, + "height": 1024, + "background": "transparent", + "shipped": true, + "smallest": 160, + "character": "rose", + "usedBy": ["The rose in the garden as she grows: from total days of care, never from a streak (GAMEPLAY.md §1).", "Not in the app yet: Phase 1 builds her screen"], + "purpose": "The rose's four stages of growth, from a tight bud to full bloom, for the garden screen.", + "angle": "Every stage seen from the front, standing upright, the whole plant visible, at the same scale: the stem the same length and the face the same size in every cell; only the bloom changes.", + "grid": { "cols": 4, "rows": 1 }, + "cells": [ + { "id": "rose-bud", "does": "a tight bud: the bloom closed into a small pointed bud with green sepals around it, the face just visible on its front, eyes closed, calm." }, + { "id": "rose-opening", "does": "an opening bud: the outer petals just loosening, the face peeking out, eyes half open, curious." }, + { "id": "rose-half-bloom", "does": "a half bloom: petals open halfway in a soft cup, the face clear, a small proud smile." }, + { "id": "rose-full-bloom", "does": "a full bloom: petals wide open and layered, head held high, eyes half-closed, content and a little vain." } + ], + "include": ["the same stem, leaves and thorns in all four cells", "the face in every cell"], + "avoid": ["soil, a pot or ground", "fallen or drooping petals"], + "checks": [0, 1, 2, 3, 4, 5, 6, 7] + }, + { + "id": "rose-care-sheet", + "type": "spritesheet", + "width": 1536, + "height": 1024, + "background": "transparent", + "shipped": true, + "smallest": 160, + "character": "rose", + "usedBy": ["How the rose shows what she needs, and how she answers care (GAMEPLAY.md §1–2: her face and posture are the surface)."], + "purpose": "The rose at full bloom in four moods that care answers: thirsty, too much water, windblown, and blushing after being tended.", + "angle": "Every mood at full bloom, seen from the front, the whole plant visible, at the same scale as the stages sheet; only the face, leaves and posture change.", + "grid": { "cols": 4, "rows": 1 }, + "cells": [ + { "id": "rose-thirsty", "does": "thirsty: both leaves lowered, the bloom tipped slightly forward, petals a touch dull at the edges, eyes heavy and half-closed, mouth small. Tired, not hurt." }, + { "id": "rose-overwatered", "does": "too much water: leaves heavy and drooping outwards, a few water drops on the petals, cheeks a little puffed, eyes squeezed shut as if she had a big gulp. Gently comic, never ill." }, + { "id": "rose-windblown", "does": "windblown: the stem bending to the right in a breeze, petals fluttering, eyes squeezed shut, both leaves held up as if holding on. Startled, not frightened." }, + { "id": "rose-blushing", "does": "blushing after being tended: head high, eyes closed happily, a clear blush on the cheek petals, one leaf raised to her cheek." } + ], + "include": ["the same plant as rose-full-bloom in every cell"], + "avoid": ["soil, a pot or ground", "wilted, broken or crying", "tears"], + "checks": [0, 1, 2, 3, 4, 5, 6, 7] + }, + { + "id": "rose-moments-sheet", + "type": "spritesheet", + "width": 1536, + "height": 1024, + "background": "transparent", + "shipped": true, + "smallest": 160, + "character": "rose", + "usedBy": ["Night, teaching in speech bubbles (GAMEPLAY.md §4), drift as waiting (CLAUDE.md §8), and watching the sunset with the player."], + "purpose": "The rose at full bloom in four moments: asleep, speaking, waiting while the player is away, and watching the sunset.", + "angle": "Every moment at full bloom, the whole plant visible, at the same scale as the stages sheet. Front view unless the cell says otherwise.", + "grid": { "cols": 4, "rows": 1 }, + "cells": [ + { "id": "rose-sleepy", "does": "asleep at night: eyes closed, petals folded in a little, the bloom resting slightly forward, a peaceful small smile." }, + { "id": "rose-speaking", "does": "speaking: mouth open as if saying something kind, eyes open and bright, one leaf raised like a small hand explaining." }, + { "id": "rose-waiting", "does": "waiting while the player is away: the bloom turned a little to the side, petals closed a little, eyes looking down and half-closed. Quiet, waiting with patience, never sad, hurt or blaming." }, + { "id": "rose-watching-sunset", "does": "watching the sunset: seen from behind at a slight three-quarter angle, the bloom turned to the left towards a horizon outside the picture, warm light on her left side." } + ], + "include": ["the same plant as rose-full-bloom in every cell"], + "avoid": ["soil, a pot or ground", "wilted, crying or hurt", "a speech bubble or any words"], + "checks": [0, 1, 2, 3, 4, 5, 6, 7] + }, + { + "id": "care-props-sheet", + "type": "spritesheet", + "width": 1536, + "height": 1024, + "background": "transparent", + "shipped": true, + "smallest": 64, + "usedBy": ["The care things: water by feel, shade from the wind, pull weeds, gather fallen petals, and the folded petal that holds the day's sentence (GAMEPLAY.md §1)."], + "purpose": "Six small things the player uses to care for the rose, each one easy to recognise at 64 px.", + "angle": "Each thing in a gentle three-quarter view, the same light from the left, at the scale that makes it fill its safe box.", + "grid": { "cols": 3, "rows": 2 }, + "cells": [ + { "id": "watering-can", "does": "a small, round, old tin watering can in soft sage green, its spout pointing left, slightly dented, friendly." }, + { "id": "windbreak", "does": "a small curved windbreak of woven willow twigs on two short stakes, honey and brown, like a tiny garden hurdle. It must look nothing like a folding screen." }, + { "id": "weed-clump", "does": "a small clump of three weeds with soft jagged leaves and roots showing, as if just pulled, harmless and a little cheeky." }, + { "id": "fallen-petals", "does": "three fallen rose petals lying together, rose and pale pink, gently curled, lit softly. Fresh and pretty, not withered." }, + { "id": "petal-folded", "does": "one large rose petal folded over itself like a little letter, rose on the outside, pale pink on the inside edge, with a soft glow round it." }, + { "id": "petal-open", "does": "the same large rose petal opened flat and seen from above, pale pink, smooth and empty in the middle where words are added in code." } + ], + "include": ["each thing whole and clear at 64 px"], + "avoid": ["any writing on the petal", "a folding screen", "sharp tools, scissors or knives"], + "checks": [2, 3, 4, 5, 6, 7] + }, + { + "id": "garden-chair", + "type": "sprite", + "width": 1024, + "height": 1024, + "background": "transparent", + "shipped": true, + "smallest": 96, + "usedBy": ["The in-game sunset: the player moves the chair and watches the sunset again (CLAUDE.md §1, the sunset)."], + "purpose": "A small, weathered wooden garden chair that the player moves to watch the in-game sunset.", + "subject": "A small, weathered wooden garden chair in honey wood (#B98A5A), seen from behind at a three-quarter angle, facing left towards the sunset, with a soft cushion in pale petal pink. Empty and inviting.", + "include": ["the whole chair, legs included"], + "avoid": ["a person or animal on the chair", "a ground shadow"], + "checks": [2, 3, 4, 5, 6] + }, + { + "id": "garden-morning", + "type": "layer", + "width": 1024, + "height": 1536, + "background": "transparent", + "shipped": true, + "smallest": null, + "usedBy": ["The garden from sunrise until mid-morning. The real sunrise sets when it shows (Phase 1, the sun)."], + "purpose": "The rose's garden in soft morning light, with the sky left transparent for the sky drawn in code.", + "subject": "No characters. The empty garden bed where the rose grows, so the rose picture can stand in it.", + "setting": "A small round garden bed of warm umber soil in the lower middle, a low dry-stone wall curving behind it, wild grasses and a few small meadow flowers, the hillside meadow falling away to a wide low horizon. Cool, fresh morning light from the right (east), dew on the grass.", + "composition": "Portrait. The horizon line runs straight across at 40 % from the top; above it everything is fully transparent. The garden bed sits in the lower middle with its centre about 72 % down, open and calm, for the rose and the controls.", + "include": ["a fully transparent sky above the horizon", "an empty garden bed with nothing growing in it"], + "avoid": ["a painted sky, sun, moon, clouds or stars", "buildings, fences with gates, paths with signs", "a rose or any large flower in the bed"], + "checks": [2, 3, 4, 5, 7] + }, + { + "id": "garden-day", + "type": "layer", + "width": 1024, + "height": 1536, + "background": "transparent", + "shipped": true, + "smallest": null, + "usedBy": ["The garden through the day."], + "purpose": "The same garden in bright, soft daylight, with the sky left transparent.", + "subject": "No characters. The same empty garden bed as garden-morning.", + "setting": "The same garden as garden-morning, in soft bright daylight from high on the left, warm and green.", + "composition": "Portrait. Exactly the same layout as garden-morning: horizon straight across at 40 % from the top, transparent above, the garden bed in the lower middle about 72 % down.", + "include": ["a fully transparent sky above the horizon", "the same wall, bed and grasses as garden-morning"], + "avoid": ["a painted sky, sun, moon, clouds or stars", "a rose or any large flower in the bed"], + "checks": [2, 3, 4, 5, 7] + }, + { + "id": "garden-sunset", + "type": "layer", + "width": 1024, + "height": 1536, + "background": "transparent", + "shipped": true, + "smallest": null, + "usedBy": ["The garden at the player's real local sunset, and the in-game sunset with the chair."], + "purpose": "The same garden at sunset: low amber and coral light from the left, long soft shadows, the sky left transparent.", + "subject": "No characters. The same empty garden bed as garden-morning, with room on the left of the bed for the chair.", + "setting": "The same garden as garden-morning in low sunset light from the left (west): amber gold (#F2B860) and coral (#E9846A) on the wall and grasses, long soft shadows to the right.", + "composition": "Portrait. Exactly the same layout as garden-morning: horizon straight across at 40 % from the top, transparent above, the garden bed in the lower middle about 72 % down.", + "include": ["a fully transparent sky above the horizon", "the warmest light of the four garden layers"], + "avoid": ["a painted sky, sun, moon, clouds or stars", "a chair (it is its own picture)", "a rose or any large flower in the bed"], + "checks": [2, 3, 4, 5, 7] + }, + { + "id": "garden-night", + "type": "layer", + "width": 1024, + "height": 1536, + "background": "transparent", + "shipped": true, + "smallest": null, + "usedBy": ["The garden at night, under the real stars drawn in code."], + "purpose": "The same garden at night in soft blue moonlight, calm and safe, with the sky left transparent for the real constellations.", + "subject": "No characters. The same empty garden bed as garden-morning.", + "setting": "The same garden as garden-morning at night: dusk indigo (#2E3561) shadows, soft silver-blue light from above, one or two tiny lamp-gold glow-worms in the grass. Calm and safe, never dark or scary.", + "composition": "Portrait. Exactly the same layout as garden-morning: horizon straight across at 40 % from the top, transparent above, the garden bed in the lower middle about 72 % down.", + "include": ["a fully transparent sky above the horizon", "enough light that the bed and wall still read clearly"], + "avoid": ["a painted sky, moon or stars", "deep black shadows", "a rose or any large flower in the bed"], + "checks": [2, 3, 4, 5, 7] + }, + { + "id": "app-icon", + "type": "icon", + "width": 1024, + "height": 1024, + "background": "full", + "shipped": true, + "smallest": 48, + "character": "rose", + "usedBy": ["The home-screen icon of the installed app (replaces apps/rosea/public/icon.svg)."], + "purpose": "The app icon: the rose's bloom with her face, readable at 48 px on a phone's home screen.", + "subject": "Only the rose's bloom and the top of her stem with one leaf, filling the middle of the icon: the face clear, eyes half-closed, a small content smile, a faint blush.", + "setting": "A soft dusk background, coral (#E9846A) at the bottom warming into amber (#F2B860), painted with the same gouache texture, no horizon detail.", + "composition": "Square, full background. The bloom centred and inside the middle 70 %; nothing important near the corners, which phones cut.", + "include": ["a bold, simple silhouette that reads at 48 px"], + "avoid": ["fine detail that vanishes when small", "a border or rounded-corner frame"], + "checks": [0, 1, 2, 3, 4, 5, 6] + } + ] +} diff --git a/art/placeholders/app-icon.svg b/art/placeholders/app-icon.svg new file mode 100644 index 0000000..6ef1ee9 --- /dev/null +++ b/art/placeholders/app-icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/care-props-sheet.svg b/art/placeholders/care-props-sheet.svg new file mode 100644 index 0000000..103c40b --- /dev/null +++ b/art/placeholders/care-props-sheet.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/fallen-petals.svg b/art/placeholders/fallen-petals.svg new file mode 100644 index 0000000..5c0f439 --- /dev/null +++ b/art/placeholders/fallen-petals.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/garden-chair.svg b/art/placeholders/garden-chair.svg new file mode 100644 index 0000000..6b716da --- /dev/null +++ b/art/placeholders/garden-chair.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/garden-day.svg b/art/placeholders/garden-day.svg new file mode 100644 index 0000000..1342d57 --- /dev/null +++ b/art/placeholders/garden-day.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/garden-morning.svg b/art/placeholders/garden-morning.svg new file mode 100644 index 0000000..2ceacd5 --- /dev/null +++ b/art/placeholders/garden-morning.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/garden-night.svg b/art/placeholders/garden-night.svg new file mode 100644 index 0000000..822522d --- /dev/null +++ b/art/placeholders/garden-night.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/garden-sunset.svg b/art/placeholders/garden-sunset.svg new file mode 100644 index 0000000..1b5766f --- /dev/null +++ b/art/placeholders/garden-sunset.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/petal-folded.svg b/art/placeholders/petal-folded.svg new file mode 100644 index 0000000..f0c4fb8 --- /dev/null +++ b/art/placeholders/petal-folded.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/petal-open.svg b/art/placeholders/petal-open.svg new file mode 100644 index 0000000..c2e267a --- /dev/null +++ b/art/placeholders/petal-open.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-blushing.svg b/art/placeholders/rose-blushing.svg new file mode 100644 index 0000000..e8d3bca --- /dev/null +++ b/art/placeholders/rose-blushing.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-bud.svg b/art/placeholders/rose-bud.svg new file mode 100644 index 0000000..ae5540a --- /dev/null +++ b/art/placeholders/rose-bud.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-care-sheet.svg b/art/placeholders/rose-care-sheet.svg new file mode 100644 index 0000000..0ab727b --- /dev/null +++ b/art/placeholders/rose-care-sheet.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-full-bloom.svg b/art/placeholders/rose-full-bloom.svg new file mode 100644 index 0000000..febb1c5 --- /dev/null +++ b/art/placeholders/rose-full-bloom.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-half-bloom.svg b/art/placeholders/rose-half-bloom.svg new file mode 100644 index 0000000..3a80f64 --- /dev/null +++ b/art/placeholders/rose-half-bloom.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-moments-sheet.svg b/art/placeholders/rose-moments-sheet.svg new file mode 100644 index 0000000..f8769cc --- /dev/null +++ b/art/placeholders/rose-moments-sheet.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-opening.svg b/art/placeholders/rose-opening.svg new file mode 100644 index 0000000..06df36e --- /dev/null +++ b/art/placeholders/rose-opening.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-overwatered.svg b/art/placeholders/rose-overwatered.svg new file mode 100644 index 0000000..4228b3a --- /dev/null +++ b/art/placeholders/rose-overwatered.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-sheet.svg b/art/placeholders/rose-sheet.svg new file mode 100644 index 0000000..7817472 --- /dev/null +++ b/art/placeholders/rose-sheet.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-sleepy.svg b/art/placeholders/rose-sleepy.svg new file mode 100644 index 0000000..ec782de --- /dev/null +++ b/art/placeholders/rose-sleepy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-speaking.svg b/art/placeholders/rose-speaking.svg new file mode 100644 index 0000000..757aa38 --- /dev/null +++ b/art/placeholders/rose-speaking.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-stages-sheet.svg b/art/placeholders/rose-stages-sheet.svg new file mode 100644 index 0000000..81bf07c --- /dev/null +++ b/art/placeholders/rose-stages-sheet.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-thirsty.svg b/art/placeholders/rose-thirsty.svg new file mode 100644 index 0000000..809cf8d --- /dev/null +++ b/art/placeholders/rose-thirsty.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-waiting.svg b/art/placeholders/rose-waiting.svg new file mode 100644 index 0000000..3d145a4 --- /dev/null +++ b/art/placeholders/rose-waiting.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-watching-sunset.svg b/art/placeholders/rose-watching-sunset.svg new file mode 100644 index 0000000..8acc7e7 --- /dev/null +++ b/art/placeholders/rose-watching-sunset.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/rose-windblown.svg b/art/placeholders/rose-windblown.svg new file mode 100644 index 0000000..9924cfb --- /dev/null +++ b/art/placeholders/rose-windblown.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/watering-can.svg b/art/placeholders/watering-can.svg new file mode 100644 index 0000000..da4877e --- /dev/null +++ b/art/placeholders/watering-can.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/weed-clump.svg b/art/placeholders/weed-clump.svg new file mode 100644 index 0000000..e538dd4 --- /dev/null +++ b/art/placeholders/weed-clump.svg @@ -0,0 +1,4 @@ + + + + diff --git a/art/placeholders/windbreak.svg b/art/placeholders/windbreak.svg new file mode 100644 index 0000000..829dc22 --- /dev/null +++ b/art/placeholders/windbreak.svg @@ -0,0 +1,4 @@ + + + + diff --git a/package.json b/package.json index e630bc9..8b86603 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,9 @@ "test:e2e": "turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.config.ts", "test:offline": "turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.offline.config.ts", "validate:library": "tsx scripts/validate-library.ts", - "lint:copy": "tsx scripts/lint-copy.ts" + "lint:copy": "tsx scripts/lint-copy.ts", + "art:board": "tsx tools/art-prep/src/cli-board.ts", + "art:accept": "tsx tools/art-prep/src/cli-accept.ts" }, "devDependencies": { "@axe-core/playwright": "4.13.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 810bf54..cabb8c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -167,6 +167,28 @@ importers: specifier: 3.2.7 version: 3.2.7(@types/node@22.20.1)(jsdom@25.0.1)(terser@5.51.2)(tsx@4.23.12) + tools/art-prep: + dependencies: + '@rosea/content': + specifier: workspace:* + version: link:../../packages/content + '@rosea/schema': + specifier: workspace:* + version: link:../../packages/schema + sharp: + specifier: 0.34.4 + version: 0.34.4 + devDependencies: + '@types/node': + specifier: 22.20.1 + version: 22.20.1 + typescript: + specifier: 5.9.3 + version: 5.9.3 + vitest: + specifier: 3.2.7 + version: 3.2.7(@types/node@22.20.1)(jsdom@25.0.1)(terser@5.51.2)(tsx@4.23.12) + packages: '@apideck/better-ajv-errors@0.3.7': @@ -716,6 +738,9 @@ packages: resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==} engines: {node: '>=18'} + '@emnapi/runtime@1.11.3': + resolution: {integrity: sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==} + '@esbuild/aix-ppc64@0.25.12': resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} engines: {node: '>=18'} @@ -1086,6 +1111,132 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} + '@img/colour@1.1.0': + resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} + engines: {node: '>=18'} + + '@img/sharp-darwin-arm64@0.34.4': + resolution: {integrity: sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [darwin] + + '@img/sharp-darwin-x64@0.34.4': + resolution: {integrity: sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [darwin] + + '@img/sharp-libvips-darwin-arm64@1.2.3': + resolution: {integrity: sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw==} + cpu: [arm64] + os: [darwin] + + '@img/sharp-libvips-darwin-x64@1.2.3': + resolution: {integrity: sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA==} + cpu: [x64] + os: [darwin] + + '@img/sharp-libvips-linux-arm64@1.2.3': + resolution: {integrity: sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==} + cpu: [arm64] + os: [linux] + + '@img/sharp-libvips-linux-arm@1.2.3': + resolution: {integrity: sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==} + cpu: [arm] + os: [linux] + + '@img/sharp-libvips-linux-ppc64@1.2.3': + resolution: {integrity: sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==} + cpu: [ppc64] + os: [linux] + + '@img/sharp-libvips-linux-s390x@1.2.3': + resolution: {integrity: sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==} + cpu: [s390x] + os: [linux] + + '@img/sharp-libvips-linux-x64@1.2.3': + resolution: {integrity: sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==} + cpu: [x64] + os: [linux] + + '@img/sharp-libvips-linuxmusl-arm64@1.2.3': + resolution: {integrity: sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==} + cpu: [arm64] + os: [linux] + + '@img/sharp-libvips-linuxmusl-x64@1.2.3': + resolution: {integrity: sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==} + cpu: [x64] + os: [linux] + + '@img/sharp-linux-arm64@0.34.4': + resolution: {integrity: sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + + '@img/sharp-linux-arm@0.34.4': + resolution: {integrity: sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm] + os: [linux] + + '@img/sharp-linux-ppc64@0.34.4': + resolution: {integrity: sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [ppc64] + os: [linux] + + '@img/sharp-linux-s390x@0.34.4': + resolution: {integrity: sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [s390x] + os: [linux] + + '@img/sharp-linux-x64@0.34.4': + resolution: {integrity: sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + + '@img/sharp-linuxmusl-arm64@0.34.4': + resolution: {integrity: sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + + '@img/sharp-linuxmusl-x64@0.34.4': + resolution: {integrity: sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + + '@img/sharp-wasm32@0.34.4': + resolution: {integrity: sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [wasm32] + + '@img/sharp-win32-arm64@0.34.4': + resolution: {integrity: sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [win32] + + '@img/sharp-win32-ia32@0.34.4': + resolution: {integrity: sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [ia32] + os: [win32] + + '@img/sharp-win32-x64@0.34.4': + resolution: {integrity: sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [win32] + '@isaacs/cliui@9.0.0': resolution: {integrity: sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==} engines: {node: '>=18'} @@ -1766,6 +1917,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + devalue@5.9.4: resolution: {integrity: sha512-sPAT4pztbu6586/hrhOnMKS17IJrvg12mXiSPSS3W5qDeN2RGgvZ0diZCm31dBbnevfVmujNO3IM2wrS4Y2Rhg==} @@ -2661,6 +2816,10 @@ packages: resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} engines: {node: '>= 0.4'} + sharp@0.34.4: + resolution: {integrity: sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -2840,6 +2999,9 @@ packages: peerDependencies: typescript: '>=4.8.4' + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + tsx@4.23.12: resolution: {integrity: sha512-FDf4L4sYzKtzWYhU/Xm0AQFdTjdIxNo9ElTf2mxXM6k8YMHXzYUe4yODVaXP4V9uMFbVg8c0qyBccK2OOxb45Q==} engines: {node: '>=18.0.0'} @@ -3868,6 +4030,11 @@ snapshots: '@csstools/css-tokenizer@3.0.4': {} + '@emnapi/runtime@1.11.3': + dependencies: + tslib: 2.9.1 + optional: true + '@esbuild/aix-ppc64@0.25.12': optional: true @@ -4086,6 +4253,94 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} + '@img/colour@1.1.0': {} + + '@img/sharp-darwin-arm64@0.34.4': + optionalDependencies: + '@img/sharp-libvips-darwin-arm64': 1.2.3 + optional: true + + '@img/sharp-darwin-x64@0.34.4': + optionalDependencies: + '@img/sharp-libvips-darwin-x64': 1.2.3 + optional: true + + '@img/sharp-libvips-darwin-arm64@1.2.3': + optional: true + + '@img/sharp-libvips-darwin-x64@1.2.3': + optional: true + + '@img/sharp-libvips-linux-arm64@1.2.3': + optional: true + + '@img/sharp-libvips-linux-arm@1.2.3': + optional: true + + '@img/sharp-libvips-linux-ppc64@1.2.3': + optional: true + + '@img/sharp-libvips-linux-s390x@1.2.3': + optional: true + + '@img/sharp-libvips-linux-x64@1.2.3': + optional: true + + '@img/sharp-libvips-linuxmusl-arm64@1.2.3': + optional: true + + '@img/sharp-libvips-linuxmusl-x64@1.2.3': + optional: true + + '@img/sharp-linux-arm64@0.34.4': + optionalDependencies: + '@img/sharp-libvips-linux-arm64': 1.2.3 + optional: true + + '@img/sharp-linux-arm@0.34.4': + optionalDependencies: + '@img/sharp-libvips-linux-arm': 1.2.3 + optional: true + + '@img/sharp-linux-ppc64@0.34.4': + optionalDependencies: + '@img/sharp-libvips-linux-ppc64': 1.2.3 + optional: true + + '@img/sharp-linux-s390x@0.34.4': + optionalDependencies: + '@img/sharp-libvips-linux-s390x': 1.2.3 + optional: true + + '@img/sharp-linux-x64@0.34.4': + optionalDependencies: + '@img/sharp-libvips-linux-x64': 1.2.3 + optional: true + + '@img/sharp-linuxmusl-arm64@0.34.4': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-arm64': 1.2.3 + optional: true + + '@img/sharp-linuxmusl-x64@0.34.4': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-x64': 1.2.3 + optional: true + + '@img/sharp-wasm32@0.34.4': + dependencies: + '@emnapi/runtime': 1.11.3 + optional: true + + '@img/sharp-win32-arm64@0.34.4': + optional: true + + '@img/sharp-win32-ia32@0.34.4': + optional: true + + '@img/sharp-win32-x64@0.34.4': + optional: true + '@isaacs/cliui@9.0.0': {} '@jridgewell/gen-mapping@0.3.13': @@ -4731,6 +4986,8 @@ snapshots: dequal@2.0.3: {} + detect-libc@2.1.2: {} + devalue@5.9.4: {} dom-accessibility-api@0.5.16: {} @@ -5763,6 +6020,35 @@ snapshots: es-errors: 1.3.0 es-object-atoms: 1.1.2 + sharp@0.34.4: + dependencies: + '@img/colour': 1.1.0 + detect-libc: 2.1.2 + semver: 7.8.5 + optionalDependencies: + '@img/sharp-darwin-arm64': 0.34.4 + '@img/sharp-darwin-x64': 0.34.4 + '@img/sharp-libvips-darwin-arm64': 1.2.3 + '@img/sharp-libvips-darwin-x64': 1.2.3 + '@img/sharp-libvips-linux-arm': 1.2.3 + '@img/sharp-libvips-linux-arm64': 1.2.3 + '@img/sharp-libvips-linux-ppc64': 1.2.3 + '@img/sharp-libvips-linux-s390x': 1.2.3 + '@img/sharp-libvips-linux-x64': 1.2.3 + '@img/sharp-libvips-linuxmusl-arm64': 1.2.3 + '@img/sharp-libvips-linuxmusl-x64': 1.2.3 + '@img/sharp-linux-arm': 0.34.4 + '@img/sharp-linux-arm64': 0.34.4 + '@img/sharp-linux-ppc64': 0.34.4 + '@img/sharp-linux-s390x': 0.34.4 + '@img/sharp-linux-x64': 0.34.4 + '@img/sharp-linuxmusl-arm64': 0.34.4 + '@img/sharp-linuxmusl-x64': 0.34.4 + '@img/sharp-wasm32': 0.34.4 + '@img/sharp-win32-arm64': 0.34.4 + '@img/sharp-win32-ia32': 0.34.4 + '@img/sharp-win32-x64': 0.34.4 + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -5980,6 +6266,9 @@ snapshots: dependencies: typescript: 5.9.3 + tslib@2.9.1: + optional: true + tsx@4.23.12: dependencies: esbuild: 0.28.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4e708bd..28fa9af 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - 'packages/*' - 'apps/*' + - 'tools/*' diff --git a/tools/art-prep/board/index.html b/tools/art-prep/board/index.html new file mode 100644 index 0000000..9fcddbe --- /dev/null +++ b/tools/art-prep/board/index.html @@ -0,0 +1,1108 @@ +%PRODUCT_NAME% Art Board + + + + + + +
+
+

Art board

+

Every picture %PRODUCT_NAME% needs, with the prompt that makes it. The app shows a simple stand-in for each until a picture here is accepted.

+
    +
  1. Copy a prompt into your image generator. Start with the rose's character sheet: every later rose prompt asks for it as the reference picture. A sprite sheet is one prompt that draws several pictures at once on a grid whose every cell is given in pixels; upload it whole and Claude cuts it apart. If a sheet will not keep to its grid, open One at a time on its card and make each picture with its own prompt.
  2. +
  3. Upload or paste what it made: Paste picture on its card, or point at the card and press Ctrl+V (⌘V on a Mac). Compare it with the stand-in. The review points from art/STYLE.md are under each card if you want them; you don't have to tick them.
  4. +
  5. Accept it right away, or ask for another try with a note. Claude moves accepted pictures into the app.
  6. +
+
+ +

Loading the board…

+
+ +
+
+
+

All at once

+

Every picture still to make, written as one prompt: the style once, then each picture by name, size and background, in the order to make them. Paste it into your image generator and let it make them one after another, attaching the accepted character sheets it names. A long list is split into a few prompts, because generators cut off very long ones.

+
+ + +
+

+
    +

    Upload them all together

    +

    Drop every picture it made here at once. Each file finds its picture by its name (for example rose-sheet.png); files named otherwise are matched in the order of the prompt you choose below. Check the matches, then upload.

    +
    +
    Drop all the pictures here, or choose them
    +
      + +
      +
      +
      + + + + diff --git a/tools/art-prep/package.json b/tools/art-prep/package.json new file mode 100644 index 0000000..b622fdd --- /dev/null +++ b/tools/art-prep/package.json @@ -0,0 +1,21 @@ +{ + "name": "@rosea/art-prep", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "The art pipeline's tools (docs/ART.md): prompts and stand-ins from art/manifest.json, the art board's files, and the step that moves an accepted picture into art/final/. Never imported by the app.", + "scripts": { + "typecheck": "tsc -p tsconfig.json", + "test": "vitest run --reporter=verbose" + }, + "dependencies": { + "@rosea/content": "workspace:*", + "@rosea/schema": "workspace:*", + "sharp": "0.34.4" + }, + "devDependencies": { + "@types/node": "22.20.1", + "typescript": "5.9.3", + "vitest": "3.2.7" + } +} diff --git a/tools/art-prep/src/accept.ts b/tools/art-prep/src/accept.ts new file mode 100644 index 0000000..9400ecd --- /dev/null +++ b/tools/art-prep/src/accept.ts @@ -0,0 +1,166 @@ +/** + * The last step of the pipeline (docs/ART.md §3, step 6): a picture Mark accepted on the + * board becomes optimised WebP in art/final/. A sprite sheet is cut along its grid here. + * It refuses rather than guesses: a sheet with an empty cell or a painted background is + * refused whole, because a cut that "mostly worked" ships a broken picture. + */ +import sharp from 'sharp'; +import type { Asset, Manifest } from './manifest.js'; +import { cellSize, cutLines } from './prompt.js'; + +/** Bytes per final file (docs/ART.md §4). The app precaches every one. */ +export const BUDGET: Record = { + sheet: 400_000, + spritesheet: 0, // never written whole: its cells are + layer: 350_000, + icon: 120_000, + sprite: 120_000, + cell: 120_000 +}; + +const QUALITIES = [82, 72, 62]; +const ALPHA = 16; + +export interface FinalFile { + readonly id: string; + readonly data: Buffer; + readonly width: number; + readonly height: number; +} + +export interface Accepted { + readonly files: readonly FinalFile[]; + /** Things Mark or Claude should know, none of them a reason to refuse. */ + readonly notes: readonly string[]; +} + +export class Refused extends Error { + override readonly name = 'Refused'; +} + +interface Target { + readonly asset: Asset; + /** Set when `id` names one cell of a sprite sheet, made on its own. */ + readonly cell?: string; +} + +export function findTarget(m: Manifest, id: string): Target { + for (const asset of m.assets) { + if (asset.id === id) return { asset }; + if (asset.cells?.some((c) => c.id === id)) return { asset, cell: id }; + } + throw new Refused(`"${id}" is not a picture in art/manifest.json`); +} + +async function encode(img: sharp.Sharp, budget: number, id: string): Promise<{ data: Buffer; width: number; height: number }> { + for (const quality of QUALITIES) { + const { data, info } = await img.clone().webp({ quality, alphaQuality: 90, effort: 5 }).toBuffer({ resolveWithObject: true }); + if (data.length <= budget) return { data, width: info.width, height: info.height }; + } + throw new Refused(`${id}: over its budget of ${Math.round(budget / 1000)} KB even at WebP quality ${QUALITIES.at(-1)}. Ask for a simpler picture, or raise the budget in docs/ART.md §4 with a reason.`); +} + +interface Coverage { + readonly drawn: number; + readonly seeThrough: number; + readonly touches: boolean; +} + +/** How much of a region is drawn, and whether the drawing reaches its edge (two pixels or more). */ +function coverage(px: Buffer, width: number, x0: number, y0: number, x1: number, y1: number): Coverage { + let drawn = 0, edge = 0; + for (let y = y0; y < y1; y++) { + for (let x = x0; x < x1; x++) { + if ((px[(y * width + x) * 4 + 3] ?? 0) >= ALPHA) { + drawn++; + if (x === x0 || x === x1 - 1 || y === y0 || y === y1 - 1) edge++; + } + } + } + const area = (x1 - x0) * (y1 - y0); + return { drawn: drawn / area, seeThrough: Math.round(100 * (1 - drawn / area)), touches: edge >= 2 }; +} + +/** The largest region of the given shape in the middle of a width × height picture. */ +function middle(width: number, height: number, shape: number): sharp.Region { + if (width / height > shape) { + const w = Math.round(height * shape); + return { left: Math.floor((width - w) / 2), top: 0, width: w, height }; + } + const h = Math.round(width / shape); + return { left: 0, top: Math.floor((height - h) / 2), width, height: h }; +} + +async function rgba(input: Buffer): Promise<{ px: Buffer; width: number; height: number }> { + const { data, info } = await sharp(input).ensureAlpha().raw().toBuffer({ resolveWithObject: true }); + return { px: data, width: info.width, height: info.height }; +} + +export async function acceptPicture(input: Buffer, id: string, m: Manifest): Promise { + const target = findTarget(m, id); + const a = target.asset; + const notes: string[] = []; + const { px, width, height } = await rgba(input).catch((e: unknown) => { + throw new Refused(`${id}: the file could not be read as a picture (${String(e)})`); + }); + + if (a.type === 'spritesheet') { + const { width: cw, height: ch } = cellSize(a); + const fitCell = (img: sharp.Sharp): sharp.Sharp => + img.resize(cw, ch, { fit: 'contain', background: { r: 0, g: 0, b: 0, alpha: 0 }, withoutEnlargement: true }); + + if (target.cell) { + const corners = [[0, 0], [width - 1, 0], [0, height - 1], [width - 1, height - 1]] as const; + if (corners.some(([x, y]) => (px[(y * width + x) * 4 + 3] ?? 0) >= ALPHA)) { + throw new Refused(`${id}: the background is not transparent. Ask for a transparent PNG.`); + } + if (coverage(px, width, 0, 0, width, height).touches) notes.push(`${id}: the drawing touches the edge; something may be cut off.`); + const out = await encode(fitCell(sharp(input)), BUDGET.cell, id); + return { files: [{ id, ...out }], notes }; + } + + const g = a.grid ?? { cols: 1, rows: 1 }; + if (Math.abs(width / height - a.width / a.height) > 0.02) { + notes.push(`${id}: made at ${width} × ${height}, not ${a.width} × ${a.height}; cut by its ${g.cols} × ${g.rows} grid anyway.`); + } + const xs = cutLines(width, g.cols), ys = cutLines(height, g.rows); + const cells = a.cells ?? []; + const empty: string[] = [], painted: string[] = []; + const regions = cells.map((c, i) => { + const col = i % g.cols, row = Math.floor(i / g.cols); + const x0 = xs[col] ?? 0, x1 = xs[col + 1] ?? width, y0 = ys[row] ?? 0, y1 = ys[row + 1] ?? height; + const cov = coverage(px, width, x0, y0, x1, y1); + if (cov.drawn < 0.005) empty.push(c.id); + else if (cov.seeThrough < 5) painted.push(c.id); + else if (cov.touches) notes.push(`${c.id}: the drawing touches its cell's edge; a neighbour may spill in.`); + return { id: c.id, left: x0, top: y0, width: x1 - x0, height: y1 - y0 }; + }); + if (empty.length) throw new Refused(`${id}: nothing drawn in ${empty.join(', ')}. The whole sheet is refused.`); + if (painted.length) throw new Refused(`${id}: painted on a background in ${painted.join(', ')}. The whole sheet is refused.`); + const files: FinalFile[] = []; + for (const r of regions) { + const out = await encode(fitCell(sharp(input).extract({ left: r.left, top: r.top, width: r.width, height: r.height })), BUDGET.cell, r.id); + files.push({ id: r.id, ...out }); + } + return { files, notes }; + } + + if (a.background === 'transparent') { + // A garden layer is opaque below its horizon: only the top edge must be clear. + const row = a.type === 'layer' ? coverage(px, width, 0, 0, width, 1).drawn : null; + const corners = [[0, 0], [width - 1, 0], [0, height - 1], [width - 1, height - 1]] as const; + const clear = row === null ? corners.every(([x, y]) => (px[(y * width + x) * 4 + 3] ?? 0) < ALPHA) : row < 0.02; + if (!clear) throw new Refused(`${id}: the ${a.type === 'layer' ? 'sky' : 'background'} is not transparent. Ask for a transparent PNG.`); + } + if (Math.abs(width / height - a.width / a.height) > 0.02) { + notes.push(`${id}: made at ${width} × ${height}, not ${a.width} × ${a.height}; ${a.background === 'full' ? 'cropped from the middle' : 'fitted inside with clear edges'}.`); + } + if (width < a.width) notes.push(`${id}: only ${width} px wide; kept at that size, never blown up.`); + // Never blown up, so the shape comes first: a full picture is cropped from the middle to the + // target shape, then only ever shrunk. Resizing with cover would skip the crop on a small one. + const img = a.background === 'full' + ? sharp(input).extract(middle(width, height, a.width / a.height)).resize(a.width, a.height, { fit: 'inside', withoutEnlargement: true }) + : sharp(input).resize(a.width, a.height, { fit: 'contain', background: { r: 0, g: 0, b: 0, alpha: 0 }, withoutEnlargement: true }); + const out = await encode(img, BUDGET[a.type], id); + return { files: [{ id, ...out }], notes }; +} diff --git a/tools/art-prep/src/board.ts b/tools/art-prep/src/board.ts new file mode 100644 index 0000000..ed8fbbf --- /dev/null +++ b/tools/art-prep/src/board.ts @@ -0,0 +1,65 @@ +/** + * The art board's data: every picture with its prompt, built from art/manifest.json and + * art/STYLE.md (docs/ART.md §3). `pnpm art:board` writes it next to the board page and + * refreshes art/placeholders/; Claude publishes the folder as the art board artifact. + */ +import { checkManifest, type Asset, type Background, type Manifest } from './manifest.js'; +import { attachments, cellPromptFor, cellSize, promptFor } from './prompt.js'; +import { reviewPoints, stylePrompt } from './style.js'; + +export interface BoardCell { + readonly id: string; + readonly type: 'pose'; + readonly width: number; + readonly height: number; + readonly background: Background; + readonly prompt: string; +} + +export interface BoardAsset { + readonly id: string; + readonly type: Asset['type']; + readonly width: number; + readonly height: number; + readonly background: Background; + readonly shipped: boolean; + readonly usedBy: readonly string[]; + readonly checks: readonly number[]; + readonly smallest: number | null; + readonly attach: readonly string[]; + readonly prompt: string; + readonly grid?: { readonly cols: number; readonly rows: number }; + readonly cells?: readonly BoardCell[]; +} + +export interface BoardData { + readonly generatedFrom: string; + readonly checklist: readonly string[]; + readonly assets: readonly BoardAsset[]; +} + +/** The board's data, or the manifest's problems. Nothing half-checked reaches the board. */ +export function boardData(m: Manifest, styleMarkdown: string): BoardData { + const style = stylePrompt(styleMarkdown); + const checklist = reviewPoints(styleMarkdown); + const problems = checkManifest(m, checklist.length); + if (problems.length > 0) throw new Error(`art/manifest.json:\n ${problems.join('\n ')}`); + + const assets = m.assets.map((a): BoardAsset => { + const base = { + id: a.id, type: a.type, width: a.width, height: a.height, background: a.background, + shipped: a.shipped, usedBy: a.usedBy, checks: a.checks, smallest: a.smallest, + attach: attachments(a, m), prompt: promptFor(a, m, style) + }; + if (a.type !== 'spritesheet' || !a.grid) return base; + const { width, height } = cellSize(a); + return { + ...base, + grid: a.grid, + cells: (a.cells ?? []).map((c) => ({ + id: c.id, type: 'pose', width, height, background: a.background, prompt: cellPromptFor(a, c, m, style) + })) + }; + }); + return { generatedFrom: 'art/manifest.json, art/STYLE.md §1 and §7', checklist, assets }; +} diff --git a/tools/art-prep/src/cli-accept.ts b/tools/art-prep/src/cli-accept.ts new file mode 100644 index 0000000..8f320f7 --- /dev/null +++ b/tools/art-prep/src/cli-accept.ts @@ -0,0 +1,36 @@ +/** + * `pnpm art:accept ` — moves a picture Mark accepted on the art board into + * art/final/ as WebP (docs/ART.md §3, step 6). For a sprite sheet, `` is the sheet + * and every cell is written; for one cell made on its own, `` is the cell. + */ +import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { join, relative } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { Refused, acceptPicture } from './accept.js'; +import type { Manifest } from './manifest.js'; + +const root = fileURLToPath(new URL('../../../', import.meta.url)); +const [id, file] = process.argv.slice(2); +if (!id || !file) { + console.error('Usage: pnpm art:accept (the id from art/manifest.json, the picture downloaded from the board)'); + process.exit(2); +} + +const manifest = JSON.parse(readFileSync(join(root, 'art/manifest.json'), 'utf8')) as Manifest; +try { + const { files, notes } = await acceptPicture(readFileSync(file), id, manifest); + const dir = join(root, 'art/final'); + mkdirSync(dir, { recursive: true }); + for (const f of files) { + const path = join(dir, `${f.id}.webp`); + writeFileSync(path, f.data); + console.log(`${relative(root, path).replace(/\\/g, '/')} ${f.width} × ${f.height} ${(f.data.length / 1000).toFixed(1)} KB`); + } + for (const n of notes) console.log(`note: ${n}`); +} catch (e) { + if (e instanceof Refused) { + console.error(`refused: ${e.message}`); + process.exit(1); + } + throw e; +} diff --git a/tools/art-prep/src/cli-board.ts b/tools/art-prep/src/cli-board.ts new file mode 100644 index 0000000..9079b00 --- /dev/null +++ b/tools/art-prep/src/cli-board.ts @@ -0,0 +1,35 @@ +/** + * `pnpm art:board` — writes the art board's files to tools/art-prep/dist/board/ and + * refreshes the stand-ins in art/placeholders/ (docs/ART.md §3). + */ +import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { PRODUCT_NAME } from '@rosea/schema'; +import { boardData } from './board.js'; +import type { Manifest } from './manifest.js'; +import { placeholders } from './placeholders.js'; + +const root = fileURLToPath(new URL('../../../', import.meta.url)); +const manifest = JSON.parse(readFileSync(join(root, 'art/manifest.json'), 'utf8')) as Manifest; +const style = readFileSync(join(root, 'art/STYLE.md'), 'utf8'); + +const data = boardData(manifest, style); +const stand = placeholders(manifest); + +// art/placeholders/ holds exactly the stand-ins the manifest asks for: a removed picture loses its stand-in too. +const placeDir = join(root, 'art/placeholders'); +mkdirSync(placeDir, { recursive: true }); +for (const f of readdirSync(placeDir)) if (f.endsWith('.svg') && !stand.has(f.slice(0, -4))) rmSync(join(placeDir, f)); +for (const [id, svg] of stand) writeFileSync(join(placeDir, `${id}.svg`), svg); + +const out = join(root, 'tools/art-prep/dist/board'); +rmSync(out, { recursive: true, force: true }); +mkdirSync(join(out, 'placeholders'), { recursive: true }); +for (const [id, svg] of stand) writeFileSync(join(out, 'placeholders', `${id}.svg`), svg); +writeFileSync(join(out, 'board-data.json'), JSON.stringify(data)); +const page = readFileSync(join(root, 'tools/art-prep/board/index.html'), 'utf8').replaceAll('%PRODUCT_NAME%', PRODUCT_NAME); +writeFileSync(join(out, 'index.html'), page); + +const pictures = data.assets.reduce((n, a) => n + (a.cells ? a.cells.length : 1), 0); +console.log(`art:board: ${data.assets.length} cards, ${pictures} pictures, ${stand.size} stand-ins -> tools/art-prep/dist/board/`); diff --git a/tools/art-prep/src/manifest.ts b/tools/art-prep/src/manifest.ts new file mode 100644 index 0000000..8e4b9db --- /dev/null +++ b/tools/art-prep/src/manifest.ts @@ -0,0 +1,138 @@ +/** + * art/manifest.json: every picture the game needs, and the checks that keep the + * list honest before a single prompt is written (docs/ART.md §2). + */ +import { findForbidden } from '@rosea/content'; + +export type Background = 'full' | 'transparent'; +export type AssetType = 'sheet' | 'spritesheet' | 'sprite' | 'layer' | 'icon'; + +export interface Cell { + readonly id: string; + /** What this one picture shows, finishing the sentence "Cell n: …". */ + readonly does: string; +} + +export interface Asset { + readonly id: string; + readonly type: AssetType; + readonly width: number; + readonly height: number; + readonly background: Background; + /** False for a reference that never appears in the app (a character sheet). */ + readonly shipped: boolean; + /** The smallest size, in px across, the app ever shows it; null when it is only shown large. */ + readonly smallest: number | null; + readonly character?: string; + readonly usedBy: readonly string[]; + readonly purpose: string; + readonly subject?: string; + readonly setting?: string; + readonly composition?: string; + readonly angle?: string; + readonly grid?: { readonly cols: number; readonly rows: number }; + readonly cells?: readonly Cell[]; + readonly include: readonly string[]; + readonly avoid: readonly string[]; + /** Indices into STYLE.md §7, the review points shown on its card. */ + readonly checks: readonly number[]; +} + +export interface Character { + readonly sheet: string; + readonly description: string; +} + +export interface Manifest { + readonly characters: Readonly>; + /** What no picture may show, appended to every prompt (STYLE.md §4). */ + readonly avoid: readonly string[]; + readonly assets: readonly Asset[]; +} + +/** The canvases image generators offer (STYLE.md §5). Anything else gets resized by the tool, unasked. */ +export const GENERATOR_SIZES: readonly (readonly [number, number])[] = [ + [1024, 1024], + [1536, 1024], + [1024, 1536] +]; + +const ID = /^[a-z0-9]+(?:-[a-z0-9]+)*$/; +const TYPES: readonly AssetType[] = ['sheet', 'spritesheet', 'sprite', 'layer', 'icon']; + +/** Every text a prompt is built from, so the forbidden-names check reads all of it. */ +function textsOf(a: Asset): string[] { + return [ + a.purpose, a.subject, a.setting, a.composition, a.angle, + ...a.usedBy, ...a.include, ...a.avoid, + ...(a.cells ?? []).flatMap((c) => [c.id, c.does]) + ].filter((t): t is string => typeof t === 'string'); +} + +/** + * Problems with the manifest, each naming the asset. An empty list is a pass. + * `checklistLength` is the number of review points in STYLE.md §7. + */ +export function checkManifest(m: Manifest, checklistLength: number): string[] { + const problems: string[] = []; + const seen = new Set(); + const claim = (id: string, where: string): void => { + if (!ID.test(id)) problems.push(`${where}: id "${id}" must be lower-case words joined by hyphens`); + if (seen.has(id)) problems.push(`${where}: id "${id}" is used twice; each picture needs its own`); + seen.add(id); + }; + + for (const [name, c] of Object.entries(m.characters)) { + const sheet = m.assets.find((a) => a.id === c.sheet); + if (!sheet) problems.push(`character ${name}: its sheet "${c.sheet}" is not in the manifest`); + else if (sheet.type !== 'sheet') problems.push(`character ${name}: "${c.sheet}" is a ${sheet.type}, not a character sheet`); + } + + for (const a of m.assets) { + claim(a.id, a.id); + if (!TYPES.includes(a.type)) problems.push(`${a.id}: unknown type "${a.type}"`); + if (!GENERATOR_SIZES.some(([w, h]) => w === a.width && h === a.height)) { + problems.push(`${a.id}: ${a.width} × ${a.height} is not a size image generators offer (${GENERATOR_SIZES.map(([w, h]) => `${w} × ${h}`).join(', ')})`); + } + if (a.purpose.trim() === '') problems.push(`${a.id}: no purpose`); + if (a.usedBy.length === 0) problems.push(`${a.id}: usedBy is empty; say where it appears`); + if (a.character !== undefined && !(a.character in m.characters)) problems.push(`${a.id}: unknown character "${a.character}"`); + if (a.type === 'sheet' && a.shipped) problems.push(`${a.id}: a character sheet is a reference and never shipped`); + if ((a.type === 'layer' || a.type === 'sprite' || a.type === 'spritesheet') && a.background !== 'transparent') { + problems.push(`${a.id}: a ${a.type} sits over other pictures, so its background must be transparent`); + } + if (a.type !== 'spritesheet' && (a.subject ?? '').trim() === '') problems.push(`${a.id}: no subject`); + for (const i of a.checks) { + if (!Number.isInteger(i) || i < 0 || i >= checklistLength) problems.push(`${a.id}: review point ${i} is not in STYLE.md §7`); + } + + if (a.type === 'spritesheet') { + const g = a.grid; + const cells = a.cells ?? []; + if (!g) problems.push(`${a.id}: a sprite sheet needs a grid`); + else { + if (cells.length !== g.cols * g.rows) problems.push(`${a.id}: ${cells.length} cells for a ${g.cols} × ${g.rows} grid`); + if (a.width % g.cols !== 0 || a.height % g.rows !== 0) problems.push(`${a.id}: ${a.width} × ${a.height} does not divide into ${g.cols} × ${g.rows} whole-pixel cells`); + } + if ((a.angle ?? '').trim() === '') problems.push(`${a.id}: a sprite sheet needs an angle, so every cell is drawn alike`); + for (const c of cells) { + claim(c.id, `${a.id} cell`); + if (c.does.trim() === '') problems.push(`${a.id}: cell ${c.id} does not say what it shows`); + } + } else if (a.grid || a.cells) { + problems.push(`${a.id}: only a sprite sheet has a grid and cells`); + } + + for (const text of textsOf(a)) { + for (const hit of findForbidden(text)) problems.push(`${a.id}: "${hit.term}" (${hit.category}) may not appear in a prompt`); + } + } + + for (const [name, c] of Object.entries(m.characters)) { + for (const hit of findForbidden(c.description)) problems.push(`character ${name}: "${hit.term}" (${hit.category}) may not appear in a prompt`); + } + for (const text of m.avoid) { + for (const hit of findForbidden(text)) problems.push(`avoid list: "${hit.term}" (${hit.category}) may not appear in a prompt`); + } + return problems; +} diff --git a/tools/art-prep/src/placeholders.ts b/tools/art-prep/src/placeholders.ts new file mode 100644 index 0000000..f68f743 --- /dev/null +++ b/tools/art-prep/src/placeholders.ts @@ -0,0 +1,217 @@ +/** + * Claude's stand-ins (CLAUDE.md §2, art/placeholders/): plain SVG shapes that test form and + * layout until a real picture is accepted. They are deliberately simple. A stand-in that + * looked finished would hide that the real picture is still missing. + */ +import type { Asset, Manifest } from './manifest.js'; +import { cellBoxes, cellSize } from './prompt.js'; + +const C = { + rose: '#c85a6e', + petal: '#f2b5be', + blush: '#e8899b', + leaf: '#7fa07a', + moss: '#4f6e52', + ink: '#3a2730', + paper: '#fbf6f1', + soil: '#8a6248', + wood: '#b98a5a', + meadow: '#a9c48e', + amber: '#f2b860', + coral: '#e9846a', + night: '#2e3561', + lamp: '#f4d58d' +} as const; + +type Eyes = 'open' | 'half' | 'closed' | 'down' | 'squeeze'; +type Mouth = 'smile' | 'small' | 'open' | 'puff'; + +interface RoseLook { + readonly stage: 'bud' | 'opening' | 'half' | 'full'; + readonly eyes: Eyes; + readonly mouth: Mouth; + readonly blush?: boolean; + /** Degrees the bloom leans from the stem top; negative is left. */ + readonly tilt?: number; + readonly leaves?: 'normal' | 'down' | 'up' | 'raised'; + readonly back?: boolean; + readonly drops?: boolean; + readonly bend?: number; +} + +/** The rose in a 200 × 520 box: bloom near the top, stem down to the bottom edge. */ +function rose(look: RoseLook): string { + const r = { bud: 30, opening: 44, half: 58, full: 74 }[look.stage]; + const bend = look.bend ?? 0; + const stem = ``; + const thorns = [430, 300, 220] + .map((y, i) => ``) + .join(''); + const leafRot = { normal: [-35, 35, -30], down: [10, -10, 15], up: [-60, 60, -55], raised: [-35, 80, -30] }[look.leaves ?? 'normal']; + const leaf = (x: number, y: number, dir: number, rot: number): string => + ``; + const leaves = leaf(100, 400, -1, leafRot[0] ?? 0) + leaf(100 + bend * 0.5, 330, 1, leafRot[1] ?? 0) + leaf(100 + bend, 250, -1, leafRot[2] ?? 0); + + const count = look.stage === 'opening' ? 5 : 8; + const petals = + look.stage === 'bud' + ? ` + ` + : Array.from({ length: count }, (_, i) => { + const a = (i / count) * Math.PI * 2; + return ``; + }).join('') + ``; + + const eye = (x: number): string => { + const y = 124; + switch (look.eyes) { + case 'open': return ``; + case 'half': return ``; + case 'closed': return ``; + case 'down': return ``; + case 'squeeze': return ``; + } + }; + const mouth = { + smile: ``, + small: ``, + open: ``, + puff: `` + }[look.mouth]; + const blush = look.blush ? `` : ''; + const face = look.back ? '' : eye(91) + eye(109) + mouth + blush; + const drops = look.drops + ? [[64, 92], [138, 104], [120, 70]].map(([x, y]) => ``).join('') + : ''; + const bloom = `${petals}${face}${drops}`; + return stem + thorns + leaves + bloom; +} + +/** Place a drawing made in a w × h box centred in the target, filling about 76 %. */ +function fit(body: string, w: number, h: number, W: number, H: number, fill = 0.76): string { + const s = Math.min((W * fill) / w, (H * fill) / h); + return `${body}`; +} + +const ROSES: Record = { + 'rose-bud': { stage: 'bud', eyes: 'closed', mouth: 'small' }, + 'rose-opening': { stage: 'opening', eyes: 'half', mouth: 'small' }, + 'rose-half-bloom': { stage: 'half', eyes: 'half', mouth: 'smile' }, + 'rose-full-bloom': { stage: 'full', eyes: 'half', mouth: 'smile', tilt: -4 }, + 'rose-thirsty': { stage: 'full', eyes: 'down', mouth: 'small', tilt: 14, leaves: 'down' }, + 'rose-overwatered': { stage: 'full', eyes: 'squeeze', mouth: 'puff', leaves: 'down', drops: true }, + 'rose-windblown': { stage: 'full', eyes: 'squeeze', mouth: 'small', bend: 22, tilt: 18, leaves: 'up' }, + 'rose-blushing': { stage: 'full', eyes: 'closed', mouth: 'smile', blush: true, leaves: 'raised' }, + 'rose-sleepy': { stage: 'half', eyes: 'closed', mouth: 'smile', tilt: 10 }, + 'rose-speaking': { stage: 'full', eyes: 'open', mouth: 'open', leaves: 'raised' }, + 'rose-waiting': { stage: 'half', eyes: 'down', mouth: 'small', tilt: -18, leaves: 'down' }, + 'rose-watching-sunset': { stage: 'full', eyes: 'open', mouth: 'small', back: true, tilt: -10 } +}; + +/** The care things, each in a 200 × 200 box. */ +const PROPS: Record = { + 'watering-can': ` + + `, + windbreak: Array.from({ length: 9 }, (_, i) => ``).join('') + + ` + `, + 'weed-clump': [60, 100, 140].map((x, i) => ``).join('') + + ``, + 'fallen-petals': [[60, 110, -20], [110, 90, 25], [140, 130, 60]].map(([x, y, r]) => ``).join(''), + 'petal-folded': ` + `, + 'petal-open': ``, + 'garden-chair': ` + + + ` +}; + +function garden(W: number, H: number, time: 'morning' | 'day' | 'sunset' | 'night'): string { + const tint = { + morning: { field: '#b8d1a0', far: '#c9dbe0', wall: '#b4a596', light: '#ffffff' }, + day: { field: C.meadow, far: '#b9cfa8', wall: '#a8957f', light: '#fff6d8' }, + sunset: { field: '#c9b07a', far: '#d9a98a', wall: '#a07b62', light: C.amber }, + night: { field: '#3c4a6a', far: '#46557a', wall: '#3a4466', light: C.lamp } + }[time]; + const h = Math.round(H * 0.4); + const bedY = Math.round(H * 0.72); + return ` + + + + + `; +} + +function single(a: Asset): string { + const { width: W, height: H } = a; + switch (a.type) { + case 'sheet': { + const looks: RoseLook[] = [ + { stage: 'full', eyes: 'half', mouth: 'smile' }, + { stage: 'full', eyes: 'half', mouth: 'smile', tilt: -12 }, + { stage: 'full', eyes: 'half', mouth: 'small', tilt: -20 }, + { stage: 'full', eyes: 'half', mouth: 'small', back: true } + ]; + const figures = looks.map((l, i) => `${rose(l)}`).join(''); + const heads: RoseLook[] = [ + { stage: 'full', eyes: 'half', mouth: 'smile' }, + { stage: 'half', eyes: 'closed', mouth: 'smile' }, + { stage: 'full', eyes: 'closed', mouth: 'smile', blush: true } + ]; + // Close-ups: only the bloom, cropped by a nested viewBox. + const close = heads.map((l, i) => `${rose(l)}`).join(''); + return `${figures}${close}`; + } + case 'sprite': + return fit(PROPS[a.id] ?? '', 200, 200, W, H, 0.7); + case 'layer': { + const time = (['morning', 'day', 'sunset', 'night'] as const).find((t) => a.id.endsWith(t)) ?? 'day'; + return garden(W, H, time); + } + case 'icon': + return ` + ${rose({ stage: 'full', eyes: 'half', mouth: 'smile', blush: true })}`; + case 'spritesheet': + return sheet(a); + } +} + +/** One cell's drawing, sized to the cell it ships at. */ +function cellBody(id: string, W: number, H: number): string { + const look = ROSES[id]; + if (look) return fit(rose(look), 200, 520, W, H); + return fit(PROPS[id] ?? '', 200, 200, W, H, 0.7); +} + +function sheet(a: Asset): string { + const g = a.grid ?? { cols: 1, rows: 1 }; + return cellBoxes(a.width, a.height, g.cols, g.rows) + .map((b, i) => { + const c = a.cells?.[i]; + if (!c) return ''; + const w = b.x1 - b.x0, h = b.y1 - b.y0; + return `${cellBody(c.id, w, h)}`; + }) + .join(''); +} + +const wrap = (id: string, W: number, H: number, body: string): string => + `\n` + + ` \n` + + ` ${body.replace(/\s*\n\s*/g, ' ')}\n\n`; + +/** Every stand-in the board and the app may show: one per asset and one per sprite-sheet cell. */ +export function placeholders(m: Manifest): Map { + const out = new Map(); + for (const a of m.assets) { + out.set(a.id, wrap(a.id, a.width, a.height, single(a))); + if (a.type === 'spritesheet') { + const { width, height } = cellSize(a); + for (const c of a.cells ?? []) out.set(c.id, wrap(c.id, width, height, cellBody(c.id, width, height))); + } + } + return out; +} diff --git a/tools/art-prep/src/prompt.ts b/tools/art-prep/src/prompt.ts new file mode 100644 index 0000000..faa4bb3 --- /dev/null +++ b/tools/art-prep/src/prompt.ts @@ -0,0 +1,181 @@ +/** + * The prompts on the art board, built from the manifest and STYLE.md §1. Nobody types + * a prompt by hand (STYLE.md §6): the same words describe the rose every time. + */ +import type { Asset, Cell, Manifest } from './manifest.js'; + +/** Where a cut falls: rounded once and shared by the board's overlay and `art:accept`. */ +export function cutLines(size: number, parts: number): number[] { + return Array.from({ length: parts + 1 }, (_, i) => Math.round((i * size) / parts)); +} + +export interface CellBox { + readonly index: number; + readonly row: number; + readonly col: number; + readonly x0: number; + readonly y0: number; + readonly x1: number; + readonly y1: number; + readonly cx: number; + readonly cy: number; + /** The safe box: the drawing stays inside it (STYLE.md §9). */ + readonly safe: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number }; +} + +/** STYLE.md §9: the clear band inside every cell edge, as a share of the cell's shorter side. */ +export const SAFE_MARGIN = 0.12; + +export function cellBoxes(width: number, height: number, cols: number, rows: number): CellBox[] { + const xs = cutLines(width, cols); + const ys = cutLines(height, rows); + const boxes: CellBox[] = []; + for (let row = 0; row < rows; row++) { + for (let col = 0; col < cols; col++) { + const x0 = xs[col] ?? 0, x1 = xs[col + 1] ?? width, y0 = ys[row] ?? 0, y1 = ys[row + 1] ?? height; + const m = Math.round(SAFE_MARGIN * Math.min(x1 - x0, y1 - y0)); + boxes.push({ + index: boxes.length, row, col, x0, y0, x1, y1, + cx: Math.round((x0 + x1) / 2), cy: Math.round((y0 + y1) / 2), + safe: { x0: x0 + m, y0: y0 + m, x1: x1 - m, y1: y1 - m } + }); + } + } + return boxes; +} + +/** The size one cell ships at: its share of the sheet. */ +export function cellSize(a: Asset): { width: number; height: number } { + const g = a.grid ?? { cols: 1, rows: 1 }; + return { width: Math.floor(a.width / g.cols), height: Math.floor(a.height / g.rows) }; +} + +/** A cell made on its own is made on the generator canvas closest to its shape. */ +export function soloCanvas(a: Asset): { width: number; height: number } { + const { width, height } = cellSize(a); + if (height > width * 1.2) return { width: 1024, height: 1536 }; + if (width > height * 1.2) return { width: 1536, height: 1024 }; + return { width: 1024, height: 1024 }; +} + +const KIND: Record = { + sheet: 'character sheet', + spritesheet: 'sprite sheet', + sprite: 'single picture', + layer: 'garden layer', + icon: 'app icon' +}; + +const bg = (b: Asset['background']): string => (b === 'transparent' ? 'transparent background' : 'full background'); +const list = (items: readonly string[]): string => items.join('; '); + +/** Extra things a sprite sheet must never have, so it can be cut cleanly. */ +const SHEET_AVOID = [ + 'grid lines, cell borders or frames', + 'a background colour or paper behind the drawings', + 'ground or cast shadows', + 'drawings touching or overlapping', + 'cropped petals, leaves or stems' +]; + +/** The character the picture shows, with the sheet to attach, or the sheet's own description. */ +function subjectLine(a: Asset, m: Manifest, subject: string): string { + const c = a.character === undefined ? undefined : m.characters[a.character]; + if (!c) return subject; + if (c.sheet === a.id) return `${subject} ${c.description}`; + return `${subject} Attach the character sheet ${c.sheet} as the reference picture and match it exactly. ${c.description}`.trim(); +} + +/** The reference pictures to attach when making `a`. */ +export function attachments(a: Asset, m: Manifest): string[] { + const c = a.character === undefined ? undefined : m.characters[a.character]; + return c && c.sheet !== a.id ? [c.sheet] : []; +} + +function canvasLine(width: number, height: number): string { + const mx = Math.round(width * 0.15), my = Math.round(height * 0.15); + return `Canvas: ${width} × ${height} px, fully transparent background. One subject, centred on (${width / 2}, ${height / 2}), whole and uncropped, filling about 70 % of the canvas: everything inside x ${mx}–${width - mx}, y ${my}–${height - my}, nothing touching an edge. No background colour or paper behind it, no ground, no cast shadow.`; +} + +/** The prompt for one picture, or for a whole sprite sheet. */ +export function promptFor(a: Asset, m: Manifest, style: string): string { + if (a.type === 'spritesheet') return sheetPrompt(a, m, style); + const lines = [ + style, + '', + `Asset: ${a.id}`, + `Purpose: ${a.purpose}`, + `Subject: ${subjectLine(a, m, a.subject ?? '')}` + ]; + if (a.setting) lines.push(`Setting: ${a.setting}`); + if (a.type === 'sprite') lines.push(canvasLine(a.width, a.height)); + if (a.composition) lines.push(`Composition: ${a.composition}`); + lines.push( + `Size: ${a.width} × ${a.height} px, ${bg(a.background)} (STYLE.md §5, ${KIND[a.type]})`, + `Must include: ${list(a.include)}`, + `Must avoid: ${list([...a.avoid, ...m.avoid])}` + ); + return lines.join('\n'); +} + +function sheetPrompt(a: Asset, m: Manifest, style: string): string { + const g = a.grid ?? { cols: 1, rows: 1 }; + const cells = a.cells ?? []; + const { width: cw, height: ch } = cellSize(a); + const boxes = cellBoxes(a.width, a.height, g.cols, g.rows); + const margin = Math.round(SAFE_MARGIN * Math.min(cw, ch)); + const xs = cutLines(a.width, g.cols).slice(1, -1); + const ys = cutLines(a.height, g.rows).slice(1, -1); + const cuts = [ + xs.length ? `Cut lines down the image at x = ${xs.join(', ')}.` : '', + ys.length ? `Cut lines across the image at y = ${ys.join(', ')}.` : '' + ].filter(Boolean).join(' '); + + return [ + style, + '', + `Asset: ${a.id}`, + `Kind: a sprite sheet. One image holding ${cells.length} separate pictures on a clean grid; it is cut apart along the grid and each cell becomes its own picture in the app. The sheet itself is never shown.`, + `Purpose: ${a.purpose}`, + `Subject: ${subjectLine(a, m, '') || 'Each cell holds its own thing, described in the cell list below.'}`, + `Angle and scale: ${a.angle ?? ''}`, + `Canvas: ${a.width} × ${a.height} px, transparent background: a size image generators offer, and the size the grid below is measured on. The app divides the image into ${g.cols} × ${g.rows} equal cells whatever its size.`, + `Layout: a clean grid of ${g.cols} column${g.cols === 1 ? '' : 's'} × ${g.rows} row${g.rows === 1 ? '' : 's'} of equal, invisible cells, each ${cw} × ${ch} px, read like a book (left to right, top row first). One subject per cell, centred in its cell, whole and uncropped, with generous empty gutters, so nothing touches the edge of its cell or reaches into a neighbour. No grid lines, borders, frames, numbers, labels or captions anywhere. Fully transparent background between and around the subjects: no paper colour, no ground, no cast shadows. The same light from the left, the same outline weight and the same gouache texture in every cell.`, + `Cells (${cells.length}, in reading order):`, + ...cells.map((c, i) => { + const b = boxes[i]; + return `${i + 1}. ${c.id} (row ${(b?.row ?? 0) + 1}, column ${(b?.col ?? 0) + 1}): ${c.does}`; + }), + `Grid in pixels:`, + `- ${cuts} The lines are never drawn: they are where the scissors go.`, + `- Each drawing stays whole inside its own safe box, at least ${margin} px clear of every edge of its cell, so a band of at least ${margin * 2} px of empty transparency runs along every cut line and round the outside. Nothing crosses a cut line: no petal, leaf, stem, shadow or sparkle.`, + ...cells.map((c, i) => { + const b = boxes[i]; + if (!b) return ''; + return `- Cell ${i + 1}, ${c.id}: starts at (${b.x0}, ${b.y0}), ends at (${b.x1}, ${b.y1}); centre the drawing on (${b.cx}, ${b.cy}); safe box x ${b.safe.x0}–${b.safe.x1}, y ${b.safe.y0}–${b.safe.y1}.`; + }).filter(Boolean), + `- One scale for the whole sheet: the largest drawing fills its safe box and every other cell is drawn at that same scale, centred on its cell's centre.`, + `- If the tool makes the image another size, keep the same ${g.cols} × ${g.rows} division into equal cells and scale every number above by the same factor.`, + `Size: generate at ${a.width} × ${a.height} px (see Canvas); each cell ships at up to ${cw} × ${ch} px, transparent (STYLE.md §5 and §9).`, + `Must include: ${list(a.include)}`, + `Must avoid: ${list([...a.avoid, ...SHEET_AVOID, ...m.avoid])}` + ].join('\n'); +} + +/** The prompt for one cell of a sprite sheet, made on its own (STYLE.md §9, "One at a time"). */ +export function cellPromptFor(a: Asset, cell: Cell, m: Manifest, style: string): string { + const { width, height } = soloCanvas(a); + return [ + style, + '', + `Asset: ${cell.id} (one picture of ${a.id}, made on its own)`, + 'Kind: a single picture on a transparent background; it becomes one picture in the app.', + `Purpose: ${a.purpose}`, + `Subject: ${subjectLine(a, m, '') || 'Each cell holds its own thing, described in the cell list below.'}`, + `Angle and scale: ${a.angle ?? ''}`, + `This picture: ${cell.does}`, + canvasLine(width, height), + `Must include: ${list(a.include)}`, + `Must avoid: ${list([...a.avoid, ...m.avoid])}` + ].join('\n'); +} diff --git a/tools/art-prep/src/style.ts b/tools/art-prep/src/style.ts new file mode 100644 index 0000000..ac7b28b --- /dev/null +++ b/tools/art-prep/src/style.ts @@ -0,0 +1,39 @@ +/** + * Reads art/STYLE.md: §1, the system prompt every picture starts with, and §7, the + * review points. The file is the only copy of both, so Mark edits one place. + */ + +function section(markdown: string, n: number): string { + const text = markdown.replace(/\r\n?/g, '\n'); + const start = text.search(new RegExp(`^## ${n}\\.`, 'm')); + if (start < 0) throw new Error(`art/STYLE.md has no "## ${n}." section`); + const rest = text.slice(start); + const end = rest.slice(1).search(/^## /m); + return end < 0 ? rest : rest.slice(0, end + 1); +} + +/** §1: the quoted paragraph, line breaks kept, the `> ` markers removed. */ +export function stylePrompt(markdown: string): string { + const lines = section(markdown, 1) + .split('\n') + .filter((l) => l.startsWith('>')) + .map((l) => l.replace(/^>\s?/, '')); + if (lines.length === 0) throw new Error('art/STYLE.md §1 has no quoted system prompt'); + return lines.join('\n').trim(); +} + +/** §7: the numbered review points, each joined into one line. */ +export function reviewPoints(markdown: string): string[] { + const points: string[] = []; + for (const line of section(markdown, 7).split('\n')) { + const item = /^(\d+)\.\s+(.*)$/.exec(line); + if (item) { + if (Number(item[1]) !== points.length) throw new Error(`art/STYLE.md §7: point ${item[1]} is out of order`); + points.push((item[2] ?? '').trim()); + } else if (/^\s+\S/.test(line) && points.length > 0) { + points[points.length - 1] += ' ' + line.trim(); + } + } + if (points.length === 0) throw new Error('art/STYLE.md §7 has no review points'); + return points; +} diff --git a/tools/art-prep/test/accept.test.ts b/tools/art-prep/test/accept.test.ts new file mode 100644 index 0000000..abf62cd --- /dev/null +++ b/tools/art-prep/test/accept.test.ts @@ -0,0 +1,120 @@ +import sharp from 'sharp'; +import { describe, expect, it } from 'vitest'; +import { BUDGET, Refused, acceptPicture } from '../src/accept.js'; +import { readManifest } from './fixtures.js'; + +const m = readManifest(); +const CLEAR = { r: 0, g: 0, b: 0, alpha: 0 }; + +/** A transparent canvas with soft blobs drawn where asked: what a well-behaved generator returns. */ +async function picture(width: number, height: number, blobs: { x: number; y: number; w: number; h: number }[], background = CLEAR): Promise { + const svg = `${blobs + .map((b) => ``) + .join('')}`; + return sharp({ create: { width, height, channels: 4, background } }).composite([{ input: Buffer.from(svg) }]).png().toBuffer(); +} + +/** One blob in the middle of every cell of a grid, optionally leaving cells empty. */ +const sheetBlobs = (width: number, height: number, cols: number, rows: number, skip: number[] = []) => + Array.from({ length: cols * rows }, (_, i) => i) + .filter((i) => !skip.includes(i)) + .map((i) => { + const cw = width / cols, ch = height / rows; + return { x: (i % cols) * cw + cw * 0.25, y: Math.floor(i / cols) * ch + ch * 0.25, w: cw * 0.5, h: ch * 0.5 }; + }); + +const refusal = async (p: Promise): Promise => { + try { + await p; + } catch (e) { + if (e instanceof Refused) return e.message; + throw e; + } + throw new Error('expected a refusal'); +}; + +describe('art:accept', () => { + it('a single transparent picture becomes WebP at its size, within its budget', async () => { + const { files, notes } = await acceptPicture(await picture(1024, 1024, [{ x: 300, y: 300, w: 400, h: 400 }]), 'garden-chair', m); + expect(files).toHaveLength(1); + expect(files[0]).toMatchObject({ id: 'garden-chair', width: 1024, height: 1024 }); + expect(files[0]!.data.subarray(8, 12).toString()).toBe('WEBP'); + expect(files[0]!.data.length).toBeLessThanOrEqual(BUDGET.sprite); + expect(notes).toEqual([]); + }); + + it('refuses a transparent picture painted on a background', async () => { + const opaque = await picture(1024, 1024, [], { r: 251, g: 246, b: 241, alpha: 1 }); + expect(await refusal(acceptPicture(opaque, 'garden-chair', m))).toMatch(/background is not transparent/); + }); + + it('cuts a sprite sheet into its cells, each at the size it ships at', async () => { + const { files } = await acceptPicture(await picture(1536, 1024, sheetBlobs(1536, 1024, 4, 1)), 'rose-stages-sheet', m); + expect(files.map((f) => f.id)).toEqual(['rose-bud', 'rose-opening', 'rose-half-bloom', 'rose-full-bloom']); + for (const f of files) expect([f.width, f.height]).toEqual([384, 1024]); + }); + + it('cuts by the grid whatever size the generator made, and says so', async () => { + const { files, notes } = await acceptPicture(await picture(1200, 1000, sheetBlobs(1200, 1000, 3, 2)), 'care-props-sheet', m); + expect(files).toHaveLength(6); + expect(notes.join('\n')).toMatch(/made at 1200 × 1000, not 1536 × 1024; cut by its 3 × 2 grid anyway/); + for (const f of files) expect(Math.max(f.width, f.height)).toBeLessThanOrEqual(512); + }); + + it('refuses the whole sheet when a cell is empty, naming the cell', async () => { + const img = await picture(1536, 1024, sheetBlobs(1536, 1024, 3, 2, [4])); + expect(await refusal(acceptPicture(img, 'care-props-sheet', m))).toBe('care-props-sheet: nothing drawn in petal-folded. The whole sheet is refused.'); + }); + + it('refuses the whole sheet when a cell is painted on a background', async () => { + const blobs = sheetBlobs(1536, 1024, 3, 2); + blobs[2] = { x: 1024, y: 0, w: 512, h: 512 }; + const img = await sharp(await picture(1536, 1024, blobs)) + .composite([{ input: { create: { width: 512, height: 512, channels: 4, background: { r: 200, g: 90, b: 110, alpha: 1 } } }, left: 1024, top: 0 }]) + .png().toBuffer(); + expect(await refusal(acceptPicture(img, 'care-props-sheet', m))).toMatch(/painted on a background in weed-clump/); + }); + + it('warns when a drawing touches its cell edge, without refusing', async () => { + const blobs = sheetBlobs(1536, 1024, 4, 1); + blobs[0] = { x: 0, y: 200, w: 300, h: 600 }; + const { notes } = await acceptPicture(await picture(1536, 1024, blobs), 'rose-stages-sheet', m); + expect(notes).toEqual(["rose-bud: the drawing touches its cell's edge; a neighbour may spill in."]); + }); + + it('takes one cell made on its own and fits it to the cell', async () => { + const { files } = await acceptPicture(await picture(1024, 1536, [{ x: 300, y: 200, w: 400, h: 1100 }]), 'rose-waiting', m); + expect(files).toHaveLength(1); + expect(files[0]!.id).toBe('rose-waiting'); + expect(files[0]!.width).toBeLessThanOrEqual(384); + expect(files[0]!.height).toBeLessThanOrEqual(1024); + }); + + it('a garden layer needs a clear sky but may be solid below the horizon', async () => { + const ground = { input: { create: { width: 1024, height: 922, channels: 4 as const, background: { r: 169, g: 196, b: 142, alpha: 1 } } }, left: 0, top: 614 }; + const good = await sharp(await picture(1024, 1536, [])).composite([ground]).png().toBuffer(); + expect((await acceptPicture(good, 'garden-day', m)).files[0]).toMatchObject({ width: 1024, height: 1536 }); + const painted = await sharp({ create: { width: 1024, height: 1536, channels: 4, background: { r: 207, g: 224, b: 234, alpha: 1 } } }).png().toBuffer(); + expect(await refusal(acceptPicture(painted, 'garden-day', m))).toMatch(/sky is not transparent/); + }); + + it('a full-background picture of the wrong shape is cropped from the middle, and a small one never blown up', async () => { + const icon = await sharp({ create: { width: 900, height: 600, channels: 3, background: { r: 233, g: 132, b: 106 } } }).png().toBuffer(); + const { files, notes } = await acceptPicture(icon, 'app-icon', m); + expect(notes.join('\n')).toMatch(/made at 900 × 600, not 1024 × 1024; cropped from the middle/); + expect(notes.join('\n')).toMatch(/only 900 px wide; kept at that size, never blown up/); + expect([files[0]!.width, files[0]!.height]).toEqual([600, 600]); + }); + + it('refuses a picture over its budget instead of shipping it', async () => { + const noise = Buffer.alloc(1024 * 1024 * 3); + for (let i = 0; i < noise.length; i++) noise[i] = (i * 2654435761) >>> 24; + const img = await sharp(noise, { raw: { width: 1024, height: 1024, channels: 3 } }).png().toBuffer(); + expect(await refusal(acceptPicture(img, 'app-icon', m))).toMatch(/over its budget of 120 KB/); + }); + + it('refuses a name that is not in the manifest, and a file that is not a picture', async () => { + expect(await refusal(acceptPicture(Buffer.from('x'), 'fox-sheet', m))).toMatch(/"fox-sheet" is not a picture/); + expect(await refusal(acceptPicture(Buffer.from('not an image'), 'garden-chair', m))).toMatch(/could not be read as a picture/); + }); +}); diff --git a/tools/art-prep/test/board.test.ts b/tools/art-prep/test/board.test.ts new file mode 100644 index 0000000..421184c --- /dev/null +++ b/tools/art-prep/test/board.test.ts @@ -0,0 +1,61 @@ +import { readFileSync, readdirSync } from 'node:fs'; +import { describe, expect, it } from 'vitest'; +import { boardData } from '../src/board.js'; +import { placeholders } from '../src/placeholders.js'; +import { readManifest, readStyle, root } from './fixtures.js'; + +const manifest = readManifest(); +const data = boardData(manifest, readStyle()); +const stand = placeholders(manifest); +const page = readFileSync(`${root}tools/art-prep/board/index.html`, 'utf8'); + +describe('the board data', () => { + it('has the shape the board page reads', () => { + for (const a of data.assets) { + expect(a).toMatchObject({ id: expect.any(String), width: expect.any(Number), height: expect.any(Number), prompt: expect.any(String) }); + expect(Array.isArray(a.usedBy) && Array.isArray(a.checks) && Array.isArray(a.attach)).toBe(true); + if (a.type === 'spritesheet') { + expect(a.cells).toHaveLength((a.grid?.cols ?? 0) * (a.grid?.rows ?? 0)); + for (const c of a.cells ?? []) expect(c).toMatchObject({ id: expect.any(String), width: expect.any(Number), height: expect.any(Number), prompt: expect.any(String) }); + } + } + expect(data.checklist).toHaveLength(8); + }); + + it('every kind in the manifest has a group on the board page, or its cards would never show', () => { + for (const type of new Set(data.assets.map((a) => a.type))) expect(page).toContain(`{ type: '${type}',`); + }); + + it('the page takes the product name from @rosea/schema, never spells it', () => { + expect(page).toContain('%PRODUCT_NAME% Art Board'); + expect(page).not.toMatch(/Rosea Domi/); + }); + + it("shows Claude's review and the move into art/final/ when Claude writes them into a row", () => { + expect(page).toMatch(/r\.claude \? `Claude's review: \$\{r\.claude\}`/); + expect(page).toMatch(/r\.final \? `In art\/final\/:/); + }); +}); + +describe('the stand-ins', () => { + it('one for every picture and every cell, at its own size', () => { + const ids = manifest.assets.flatMap((a) => [a.id, ...(a.cells ?? []).map((c) => c.id)]); + expect([...stand.keys()].sort()).toEqual([...ids].sort()); + for (const a of manifest.assets) expect(stand.get(a.id)).toContain(`viewBox="0 0 ${a.width} ${a.height}"`); + expect(stand.get('rose-bud')).toContain('viewBox="0 0 384 1024"'); + expect(stand.get('watering-can')).toContain('viewBox="0 0 512 512"'); + }); + + it('load nothing from anywhere', () => { + for (const svg of stand.values()) { + expect(svg.replace('xmlns="http://www.w3.org/2000/svg"', '')).not.toMatch(/https?:|href=| { + const dir = `${root}art/placeholders/`; + const files = readdirSync(dir).filter((f) => f.endsWith('.svg')); + expect(files.map((f) => f.slice(0, -4)).sort()).toEqual([...stand.keys()].sort()); + for (const [id, svg] of stand) expect(readFileSync(`${dir}${id}.svg`, 'utf8').replace(/\r\n/g, '\n')).toBe(svg); + }); +}); diff --git a/tools/art-prep/test/fixtures.ts b/tools/art-prep/test/fixtures.ts new file mode 100644 index 0000000..ca0bf3c --- /dev/null +++ b/tools/art-prep/test/fixtures.ts @@ -0,0 +1,10 @@ +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import type { Manifest } from '../src/manifest.js'; + +export const root = fileURLToPath(new URL('../../../', import.meta.url)); +export const readManifest = (): Manifest => JSON.parse(readFileSync(`${root}art/manifest.json`, 'utf8')) as Manifest; +export const readStyle = (): string => readFileSync(`${root}art/STYLE.md`, 'utf8'); + +/** A deep copy to break on purpose. */ +export const clone = (v: T): T => JSON.parse(JSON.stringify(v)) as T; diff --git a/tools/art-prep/test/manifest.test.ts b/tools/art-prep/test/manifest.test.ts new file mode 100644 index 0000000..83baea8 --- /dev/null +++ b/tools/art-prep/test/manifest.test.ts @@ -0,0 +1,63 @@ +import { describe, expect, it } from 'vitest'; +import { checkManifest, type Asset, type Manifest } from '../src/manifest.js'; +import { reviewPoints } from '../src/style.js'; +import { clone, readManifest, readStyle } from './fixtures.js'; + +const POINTS = reviewPoints(readStyle()).length; + +/** The real manifest with one asset changed. */ +function withAsset(id: string, change: (a: Record) => void): Manifest { + const m = clone(readManifest()); + const a = m.assets.find((x) => x.id === id) as unknown as Record; + change(a); + return m; +} + +describe('art/manifest.json', () => { + it('passes every check', () => { + expect(checkManifest(readManifest(), POINTS)).toEqual([]); + }); + + it('asks for the Phase 1 pictures: the rose sheet first, then stages, care, moments, props, chair, four garden layers, the icon', () => { + const m = readManifest(); + expect(m.assets[0]?.id).toBe('rose-sheet'); + const pictures = m.assets.flatMap((a: Asset) => (a.cells ? a.cells.map((c) => c.id) : [a.id])); + expect(pictures).toHaveLength(25); + expect(pictures).toEqual(expect.arrayContaining(['rose-bud', 'rose-full-bloom', 'rose-waiting', 'petal-folded', 'garden-chair', 'garden-sunset', 'garden-night', 'app-icon'])); + }); +}); + +describe('checkManifest refuses', () => { + const cases: [string, Manifest, RegExp][] = [ + ['an id used twice', withAsset('garden-day', (a) => { a.id = 'garden-night'; }), /used twice/], + ['a cell id that repeats an asset id', withAsset('care-props-sheet', (a) => { (a.cells as { id: string }[])[0]!.id = 'garden-chair'; }), /garden-chair.*used twice/], + ['an id that is not lower-case words', withAsset('garden-day', (a) => { a.id = 'Garden_Day'; }), /lower-case/], + ['a size no generator offers', withAsset('garden-chair', (a) => { a.width = 2048; }), /not a size image generators offer/], + ['a grid whose cells do not match', withAsset('rose-stages-sheet', (a) => { a.grid = { cols: 3, rows: 1 }; }), /4 cells for a 3 × 1 grid/], + ['a grid that does not divide the sheet', withAsset('care-props-sheet', (a) => { a.grid = { cols: 3, rows: 3 }; (a.cells as unknown[]).push({ id: 'x-1', does: 'x' }, { id: 'x-2', does: 'x' }, { id: 'x-3', does: 'x' }); }), /does not divide/], + ['a grid on a single picture', withAsset('garden-chair', (a) => { a.grid = { cols: 1, rows: 1 }; }), /only a sprite sheet/], + ['an unknown character', withAsset('app-icon', (a) => { a.character = 'fox'; }), /unknown character "fox"/], + ['a shipped character sheet', withAsset('rose-sheet', (a) => { a.shipped = true; }), /never shipped/], + ['a sprite on a full background', withAsset('garden-chair', (a) => { a.background = 'full'; }), /must be transparent/], + ['a review point STYLE.md §7 does not have', withAsset('garden-chair', (a) => { a.checks = [0, POINTS]; }), new RegExp(`review point ${POINTS} is not in`)], + ['a picture with no subject', withAsset('garden-chair', (a) => { delete a.subject; }), /no subject/], + ['a picture nobody uses', withAsset('garden-chair', (a) => { a.usedBy = []; }), /usedBy is empty/], + ['a name from the book in a prompt', withAsset('garden-chair', (a) => { a.subject = 'a chair for the Little Prince'; }), /"Little Prince" \(little-prince\)/], + ['a medical word in a cell', withAsset('rose-care-sheet', (a) => { (a.cells as { does: string }[])[0]!.does = 'thirsty, waiting to be healed'; }), /"healed" \(medical\)/], + ['the word the game never says, in the shared avoid list', (() => { const m = clone(readManifest()); (m.avoid as string[]).push('a lonely look'); return m; })(), /avoid list: "lonely"/] + ]; + + for (const [what, manifest, message] of cases) { + it(what, () => { + expect(checkManifest(manifest, POINTS).join('\n')).toMatch(message); + }); + } + + it('a character whose sheet is missing or not a sheet', () => { + const m = clone(readManifest()) as { characters: Record } & Manifest; + m.characters.rose!.sheet = 'garden-chair'; + expect(checkManifest(m, POINTS).join('\n')).toMatch(/"garden-chair" is a sprite, not a character sheet/); + m.characters.rose!.sheet = 'nowhere'; + expect(checkManifest(m, POINTS).join('\n')).toMatch(/"nowhere" is not in the manifest/); + }); +}); diff --git a/tools/art-prep/test/prompt.test.ts b/tools/art-prep/test/prompt.test.ts new file mode 100644 index 0000000..2209c5c --- /dev/null +++ b/tools/art-prep/test/prompt.test.ts @@ -0,0 +1,96 @@ +import { describe, expect, it } from 'vitest'; +import { findForbidden } from '@rosea/content'; +import { boardData } from '../src/board.js'; +import { cellBoxes, cutLines, soloCanvas } from '../src/prompt.js'; +import { reviewPoints, stylePrompt } from '../src/style.js'; +import { clone, readManifest, readStyle } from './fixtures.js'; + +const style = stylePrompt(readStyle()); +const data = boardData(readManifest(), readStyle()); +const allPrompts = data.assets.flatMap((a) => [a.prompt, ...(a.cells ?? []).map((c) => c.prompt)]); + +describe('STYLE.md', () => { + it('§1 is the quoted system prompt, line breaks kept and the markers gone', () => { + expect(style.startsWith('Soft, hand-made 2D storybook illustration painted in matte gouache')).toBe(true); + expect(style).toContain('\n'); + expect(style).not.toMatch(/^>/m); + expect(style.endsWith('book, illustrator or film.')).toBe(true); + }); + + it('§7 has the eight review points, a point split over two lines read as one', () => { + const points = reviewPoints(readStyle()); + expect(points).toHaveLength(8); + expect(points[3]).toBe('Nothing from the book: no glass dome, screen, tiny planet, desert, child or scarf, and no look of its drawings.'); + }); + + it('says so when a section is missing, instead of building prompts without a style', () => { + expect(() => stylePrompt('# STYLE\n\n## 2. Palette\n')).toThrow(/no "## 1\." section/); + expect(() => reviewPoints('## 7. Review points\n\nNone yet.\n')).toThrow(/no review points/); + }); +}); + +describe('the prompts', () => { + it('every one starts with STYLE.md §1 word for word: 11 cards and 18 one-at-a-time prompts', () => { + expect(allPrompts).toHaveLength(11 + 18); + for (const p of allPrompts) expect(p.startsWith(style + '\n\nAsset: ')).toBe(true); + }); + + it('every one carries the shared avoid list, so the likeness guard is never left out', () => { + for (const p of allPrompts) expect(p).toMatch(/Must avoid: .*a glass dome or bell jar; a folding screen; a tiny round planet/); + }); + + it('none names the book, Tolkien, or a medical or unnamed word', () => { + for (const p of allPrompts) expect(findForbidden(p)).toEqual([]); + }); + + it('a rose picture asks for the rose sheet as its reference; the sheet itself does not', () => { + const by = new Map(data.assets.map((a) => [a.id, a])); + expect(by.get('rose-sheet')?.attach).toEqual([]); + expect(by.get('rose-sheet')?.prompt).not.toContain('Attach the character sheet'); + for (const id of ['rose-stages-sheet', 'rose-care-sheet', 'rose-moments-sheet', 'app-icon']) { + expect(by.get(id)?.attach).toEqual(['rose-sheet']); + expect(by.get(id)?.prompt).toContain('Attach the character sheet rose-sheet as the reference picture'); + } + expect(by.get('care-props-sheet')?.attach).toEqual([]); + }); + + it('a manifest with a forbidden name never reaches the board', () => { + const m = clone(readManifest()); + (m.assets[1] as { purpose: string }).purpose = 'In the style of Saint-Exupéry'; + expect(() => boardData(m, readStyle())).toThrow(/Saint-Exupéry/); + }); +}); + +describe('the grid', () => { + it('cuts are rounded once and include both edges', () => { + expect(cutLines(1536, 4)).toEqual([0, 384, 768, 1152, 1536]); + expect(cutLines(1000, 3)).toEqual([0, 333, 667, 1000]); + }); + + it('every safe box lies inside its cell, 12 % of the shorter side clear', () => { + for (const b of cellBoxes(1536, 1024, 3, 2)) { + expect(b.safe.x0 - b.x0).toBe(61); + expect(b.x1 - b.safe.x1).toBe(61); + expect(b.safe.y0).toBeGreaterThan(b.y0); + expect(b.safe.y1).toBeLessThan(b.y1); + } + }); + + it("a sheet's prompt gives each cell the numbers cellBoxes computes", () => { + const props = data.assets.find((a) => a.id === 'care-props-sheet'); + expect(props?.prompt).toContain('Cut lines down the image at x = 512, 1024. Cut lines across the image at y = 512.'); + expect(props?.prompt).toContain('- Cell 5, petal-folded: starts at (512, 512), ends at (1024, 1024); centre the drawing on (768, 768); safe box x 573–963, y 573–963.'); + const stages = data.assets.find((a) => a.id === 'rose-stages-sheet'); + expect(stages?.prompt).toContain('each 384 × 1024 px'); + expect(stages?.prompt).not.toContain('Cut lines across'); + }); + + it('a tall cell made on its own is made on the tall canvas, a square one on the square', () => { + const m = readManifest(); + expect(soloCanvas(m.assets.find((a) => a.id === 'rose-stages-sheet')!)).toEqual({ width: 1024, height: 1536 }); + expect(soloCanvas(m.assets.find((a) => a.id === 'care-props-sheet')!)).toEqual({ width: 1024, height: 1024 }); + const bud = data.assets.find((a) => a.id === 'rose-stages-sheet')?.cells?.[0]; + expect(bud?.prompt).toContain('Canvas: 1024 × 1536 px, fully transparent background. One subject, centred on (512, 768)'); + expect(bud?.prompt).toContain('This picture: a tight bud'); + }); +}); diff --git a/tools/art-prep/tsconfig.json b/tools/art-prep/tsconfig.json new file mode 100644 index 0000000..2cbda19 --- /dev/null +++ b/tools/art-prep/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["src/**/*.ts", "test/**/*.ts"] +}