Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.
TypeScript 3dagent-skillsai-agentsai-videobevyclaude-codegame-enginegpulinuxmacosmotion-designmotion-graphicsreactrusttypescriptvideo-editingvideo-renderingwgpuwindows
The manual's pages that raea.io/docs has served since 11-08 but no repository held until now (start/, concepts/, guides/3d|apps|words, examples/, whats-new/, index.md, and docs/manual.feature): written 11-08 by a session that has since ended and deployed from a working tree, they were parked on a branch so they couldn't be lost, and land for 0.1.2 so main's manual and the site are the same pages (16 links on main went to pages only the site had). It also holds the What's new pages for 0.1.0 and 0.1.1, made from their release notes by the release folder's whats-new.sh
shinyobjectz33380411d883
diff --git a/docs/manual.feature b/docs/manual.featurenew file mode 100644index 00000000..d1cd96e1--- /dev/null+++ b/docs/manual.feature@@ -0,0 +1,95 @@+Feature: The raea manual: one set of docs for agents first and developers second+ The manual is raea's documentation: how to install it, what it is made of, how to make each kind of thing with it,+ every verb and import, and what changed in each release. Agents read it more than people do, so every page has to+ work as plain Markdown an agent fetches or a CLI prints, and as a page a developer reads on raea.io. It lives in+ this repository beside the code it describes, it is checked by the same CI, it ships inside each release so an+ agent reads the version it runs, and the skill in raea-skills carries it.++ Background:+ Given the manual's source is docs/manual/ in this repository: one Markdown file a page, with front matter+ And raea.io/docs/ renders it (apps/site), and every page has a Markdown twin at the same path ending .md+ And the raea skill (skills/skills/raea, the raea-skills submodule) is the short, task-ordered entry point an agent+ loads first; the manual is the full text it links to++ Scenario: DM0. The decisions (Shane, 2026-11-08)+ Then the source of truth is this repository's docs/manual/, not raea-skills: the code and its docs change in the+ same commit, and raea-skills receives a copy from the gen step (DM5)+ And it is served at raea.io/docs/, in the site, with the site's nav+ And "What's new" is built from each release's approved notes (docs/release.feature RL4), one file a version+ And the primary reader is an agent and the second is a developer; both get the same pages+ And every page is written in complete English sentences, says what to do before why, and shows an example for+ each thing it teaches++ Scenario: DM1. A page's form+ Then a page is docs/manual/<section>/<name>.md with front matter: `title`, `summary` (one sentence, used in the+ sidebar's tooltip, llms.txt and search), `order` (its place in the section), and `sources` (the paths whose+ change can make it wrong, as SK4 reads `<!-- sources: -->`)+ And it opens with what the reader can do after reading it, then the shortest working example, then the details+ And each section is a heading an agent can link to: `/docs/<section>/<name>#<heading-slug>`+ And examples are fenced with their language; a TSX example that is a whole file names it: ```tsx file=hello.tsx+ means docs/manual/examples/hello.tsx holds the same text, and DM4 renders it+ And commands are shown as the reader types them, one per line, with a comment saying what each does when that+ isn't obvious; output is shown in a separate block marked `text`+ And no page names another product as a foil (sdk/raea/README.md rule 3); a page may name a tool raea works with+ (Blender, ffmpeg, Claude Code) by its name+ And words follow the skill's vocabulary (docs/skills.glossary.md) and its retired list (SK3)++ Scenario: DM2. The sections, in reading order+ Then the sections are:+ | section | holds |+ | start | what raea is, install, the first video, the first game, how an agent should use raea |+ | concepts | compositions and frames, rendering and playing, workspaces and specs, checks |+ | guides | one page a kind of work: footage cut by words, captions, motion, music, sound, 3D, |+ | | games, apps, HTML pages, R3F and three.js, generated media, the raea app for agents |+ | reference | the CLI, the SDK's imports, files and specs (generated, DM3), settings and variables |+ | whats-new | one page a release, newest first (DM7) |+ And docs/manual/index.md is the map: one line a page, so an agent reading only it knows where everything is++ Scenario: DM3. References come from the code+ Then reference/cli, reference/sdk and reference/files are the skill's generated references+ (skills/skills/raea/reference/{cli,sdk,files}.md, written by tools/skills.sh gen from `raea help --json`, the+ SDK's exports and a scratch workspace): the site renders those files, so the manual and the skill can't differ+ And a hand-written page never repeats a flag list; it links the reference++ Scenario: DM4. Every example works (tools/manual.sh check, in L0 and public CI)+ Then every ```tsx file=NAME block matches docs/manual/examples/NAME byte for byte+ And every file in docs/manual/examples/ renders with this tree's `raea render NAME --frame F -o OUT.png` (F is the+ file's `// check: frames A,B` line, else 0), or plays with `raea play --seconds 1 --offscreen` when it is a game+ And every `raea VERB` in a page's commands is a verb `raea help --json` lists, with flags that verb takes (the+ check tools/skills.sh check already runs on the skill, run on the manual)+ And every relative link and `#heading` resolves to a page and a heading that exist+ And each failure names its page, line and fix++ Scenario: DM5. The skill carries the manual (raea-skills)+ Then tools/skills.sh gen copies docs/manual/ into skills/skills/raea/manual/ with its examples, as it copies the 3D+ guides into 3d/, so a clone of raea-skills reads whole without raea+ And the skill's SKILL.md links the manual's pages for depth instead of repeating them+ And raea-skills' CI (skillcheck) checks the copy's links and front matter, and its `upstream_drift` feature fails+ when the copy is older than the raea it's tested against++ Scenario: DM6. The binary serves the manual for its own version+ Then `raea docs` prints the map, `raea docs PAGE` prints one page (`raea docs guides/games`), and+ `raea docs search "WORDS"` lists pages and headings that match, each with its path+ And the text is embedded in the binary at build time, so it matches `raea --version` and works offline+ And `raea skill`'s output names `raea docs` as where depth lives++ Scenario: DM7. What's new, from the release notes+ Given a release's notes are approved (RL4)+ Then tools/release.sh writes them to docs/manual/whats-new/<VERSION>.md with front matter (`title`, `version`,+ `date`, `summary`: the notes' first sentence) in the release commit, and the GitHub release body is the same text+ And raea.io/docs/whats-new/ lists every release newest first, with each one's headings as its contents+ And `raea whats-new` prints the entries since the version the person last ran (kept in ~/.raea/last-version), and+ `raea whats-new --all` all of them+ And the installer prints the new version's headlines after it updates an existing install+ And past releases (0.1.0-canary.1 to canary.3) are back-filled from their published notes++ Scenario: DM8. Agents can find and fetch it+ Then raea.io/llms.txt lists every page as `- [title](https://raea.io/docs/<path>.md): summary`, grouped by+ section, and raea.io/llms-full.txt is every page's Markdown in reading order+ And each page's HTML links its Markdown twin (`<link rel="alternate" type="text/markdown">`)+ And the twin is the source file with its front matter turned into a title line and a summary line++ Scenario: DM9. Coverage+ Then every verb in `raea help --json` and every import path in sdk/raea's package exports has a reference entry+ (DM3) and at least one page that shows it in use, or is listed in docs/manual/uncovered.txt with a reason+ And tools/manual.sh coverage prints what isn't covered yet, so the gap is a list, not a guessdiff --git a/docs/manual/concepts/compositions.md b/docs/manual/concepts/compositions.mdnew file mode 100644index 00000000..44e92519--- /dev/null+++ b/docs/manual/concepts/compositions.md@@ -0,0 +1,110 @@+---+title: "Compositions and frames"+summary: "A composition is a function of the frame: what that means, the core APIs (Composition, Sequence, interpolate, spring), and the rules that keep every render the same."+order: 1+sources: ["sdk/raea/src/index.tsx", "sdk/math/src/spring.ts", "sdk/guides/craft/motion.md"]+---++A composition is a React component that raea calls once for every frame. Give it frame N and it draws frame N. It+doesn't remember the frame before, and it doesn't wait for anything. That one rule is why raea can render any frame on+its own, play the same file live, and promise that the same code always renders the same pixels.++## The smallest composition++```tsx+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";++function Counter() {+ const frame = useCurrentFrame();+ return <AbsoluteFill style={{ background: "#000", color: "#fff", fontSize: 200, justifyContent: "center", alignItems: "center" }}>{frame}</AbsoluteFill>;+}++registerRoot(() => <Composition id="counter" component={Counter} width={1080} height={1080} fps={30} durationInFrames={60} />);+```++- `registerRoot` names what the file contains. A file can register several compositions; `raea render FILE+ --composition ID` picks one.+- `Composition` sets the size in pixels, the frame rate and the length in frames.+- `useCurrentFrame()` is the frame being drawn. Everything that moves is computed from it.+- `AbsoluteFill` is a `div` that fills its parent, laid out as a flex column.++Layout and styling are the web's: `div`, `span` and `img` elements, inline `style` objects or Tailwind classes in+`className`, flexbox and grid. raea draws them on the GPU itself; there is no browser.++## Moving things: interpolate and spring++`interpolate` maps a range of frames onto a range of values:++```tsx+const x = interpolate(frame, [0, 30], [-400, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });+```++Frames 0 to 30 move `x` from -400 to 0. Without the `clamp` options the line keeps going past its ends, so at frame 60+`x` would be 400. Clamp every `interpolate` unless you want that. Add `easing: Easing.out(Easing.cubic)` to ease it.++`spring` gives the motion of a physical spring, from 0 to 1, and settles by itself:++```tsx file=title.tsx+// check: frames 0,12,40+import { AbsoluteFill, Composition, registerRoot, spring, useCurrentFrame, useVideoConfig } from "raea";++const WORDS = ["Make", "what", "you", "imagine."];++// Each word springs up into place, four frames after the one before it.+function Title() {+ const frame = useCurrentFrame();+ const { fps } = useVideoConfig();+ return (+ <AbsoluteFill style={{ background: "#0f1115", justifyContent: "center", alignItems: "center", flexDirection: "row", gap: 28 }}>+ {WORDS.map((word, i) => {+ const p = spring({ frame, fps, delay: i * 4, config: { damping: 14, stiffness: 160 } });+ return (+ <span key={word} style={{ color: "#ffffff", fontSize: 110, fontWeight: 700, opacity: p, transform: `translateY(${(1 - p) * 80}px)` }}>+ {word}+ </span>+ );+ })}+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="title" component={Title} width={1920} height={1080} fps={30} durationInFrames={60} />);+```++`spring({ frame, fps })` is 0 at frame 0 and settles at 1. `delay` starts it later; `config` sets its `mass`,+`damping` and `stiffness` (defaults 1, 10 and 100: lower damping bounces more). `from` and `to` change the range, and+`durationInFrames` stretches it to settle in exactly that many frames.++## Placing things in time: Sequence and Series++`Sequence` shows its children from one frame for a number of frames, and restarts their clock:++```tsx+<Sequence from={30} durationInFrames={60}>+ <Card text="Hello" />+</Sequence>+```++Inside, `useCurrentFrame()` is 0 at composition frame 30. A component written to animate from frame 0 works anywhere+you place it. `Series` places Sequences one after another without adding up the frames yourself.++## The rules++1. **Everything that moves reads the frame.** `useState`, `useEffect`, refs and timers don't animate a render. A value+ that changes over time is a function of `useCurrentFrame()`.+2. **Random is seeded per frame.** `Math.random()` returns new numbers every frame, so something placed with it+ jumps. Seed what should hold still from an index, or decide it once in a game's `step`.+3. **Clamp interpolations.** An unclamped value runs off and can turn into NaN, which fails the render and names+ the line.+4. **Cue on words or events, not on frame numbers you guessed.** `word("phrase")` and `useGameEvents` stay right when+ the cut or the rules change. A typed frame number drifts.+5. **Media comes from files.** `<Video>`, `<Audio>` and `<Img>` take a path (use `staticFile("name")` for the+ project's `media/` folder) or an `https://` URL, which raea fetches once into its cache.++`raea guide motion` has the full list of core rules with the reasoning behind each.++## Where to go next++- [Rendering and checking](rendering.md): stills, exports and the checks.+- [Captions and cues on words](../guides/words.md): timing to speech.+- [The SDK reference](../reference/sdk.md): every import.diff --git a/docs/manual/concepts/rendering.md b/docs/manual/concepts/rendering.mdnew file mode 100644index 00000000..77f6aa01--- /dev/null+++ b/docs/manual/concepts/rendering.md@@ -0,0 +1,117 @@+---+title: "Rendering and checking"+summary: "How to render stills, transparent frames and videos, set quality and bitrate, and check an export against the floor before anyone sees it."+order: 2+sources: ["engine/cli/src/usage.rs", "sdk/guides/craft/motion/rendering.md", "runtime/export/src"]+---++raea renders the same tree the viewer gets, so a still from it is the truth about layout: fonts, footage, 3D and text+overflow only show up in pixels. `raea check` then measures what a still can't, such as a word clipped for three+frames, a stretch of black or a voice buried under music. This page covers both.++## Stills++Render the frames you want to look at as PNGs:++```sh+raea render piece.tsx --at 15,63,144,270 -o stills/ # four frames, as stills/frame-00000.png and on+raea render piece.tsx --frame 120 -o frame-120.png # one frame, to one file+raea render piece.tsx --alpha -o frames/ # every frame as a transparent PNG, for another editor+```++Pick the moments that matter, look at all of them at once, fix everything they show, and look again. A contact sheet+of a finished video shows the whole piece in one image:++```sh+raea media sheet piece.mp4 -o sheet.png+```++## Video++```sh+raea render piece.tsx -o piece.mp4+raea render piece.tsx --composition wide -o wide.mp4 # one of several compositions in the file+```++An MP4 from raea is H.264 in yuv420p. On a Mac it is encoded with VideoToolbox (H.264 High, AAC audio); on Linux and+Windows with openh264 (H.264 Constrained Baseline, Opus audio).++The output's folder must exist: `-o out/piece.mp4` needs `out/` already there.++## Quality and bitrate++By default the bitrate follows the size and frame rate: about 20 Mbit/s at 1080p30 and 80 at 4K30.++| Flag | Use it for |+|---|---|+| `--quality draft` | Fast previews |+| `--quality high` | Most deliveries |+| `--quality master` | Final exports of motion graphics and type: keeps thin type and hard edges clean |+| `--quality 0.85` | A constant quality from 0 to 1, if the presets don't fit |+| `--kbps 12000` | A fixed bitrate |+| `--10bit` | 10-bit output |++`--quality` asks for constant quality: each frame gets the bits it needs, so a flat motion graphic stays small and a+busy one stays clean.++Blotchy dark areas come from the encoder, not the composition. Export dark material as PNG frames and encode them+with more bits for the darks:++```sh+RAEA_READBACK=rgba raea render piece.tsx -o frames/+```++## A share copy++A raea MP4 is standard but large. For a copy any player and any upload takes, re-encode it with ffmpeg:++```sh+ffmpeg -i film.mp4 -c:v libx264 -preset slow -crf 23 -maxrate 2600k -bufsize 5200k -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart film-share.mp4+```++## The quick check++```sh+raea check piece.tsx --quick+```++The quick check renders three stills of a composition and measures its text: clipped, cramped, inside the safe areas+and large enough to read. It takes about a second. Run it after every save. Add `--platform tiktok` (or `reels`,+`shorts`) to check against that platform's buttons and captions.++## The full check++Render with a manifest, then check the export:++```sh+raea render piece.tsx -o piece.mp4 --manifest render.json+raea check piece.mp4 --manifest render.json --words words.json --platform tiktok -o check.json+```++The manifest records where every element was on every frame, so the check can say which element a problem belongs+to. The full check measures:++- clipped text, text under the platform's buttons, and text over a face+- captions on screen too briefly to read, and caption contrast against the pixels behind them+- frozen stretches and flashing past the safe limit+- cues that miss the word they were tied to (with `--words`)+- loudness, sound that stops dead, and sound that fights the voice+- blotching in dark areas++Each finding is ranked P0 (broken) to P3 (polish) and comes with its fix. The command exits 1 while any P0 or P1+stands, so a script or an agent can stop on it. `-o check.json` writes the findings for a later review.++An exception in the composition fails the render itself and names the line: a value that turned into NaN, keyframes+out of order, a phrase `word()` can't find, or a missing prop.++## Loudness++When the composition has a `<Mix>`, the export comes out at -14 LUFS integrated (within 1) with true peak at or below+-1 dBTP, which is what the major platforms play back at.++## Mistakes to avoid++- Judging layout from the code. Text overflow and contrast against footage only show in pixels.+- Checking frame 0 only. Most problems are at cues and joins.+- Calling it done without listening. The voice must stay clear over the music, and every sound should land.+- Rendering a new version over the old one. Render `piece-v2.mp4` beside `piece.mp4`.diff --git a/docs/manual/concepts/workspaces.md b/docs/manual/concepts/workspaces.mdnew file mode 100644index 00000000..248556c2--- /dev/null+++ b/docs/manual/concepts/workspaces.md@@ -0,0 +1,102 @@+---+title: "Workspaces and projects"+summary: "Where work lives in raea: a workspace is a git repository of projects and controllers, and each project has a brief and folders for media and renders."+order: 3+sources: ["apps/workspace/src", "core/brief/src", "skills/skills/raea/reference/files.md"]+---++You can render a single `.tsx` file from any folder, and for a quick piece that's all you need. For ongoing work,+raea keeps things in workspaces and projects, so an agent always knows what the work is for, what the person likes,+and where the files go.++## A workspace++A workspace is a git repository, one per studio or client, that holds projects and controllers. Workspaces live under+your raea root, which is `~/Studio` unless you set another:++```sh+git config --global raea.root ~/Work # optional: put workspaces somewhere else+raea workspace init acme # makes ~/Studio/acme+raea workspace adopt ~/clients/acme # or makes an existing folder a workspace+raea workspace # shows the current one (--json for its projects and paths)+```++## A project++A project is one piece of work inside a workspace. In the raea app it shows as a channel.++```sh+cd ~/Studio/acme+raea project new spring-launch+```++That makes the project's folder:++| Path | Holds |+|---|---|+| `brief.ts` | What the work is: who it's for, the one thing they should believe, its modes, its deliverables |+| `media/` | Footage, music and other source files |+| `out/` | Renders |+| `brand/` | The brand kit: `brand.css`, `brand.json`, logos |++A project can live inline in the workspace or as a repository of its own; both keep its history:++```sh+raea project split spring-launch # its own repository+raea project join spring-launch # back inline+```++## The spec files++raea's specs are TypeScript files whose default export is checked against a schema:++| File | What it says |+|---|---|+| `brief.ts` | The project's brief |+| `NAME.script.ts` | A storyboard: scenes of beats, what's on screen, what each scene must land |+| `~/.raea/taste/taste.ts` | The person's taste, which beats any guide's default |+| `plan.ts` | A frozen plan for a build, checked by raea |+| `controllers/ID.ts` | The workspace's settings and workflows |++```sh+raea spec brief.ts # prints the brief as JSON, checked against its schema+```++A brief, written with the `brief` helper from `raea/brief`. Only `title` is required; `believe` (the one thing the+audience should think afterwards) and `mode` are what an agent needs most:++```ts+import { brief } from "raea/brief";++export default brief({+ title: "Spring launch",+ for: "Acme Running",+ audience: "runners who already own our shoes, on their phones",+ believe: "the new sole makes an easy run feel easier",+ mode: ["pitch"],+ deliver: [{ name: "launch-9x16", specs: ["30 s", "9:16", "with sound"] }],+});+```++The full list of each spec's fields is in [Files and specs](../reference/files.md).++## Controllers++Controllers are the workspace's settings and workflows: delivery specs, who reviews what, the tools every agent gets.+Every change to one is a git commit.++```sh+raea controller ls # every controller, with its groups and fields+raea controller get CONTROLLER.GROUP.FIELD # one value+raea controller set CONTROLLER.GROUP.FIELD VALUE # change it, as a commit+```++## Reading a project before working on it++```sh+raea context .+```++prints, in order, everything an agent should read before making anything in the project: the person's taste, the+workspace's taste, the brief, the look, the controllers, the craft floor and the guides for the brief's modes. See+[How an agent should use raea](../start/agents.md).diff --git a/docs/manual/examples/hello.tsx b/docs/manual/examples/hello.tsxnew file mode 100644index 00000000..f9b38955--- /dev/null+++ b/docs/manual/examples/hello.tsx@@ -0,0 +1,34 @@+// check: frames 0,30,89+import { AbsoluteFill, Composition, Sequence, interpolate, registerRoot, useCurrentFrame } from "raea";++// One card: its text fades in over the first 12 frames of its Sequence.+function Card({ text }: { text: string }) {+ const frame = useCurrentFrame();+ const opacity = interpolate(frame, [0, 12], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });+ return (+ <AbsoluteFill style={{ background: "#000", color: "#fff", justifyContent: "center", alignItems: "center", fontSize: 120 }}>+ <span style={{ opacity }}>{text}</span>+ </AbsoluteFill>+ );+}++// Three seconds at 30 fps, vertical: "Hello" for the first half, "world" for the second.+registerRoot(() => (+ <Composition+ id="hello"+ width={1080}+ height={1920}+ fps={30}+ durationInFrames={90}+ component={() => (+ <>+ <Sequence from={0} durationInFrames={45}>+ <Card text="Hello" />+ </Sequence>+ <Sequence from={45} durationInFrames={45}>+ <Card text="world" />+ </Sequence>+ </>+ )}+ />+));diff --git a/docs/manual/examples/squash.tsx b/docs/manual/examples/squash.tsxnew file mode 100644index 00000000..e7ef84ca--- /dev/null+++ b/docs/manual/examples/squash.tsx@@ -0,0 +1,57 @@+// check: frames 0,90,240+import { Composition, registerRoot, useGameState, type Playtest } from "raea";+import { Arena, Banner, Hint, Score } from "raea/arena";++// The field's own units: everything below is drawn in a 1600 by 900 field, and the Arena scales it to the stage.+const W = 1600, H = 900, PADDLE = 160, BALL = 24, SPEED = 14;++type State = { y: number; bx: number; by: number; vx: number; vy: number; returns: number; misses: number };+const initial: State = { y: H / 2, bx: W / 2, by: H / 3, vx: -SPEED, vy: SPEED * 0.6, returns: 0, misses: 0 };++// The rules, as a pure function: the next state from this one and this frame's keys. It never changes `s`.+function step(s: State, input: { keys: string[] }): State {+ const up = input.keys.includes("ArrowUp"), down = input.keys.includes("ArrowDown");+ // Nobody at the keys (a render, or live before a key is pressed): the paddle follows the ball by itself.+ const aim = up || down ? s.y + (down ? 18 : -18) : s.y + Math.sign(s.by - s.y) * Math.min(12, Math.abs(s.by - s.y));+ const y = Math.max(PADDLE / 2, Math.min(H - PADDLE / 2, aim));+ let { bx, by, vx, vy, returns, misses } = s;+ bx += vx;+ by += vy;+ if (by < BALL / 2 || by > H - BALL / 2) vy = -vy; // top and bottom walls+ if (bx > W - BALL / 2) vx = -Math.abs(vx); // the far wall+ if (bx < 60 && vx < 0) {+ if (Math.abs(by - y) < PADDLE / 2 + BALL / 2) { vx = Math.abs(vx); returns += 1; } // a return+ else if (bx < 0) { bx = W / 2; by = H / 3; misses += 1; } // a miss: serve again+ }+ return { y, bx, by, vx, vy, returns, misses };+}++function Squash() {+ const g = useGameState(initial, step);+ return (+ <Arena+ width={W}+ height={H}+ score={<Score items={[{ label: "returns", value: g.returns, accent: true }, { label: "misses", value: g.misses }]} />}+ banner={g.returns === 0 && g.misses === 0 && g.bx > W / 2 ? <Banner text="squash" sub="keep the ball in play" /> : null}+ hint={<Hint keys={[{ keys: "↑ ↓", does: "move" }]} />}+ >+ <div style={{ position: "absolute", inset: 0, background: "#1b1f2a", borderRadius: 24 }} />+ <div style={{ position: "absolute", left: 30, top: g.y - PADDLE / 2, width: 24, height: PADDLE, borderRadius: 12, background: "#ff5a36" }} />+ <div style={{ position: "absolute", left: g.bx - BALL / 2, top: g.by - BALL / 2, width: BALL, height: BALL, borderRadius: BALL, background: "#ffffff" }} />+ </Arena>+ );+}++// What the playtest's bots need to check the game can be played: the same state and step, and the keys a player uses.+export const playtest: Playtest<State> = {+ initial,+ step,+ actions: [[], ["ArrowUp"], ["ArrowDown"]],+ observe: (s) => ({ paddle: s.y, ball: [s.bx, s.by] }),+ progress: (s) => Math.min(1, s.returns / 10),+ outcome: (s) => (s.returns >= 10 ? "won" : s.misses >= 3 ? "lost" : null),+};++// Games render landscape at 60 fps: ten seconds here.+registerRoot(() => <Composition id="squash" width={1920} height={1080} fps={60} durationInFrames={600} component={Squash} />);diff --git a/docs/manual/examples/title.tsx b/docs/manual/examples/title.tsxnew file mode 100644index 00000000..8238de53--- /dev/null+++ b/docs/manual/examples/title.tsx@@ -0,0 +1,24 @@+// check: frames 0,12,40+import { AbsoluteFill, Composition, registerRoot, spring, useCurrentFrame, useVideoConfig } from "raea";++const WORDS = ["Make", "what", "you", "imagine."];++// Each word springs up into place, four frames after the one before it.+function Title() {+ const frame = useCurrentFrame();+ const { fps } = useVideoConfig();+ return (+ <AbsoluteFill style={{ background: "#0f1115", justifyContent: "center", alignItems: "center", flexDirection: "row", gap: 28 }}>+ {WORDS.map((word, i) => {+ const p = spring({ frame, fps, delay: i * 4, config: { damping: 14, stiffness: 160 } });+ return (+ <span key={word} style={{ color: "#ffffff", fontSize: 110, fontWeight: 700, opacity: p, transform: `translateY(${(1 - p) * 80}px)` }}>+ {word}+ </span>+ );+ })}+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="title" component={Title} width={1920} height={1080} fps={30} durationInFrames={60} />);diff --git a/docs/manual/examples/turntable.tsx b/docs/manual/examples/turntable.tsxnew file mode 100644index 00000000..f3c0edd4--- /dev/null+++ b/docs/manual/examples/turntable.tsx@@ -0,0 +1,37 @@+// check: frames 0,45,89+import { AbsoluteFill, Composition, Easing, interpolate, registerRoot, useCurrentFrame, useVideoConfig } from "raea";+import { Cylinder, Entity } from "raea/3d";+import { StandardMaterial } from "raea/pbr";+import { Cuboid, Mesh3d } from "raea/mesh";+import { AmbientLight, DirectionalLight } from "raea/light";+import { Quat, Transform } from "raea/transform";+import { Camera3d } from "raea/camera";++function Turntable() {+ const f = useCurrentFrame();+ const { fps, durationInFrames } = useVideoConfig();+ const turn = (f / fps) * (Math.PI / 3); // a sixth of a turn a second+ const z = interpolate(f, [0, durationInFrames - 1], [7, 5], { easing: Easing.out(Easing.cubic), extrapolateLeft: "clamp", extrapolateRight: "clamp" });+ return (+ <AbsoluteFill style={{ background: "#14161c" }}>+ <Camera3d transform={Transform.fromXyz(0, 1.6, z).lookingAt([0, 0.5, 0])} projection={{ Perspective: { fov: (40 * Math.PI) / 180 } }} />+ <AmbientLight brightness={160} />+ <DirectionalLight transform={Transform.fromXyz(3, 5, 4).lookingAt([0, 0, 0])} illuminance={11200} shadow_maps_enabled />+ <Entity transform={Transform.IDENTITY.withRotation(Quat.fromEuler("XYZ", 0, turn, 0))}>+ <Mesh3d transform={Transform.fromXyz(0, -0.1, 0)}>+ <Cylinder radius={1.4} half_height={0.1} />+ <StandardMaterial base_color="#2b2f3a" perceptual_roughness={0.6} />+ </Mesh3d>+ <Mesh3d transform={Transform.fromXyz(0, 0.6, 0)}>+ <Cuboid half_size={[0.45, 0.6, 0.45]} />+ <StandardMaterial base_color="#e8b04a" perceptual_roughness={0.35} metallic={0.2} />+ </Mesh3d>+ </Entity>+ <div style={{ position: "absolute", top: 80, width: "100%", textAlign: "center", fontFamily: "Inter", fontWeight: 800, fontSize: 72, color: "#ffffff" }}>+ Made to be seen+ </div>+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="turntable" component={Turntable} width={1080} height={1080} fps={30} durationInFrames={90} />);diff --git a/docs/manual/guides/3d.md b/docs/manual/guides/3d.mdnew file mode 100644index 00000000..994b73ba--- /dev/null+++ b/docs/manual/guides/3d.md@@ -0,0 +1,120 @@+---+title: "3D scenes"+summary: "Write 3D in TSX with Bevy's names: a camera, lights, meshes and materials, moved by the frame, with 2D titles over them in the same composition."+order: 2+sources: ["sdk/raea/src/3d.tsx", "sdk/raea/src/mesh.ts", "sdk/raea/src/pbr.ts", "sdk/raea/src/light.ts", "sdk/raea/src/camera.ts", "sdk/guides/craft/bevy.md"]+---++You write 3D the way you write the rest of a composition: components whose props are computed from the frame. raea+turns them into Bevy entities (meshes, lights, cameras, glTF models, post-processing) and draws them under the page,+so titles, captions and a score sit over the 3D in the same file. You never write Rust or a render loop. A render and+a live play of the same file draw the same thing, so what you check in a render is what plays.++## A turntable++```tsx file=turntable.tsx+// check: frames 0,45,89+import { AbsoluteFill, Composition, Easing, interpolate, registerRoot, useCurrentFrame, useVideoConfig } from "raea";+import { Cylinder, Entity } from "raea/3d";+import { StandardMaterial } from "raea/pbr";+import { Cuboid, Mesh3d } from "raea/mesh";+import { AmbientLight, DirectionalLight } from "raea/light";+import { Quat, Transform } from "raea/transform";+import { Camera3d } from "raea/camera";++function Turntable() {+ const f = useCurrentFrame();+ const { fps, durationInFrames } = useVideoConfig();+ const turn = (f / fps) * (Math.PI / 3); // a sixth of a turn a second+ const z = interpolate(f, [0, durationInFrames - 1], [7, 5], { easing: Easing.out(Easing.cubic), extrapolateLeft: "clamp", extrapolateRight: "clamp" });+ return (+ <AbsoluteFill style={{ background: "#14161c" }}>+ <Camera3d transform={Transform.fromXyz(0, 1.6, z).lookingAt([0, 0.5, 0])} projection={{ Perspective: { fov: (40 * Math.PI) / 180 } }} />+ <AmbientLight brightness={160} />+ <DirectionalLight transform={Transform.fromXyz(3, 5, 4).lookingAt([0, 0, 0])} illuminance={11200} shadow_maps_enabled />+ <Entity transform={Transform.IDENTITY.withRotation(Quat.fromEuler("XYZ", 0, turn, 0))}>+ <Mesh3d transform={Transform.fromXyz(0, -0.1, 0)}>+ <Cylinder radius={1.4} half_height={0.1} />+ <StandardMaterial base_color="#2b2f3a" perceptual_roughness={0.6} />+ </Mesh3d>+ <Mesh3d transform={Transform.fromXyz(0, 0.6, 0)}>+ <Cuboid half_size={[0.45, 0.6, 0.45]} />+ <StandardMaterial base_color="#e8b04a" perceptual_roughness={0.35} metallic={0.2} />+ </Mesh3d>+ </Entity>+ <div style={{ position: "absolute", top: 80, width: "100%", textAlign: "center", fontFamily: "Inter", fontWeight: 800, fontSize: 72, color: "#ffffff" }}>+ Made to be seen+ </div>+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="turntable" component={Turntable} width={1080} height={1080} fps={30} durationInFrames={90} />);+```++```sh+raea render turntable.tsx --at 0,45,89 -o frames/+raea render turntable.tsx -o turntable.mp4+```++What each part does:++- **`Camera3d`** is the camera: where it is (`transform`) and its lens (`projection`, with the field of view in+ radians). The first camera in the tree is the one that renders.+- **Lights**: `AmbientLight` fills the shadows, `DirectionalLight` is a sun (its brightness in lux, here 11,200),+ `shadow_maps_enabled` turns its shadows on.+- **`Entity`** groups parts so they move together. Turning the group turns the plinth and the box on it.+- **`Mesh3d`** is a visible thing: a shape (`Cylinder`, `Cuboid`, `Sphere`, `Torus` and others from `raea/mesh`) and+ a material (`StandardMaterial` from `raea/pbr`, with `base_color`, `perceptual_roughness` and `metallic`).+- **`Transform`** places things: `Transform.fromXyz(x, y, z)`, `.lookingAt([x, y, z])`, and rotations from+ `Quat.fromEuler`. Y is up and units are metres, as in Bevy.+- **The `div` after the 3D** is ordinary 2D layout, drawn over the scene.++## The rules for 3D++1. **Every value comes from the frame.** A spin is `(frame / fps) * speed`, not a value kept between frames. That is+ what keeps a render and a live play the same.+2. **Rotations are in radians.** `Quat.fromEuler("XYZ", 0, Math.PI / 2, 0)` is a quarter turn about Y.+3. **Colours are hex strings.** CSS variables don't reach the 3D.+4. **Name parts that come and go** (`<Mesh3d name="lid">`), so raea matches them across frames.+5. **A part's shape is fixed for its life.** Animate its transform, colour, opacity, emission, roughness or metalness;+ to change its shape, swap in another named part.++## Checking a scene++```sh+raea scene lint turntable.tsx # parts floating, sunk into the floor, or clipping each other+raea scene light turntable.tsx # how the scene is lit, and whether the subject is exposed well+raea render turntable.tsx --review review/ # fixed cameras (hero, front, right, top, iso, low) in colour and clay+```++`--review` writes the same scene from six fixed cameras, in colour and as untextured clay, so you can see the shapes+and the light without the materials getting in the way.++## The 3D guides++The 3D guides go topic by topic, each with a complete composition to start from. Read one or two at a time:++```sh+raea guide bevy # the map of 3D topics+raea guide bevy/lights # one topic+```++| Topic | Covers |+|---|---|+| `bevy/scene` | The camera, camera moves, groups, 2D under and over 3D |+| `bevy/lights` | Sun, bulbs, spots, ambient light, shadows, brightness |+| `bevy/materials` | Colour, metal, glass, glow, clearcoat, textures, toon shading and outlines, decals |+| `bevy/meshes` | Primitives, modelled solids, blended organic shapes, trees, terrain, rocks, 3D text |+| `bevy/animation` | Spins, springs, reveals, model animation clips |+| `bevy/characters` | Bodies posed by goals, motion capture, walking to a spot |+| `bevy/rooms` | Interiors, furniture along walls, windows, daylight, sound placed in the scene |+| `bevy/games` | 3D games: state, input, many entities, collisions, state machines |+| `bevy/assets` | glTF models, pictures in space, where files go |+| `bevy/blender` | Fixing an asset in Blender first: scale, pivot, heavy meshes, FBX to glTF |+| `bevy/splats` | Gaussian splats trained from footage, and animating them |+| `bevy/liquids` | Liquids and goo, simulated and baked |+| `bevy/post` | Bloom, fog, tone mapping, exposure, lens effects, motion blur |+| `bevy/limits` | How much a scene can hold, and what isn't there yet |++The same topics ship in the raea skill as `3d/*.md`.diff --git a/docs/manual/guides/apps.md b/docs/manual/guides/apps.mdnew file mode 100644index 00000000..017f6b34--- /dev/null+++ b/docs/manual/guides/apps.md@@ -0,0 +1,131 @@+---+title: "Apps on the web target or native"+summary: "Write a desktop app as one React file, pick the web target (Blitz) or the native target (Rune), check it headless with scripted steps, and bundle it as a Mac app."+order: 3+sources: ["docs/targets.feature", "apps/targets/src", "sdk/ui/src/app.ts", "sdk/rune/src", "sdk/rune/examples"]+---++An app is a React file with a default export: DOM elements, with inline `style` or Tailwind `className`, on raea's+UI layer. One setting picks the host that draws it. Neither uses the operating system's widgets or a browser; both draw+every pixel themselves on the GPU.++| | web (the default) | native |+|---|---|---|+| Engine | Blitz on Bevy, a browser engine | Rune, an app UI framework |+| CSS | All of it, grid included | A subset: flex, no grid |+| npm UI packages | Web ones work | Those that stay in the subset |+| 3D | Yes | Not yet |+| Motion | CSS transitions | Springs on every change, GPU effects |+| Accessibility tree | | AccessKit, for screen readers |+| Host size | about 175 MB | about 27 MB |++Pick native for a small, motion-heavy app with no 3D that passes its check. Anything else stays on web. A video or a+game is a composition, not an app.++## A sign-in card++This app ships with raea as `sdk/rune/examples/signin.tsx` and passes the check on both targets. It uses only+Tailwind classes:++```tsx+import { useState } from "react";+import { rune } from "@raea/rune";++export default function SignIn() {+ const [email, setEmail] = useState("");+ const [code, setCode] = useState("");+ const ready = email.includes("@") && code.length === 6;+ return (+ <div data-testid="page" className="flex min-h-screen flex-col items-center bg-zinc-50 p-6">+ <div className="flex w-full max-w-lg flex-col gap-5 rounded-xl border border-zinc-200 bg-white p-6 shadow-sm">+ <span className="text-lg font-semibold text-zinc-900">Sign in</span>+ <input data-testid="email" value={email} onChange={(e) => setEmail((e.target as HTMLInputElement).value)}+ className="h-9 rounded-md border border-zinc-300 px-3 text-sm focus:ring-2 focus:ring-blue-500/30" />+ <input data-testid="code" value={code} onChange={(e) => setCode((e.target as HTMLInputElement).value)}+ className="h-9 rounded-md border border-zinc-300 px-3 text-sm focus:ring-2 focus:ring-blue-500/30" />+ <button data-testid="submit" disabled={!ready}+ className="h-9 rounded-md bg-zinc-900 px-4 text-sm font-medium text-white disabled:opacity-50"+ {...rune({ motion: "snap" })}>+ Sign in+ </button>+ </div>+ </div>+ );+}+```++(This is a shortened copy; the shipped file adds a "remember this device" checkbox, a side-by-side layout from `md:`+up, and dark mode.)++Unlike a composition, an app is interactive, so `useState` and event handlers work as in any React app.++## Pick the target++Say the target in the app's own file, as a literal:++```tsx+export const app = { target: "native", title: "Notes", size: [480, 640], minSize: [360, 480] };+```++With no `app` export, or no `target` in it, the target is `"web"`. `--target web` or `--target native` on the command+line overrides it.++## Run, check and bundle++```sh+raea app run signin.tsx # opens it in a window+raea app check signin.tsx --png out/ # runs it headless and writes a PNG after each step+raea app bundle signin.tsx -o SignIn.app # makes a Mac app+```++Give the check its input as steps in the app's file, finding elements by `data-testid`:++```tsx+export const steps = [{ press: "email" }, { type: "[email protected]", into: "email" }, { type: "123456", into: "code" }, { press: "submit" }];+```++or as `--script steps.json`. The check writes `00-mount.png`, then a PNG after each step, and `tree.json` with each+element's role, label, text and box. Read the PNGs. When the app should run on both targets, check both:++```sh+raea app check signin.tsx --target web --png out/web/+raea app check signin.tsx --target native --png out/native/+```++What each target is held to:++- **native** fails on any prop Rune doesn't map and any host call it doesn't answer, naming each with its element's+ path in `unmapped.json` and `unanswered.json`. Change the prop, or keep the app on web.+- **web** passes when it draws, and lists what native wouldn't draw.++On a native app, `raea app check --video out/app.mp4` films the steps at 60 fps, with a cursor gliding to each element+it presses.++## Signing++`raea app bundle` signs ad hoc unless you give it your own identity:++```sh+raea app bundle signin.tsx -o SignIn.app --identity "Developer ID Application: Your Name (TEAMID)" --notarize PROFILE+```++`PROFILE` is a `notarytool` keychain profile. raea always signs with your identity, never its own.++## What only Rune does++Typed props from `@raea/rune` add Rune's motion and effects:++```tsx+<div {...rune({ motion: "pop", transition: { effect: { push: "top" }, enter: "pop" } })}>...</div>+```++There are also `lead`, `instant`, `blur`, `backdropBlur` and `glass`, and the components `Badge`, `Spinner`,+`Progress`, `RollingText` and `Switch`. On the web target a preset motion becomes a CSS transition, blur and glass+become filters, and the rest is ignored and listed by the check.++## Host calls++`call` and `callSync` from `@raea/ui/wire` reach the host on both targets: `net.fetch`, `net.ws.*`, `net.storage.*`,+`net.clipboard.*`, `os.open` (http, https and mailto), `fs.pick`, `fs.save`, `fs.read`, `fs.write` and+`dialog.message`. In a headless check, a step answers a dialog: `{ pick: ["a.txt"] }`, `{ save: "out.txt" }`,+`{ dialog: 0 }`.diff --git a/docs/manual/guides/words.md b/docs/manual/guides/words.mdnew file mode 100644index 00000000..8ab95656--- /dev/null+++ b/docs/manual/guides/words.md@@ -0,0 +1,97 @@+---+title: "Captions and cues on words"+summary: "Cut footage by what was said, cue any part on the moment a phrase is spoken with word(), and build captions from useWords() so they follow every re-cut."+order: 1+sources: ["sdk/guides/craft/motion/words.md", "engine/cli/src/usage.rs"]+---++Most videos people make are someone talking. raea times an edit by its words instead of its seconds: a title lands+when the line is said, wherever that line ends up after the next trim. This page shows how to cut a take by its+lines, cue parts on phrases, and build captions that follow the cut.++## 1. Cut a take by its lines++Put the take under the project's `media/` folder and cut it to the lines you want:++```sh+raea cut interview.mp4 "We started in a garage" "Now we ship to forty countries"+```++raea transcribes the take first if it has no `interview.words.json`, then cuts it in the pauses around each line it+says. It writes `cuts.ts` (the cut) and `words.json` (every word kept, with its timing) beside the edit. `--at 12.4-18.9`+cuts at seconds instead, and `--append` adds to the existing cut.++`raea render` reads `words.json` from beside the edit, so the words reach the composition without any wiring.++## 2. Cue a part on a phrase++```tsx+import { Sequence, word } from "raea";++function Title() {+ // the frame where "forty countries" starts, wherever the cut puts it+ const at = word("forty countries");+ return (+ <Sequence from={at} durationInFrames={60}>+ <h1 style={{ fontSize: 96, color: "#fff" }}>40 countries</h1>+ </Sequence>+ );+}+```++- `word(phrase)` returns the frame where the phrase starts. `word(phrase, { edge: "end" })` is the frame after it+ ends, and `word(phrase, { occurrence: 2 })` is the second time it's said.+- Matching ignores case and punctuation, so `word("forty countries")` finds "forty countries."+- If the phrase is never said, `word()` throws and names it. Treat that as a check: the line isn't in the cut.+- Call `word()` inside a component, while rendering, not at the top of the file. It reads the clock.+- Inside a `Sequence`, `word()` is still a composition frame. Subtract the Sequence's `from` to use it locally.++## 3. Build captions++`useWords()` returns every word heard on the timeline as `{ text, from, to }` in the frames of the nearest Sequence+(`to` is exclusive). Words cut out of the edit aren't there, so captions follow the cut by themselves.++```tsx+import { useCurrentFrame, useWords } from "raea";++function Captions() {+ const frame = useCurrentFrame();+ const words = useWords();+ // the words said in the last second, up to the current one+ const shown = words.filter((w) => w.from <= frame && frame < w.to + 30).slice(-3);+ return (+ <div style={{ position: "absolute", bottom: 360, width: "100%", textAlign: "center", fontSize: 84, fontWeight: 800, color: "#fff" }}>+ {shown.map((w) => (+ <span key={w.from} style={{ color: frame < w.to ? "#ffd84a" : "#fff" }}>{w.text} </span>+ ))}+ </div>+ );+}+```++Rules for captions that read well:++- **Group the words**: start a new group after three words, after punctuation, or after a pause of more than eight+ frames. Show a group from its first word until the next group starts.+- **Size them** at 60 pixels or more at 1080 wide, with at least 3:1 contrast against what's behind them.+- **Keep them in one place**, off the face, off logos and off burned-in text.+- **Fix names.** Speech-to-text mishears names. Map each wrong spelling to the right one before it reaches the screen.++`raea guide words` has a complete karaoke-caption composition with grouping and a lit current word.++## 4. Check the cues++```sh+raea render edit.tsx -o edit.mp4 --manifest render.json+raea check edit.mp4 --manifest render.json --words words.json+```++With `--words`, the check finds cues that miss the word they were tied to, captions on screen too briefly to read,+and caption contrast against the footage.++## Mistakes to avoid++- Typing cue frames by ear. Every trim moves them. Use `word()`.+- Calling `word()` at the top level of the file. There is no clock there, and it throws.+- Captions wider than the frame. Fix a width, centre them, and keep groups short.+- Showing the transcript's spelling of a brand or a person's name.diff --git a/docs/manual/index.md b/docs/manual/index.mdnew file mode 100644index 00000000..afa2ece5--- /dev/null+++ b/docs/manual/index.md@@ -0,0 +1,56 @@+---+title: "raea docs"+summary: "What raea is, and a map of every page in these docs, so an agent reading only this page knows where everything is."+order: 0+sources: ["docs/manual"]+---++raea is the Render Anything Engine. You describe a video, a motion graphic, a 3D scene, a game or an app in+TypeScript and React, and raea draws it on the GPU with its own engine, built on the Bevy game engine. The same file+renders to an MP4, plays live as a game, or renders single frames for you to look at. It runs on your own computer+and needs no account.++These docs are written for coding agents first and for developers second. Every page is plain Markdown: add `.md` to+any page's address to get its source, or read [llms.txt](https://raea.io/llms.txt) for the list of pages. Offline,+`raea skill` and `raea guide` print the skill and the craft guides that match the raea you have installed.++```sh+curl -fsSL https://raea.io/install | sh # macOS (Apple Silicon) or Linux (x86_64)+raea --version # the version these docs should match+```++## If you are an agent++Read [How an agent should use raea](start/agents.md) first. It gives the order of work: read the project, write the+composition, check it in a second, render stills and look at them, render the export and check it, then hand it over.+The raea skill (`raea skill` prints it) is the short version of the same loop; these docs are the long version.++## Start++- [Install raea](start/install.md): install, update, pick a version, and what goes where.+- [Your first video](start/first-video.md): a composition from an empty folder to an MP4, in five minutes.+- [Your first game](start/first-game.md): a game that plays live and renders the same every time.+- [How an agent should use raea](start/agents.md): the loop, what runs headless, and what waits on a person.++## Concepts++- [Compositions and frames](concepts/compositions.md): a composition is a function of the frame, and why that matters.+- [Rendering and checking](concepts/rendering.md): stills, exports, quality, and the checks that catch defects.+- [Workspaces and projects](concepts/workspaces.md): where work lives, and the spec files an agent reads first.++## Guides++- [Captions and cues on words](guides/words.md): cue anything on the moment a phrase is said, and build captions.+- [3D scenes](guides/3d.md): cameras, lights, meshes and materials in TSX, drawn by Bevy.+- [Apps on the web target or native](guides/apps.md): a React file that runs as a desktop app.++## Reference++- [The CLI](reference/cli.md): a page for each of the 43 `raea` verbs, with its forms, where it runs and what each flag does.+- [The SDK](reference/sdk.md): a page for each `raea` import path, with every export's signature, props and examples.+- [Files and specs](reference/files.md): a workspace's and a project's files, and each spec's fields.+- [Settings](reference/settings.md): every setting raea reads from the environment or `~/.raea/env`.++## What's new++- [What's new](whats-new/index.md): every release, newest first, with what changed and what is still missing.diff --git a/docs/manual/start/agents.md b/docs/manual/start/agents.mdnew file mode 100644index 00000000..7b866512--- /dev/null+++ b/docs/manual/start/agents.md@@ -0,0 +1,134 @@+---+title: "How an agent should use raea"+summary: "The order of work for a coding agent using raea: read the project, write, check, look, render, check again, hand over; and which steps run headless."+order: 4+sources: ["skills/skills/raea/SKILL.md", "engine/cli/src/guide.rs", "apps/workspace/src"]+---++This page is for coding agents (Claude Code, Codex, Kimi, Gemini and others) and for the people who set them up.+After reading it, an agent knows the loop raea expects, which commands to run at each step, and which steps need a+person.++## Where each step runs++Every step below is marked with where it can run:++| Mark | Means |+|---|---|+| HEADLESS | The `raea` command alone, in any shell, with no window and no app |+| HOST | Needs the raea app running on this machine |+| PAGE | Needs the person's feed open in the raea app |+| PERSON | Only the person can do it, such as approving a storyboard or watching a cut |++An agent with only a terminal can do every HEADLESS step, which covers making, checking and delivering. Each PAGE+step below says what to do headless instead.++## 1. Install the skill (once) — HEADLESS++```sh+curl -fsSL https://raea.io/install | sh # installs raea and the skill for Claude Code+raea skills install --agent codex # or kimi, gemini: the skill where that agent reads skills+```++If the skill your agent loaded names a different version than `raea --version`, read `raea skill` instead. It prints+the skill as the installed raea ships it.++## 2. Read before you make — HEADLESS++In a project folder, print everything to read first, in order:++```sh+raea context .+```++That prints the person's taste (`~/.raea/taste/taste.ts`), the workspace's taste, the project's brief, its look, the+workspace's controllers (its settings and workflows), the craft floor, and the guide for each of the brief's modes.+Read all of it. A line in the person's taste beats any guide's default.++With no request in hand, `raea next` lists the two or three useful next steps for the project. Offer them to the+person; don't run one unasked.++Right before any edit to a composition, even a one-line change, read the craft floor:++```sh+raea guide craft+```++`raea guide` alone lists every guide: the modes (pitch, explain, story, play, tool), motion, music, sound, layout,+words, games, rendering, and `bevy` with its topics for 3D.++## 3. Write the composition — HEADLESS++A composition is one `.tsx` file. The rules that keep a render right:++- **Frame-pure.** Everything that moves reads `useCurrentFrame()`. `useState`, `useEffect` and timers don't animate+ a render.+- **Clamp every `interpolate`** unless you mean the value to run past its ends.+- **Cue on words, not guessed frames.** `word("phrase")` is the frame where the phrase is said, so cues follow the+ cut. See [Captions and cues on words](../guides/words.md).+- **Games are a pure step.** `useGameState(initial, step)`, with keys from `useInput()`. See+ [Your first game](first-game.md).++[Compositions and frames](../concepts/compositions.md) explains why, with examples.++## 4. Check it in a second — HEADLESS++After every save:++```sh+raea check piece.tsx --quick+```++It renders three stills and measures their text (clipped, cramped, outside the safe areas, too small) in about a+second. With Claude Code, the installer's hook runs it for you after each save and hands you what it finds.++## 5. Look at frames — HEADLESS++Render the moments that matter as PNGs and look at all of them in one batch: each cut, each part's entrance and+settled state, the first half second, the end card.++```sh+raea render piece.tsx --at 0,45,89 -o frames/+```++Fix everything the batch shows, then render the batch again. Don't render one still per change.++## 6. Render and check the export — HEADLESS++```sh+raea render piece.tsx -o piece.mp4 --manifest render.json+raea check piece.mp4 --manifest render.json -o piece.check.json+```++`raea check` measures what a still can't: text under a platform's buttons, captions on too briefly to read, caption+contrast against the footage behind them, frozen stretches, flashing, cues that miss their words, loudness, and+blotching in dark areas. Each finding is ranked P0 to P3 with its fix. It exits 1 while a P0 or P1 stands. Don't hand+over a render while `raea check` still names a fault.++## 7. Show it and take notes — PAGE, PERSON++In the raea app, post the render to the project's feed. The person watches or plays it there and leaves notes.++Headless instead: leave the file in the project's `out/` folder, give the person its path, and take their notes as+text.++## 8. The next version — HEADLESS++- Render each version to a new file beside the old one (`piece-v2.mp4`), never over it, so earlier versions stay+ watchable.+- Keep the person's hand edits. Edits made in the raea app come back as props on the composition (`edit` segments+ and `<Nudge>` offsets). Change the composition under them.++## 9. Deliver — HEADLESS++- Final exports of motion graphics and type: `--quality master`.+- Name files with lowercase letters, digits and hyphens only: `spring-launch-9x16.mp4`.+- Deliver to the workspace's controllers when they set sizes, platforms or loudness (`raea controller ls`).++## What an agent should never do++- Never invent a flag. `raea help` lists every verb and flag, and the [CLI reference](../reference/cli.md) is+ generated from it.+- Never render over a previous version.+- Never call a piece done without looking at its frames and running `raea check` on the export.+- Never add a folder to the person's libraries or approve a storyboard on their behalf. Those wait for the person.diff --git a/docs/manual/start/first-game.md b/docs/manual/start/first-game.mdnew file mode 100644index 00000000..67e862fe--- /dev/null+++ b/docs/manual/start/first-game.md@@ -0,0 +1,138 @@+---+title: "Your first game"+summary: "Write a small game as a pure step function, play it live with the keyboard, and render the same play-through every time."+order: 3+sources: ["sdk/app/src/games.ts", "sdk/video/src/arena.tsx", "sdk/guides/craft/motion/games.md"]+---++After this page you will have a game you can play with the arrow keys, that renders to a video of itself playing,+and that a playtest bot can check. A raea game is a composition like any other: its state at frame N is computed+from frame 0 forward, so the same input always plays the same game, live or in a render.++## 1. Write the game++Save this as `squash.tsx`:++```tsx file=squash.tsx+// check: frames 0,90,240+import { Composition, registerRoot, useGameState, type Playtest } from "raea";+import { Arena, Banner, Hint, Score } from "raea/arena";++// The field's own units: everything below is drawn in a 1600 by 900 field, and the Arena scales it to the stage.+const W = 1600, H = 900, PADDLE = 160, BALL = 24, SPEED = 14;++type State = { y: number; bx: number; by: number; vx: number; vy: number; returns: number; misses: number };+const initial: State = { y: H / 2, bx: W / 2, by: H / 3, vx: -SPEED, vy: SPEED * 0.6, returns: 0, misses: 0 };++// The rules, as a pure function: the next state from this one and this frame's keys. It never changes `s`.+function step(s: State, input: { keys: string[] }): State {+ const up = input.keys.includes("ArrowUp"), down = input.keys.includes("ArrowDown");+ // Nobody at the keys (a render, or live before a key is pressed): the paddle follows the ball by itself.+ const aim = up || down ? s.y + (down ? 18 : -18) : s.y + Math.sign(s.by - s.y) * Math.min(12, Math.abs(s.by - s.y));+ const y = Math.max(PADDLE / 2, Math.min(H - PADDLE / 2, aim));+ let { bx, by, vx, vy, returns, misses } = s;+ bx += vx;+ by += vy;+ if (by < BALL / 2 || by > H - BALL / 2) vy = -vy; // top and bottom walls+ if (bx > W - BALL / 2) vx = -Math.abs(vx); // the far wall+ if (bx < 60 && vx < 0) {+ if (Math.abs(by - y) < PADDLE / 2 + BALL / 2) { vx = Math.abs(vx); returns += 1; } // a return+ else if (bx < 0) { bx = W / 2; by = H / 3; misses += 1; } // a miss: serve again+ }+ return { y, bx, by, vx, vy, returns, misses };+}++function Squash() {+ const g = useGameState(initial, step);+ return (+ <Arena+ width={W}+ height={H}+ score={<Score items={[{ label: "returns", value: g.returns, accent: true }, { label: "misses", value: g.misses }]} />}+ banner={g.returns === 0 && g.misses === 0 && g.bx > W / 2 ? <Banner text="squash" sub="keep the ball in play" /> : null}+ hint={<Hint keys={[{ keys: "↑ ↓", does: "move" }]} />}+ >+ <div style={{ position: "absolute", inset: 0, background: "#1b1f2a", borderRadius: 24 }} />+ <div style={{ position: "absolute", left: 30, top: g.y - PADDLE / 2, width: 24, height: PADDLE, borderRadius: 12, background: "#ff5a36" }} />+ <div style={{ position: "absolute", left: g.bx - BALL / 2, top: g.by - BALL / 2, width: BALL, height: BALL, borderRadius: BALL, background: "#ffffff" }} />+ </Arena>+ );+}++// What the playtest's bots need to check the game can be played: the same state and step, and the keys a player uses.+export const playtest: Playtest<State> = {+ initial,+ step,+ actions: [[], ["ArrowUp"], ["ArrowDown"]],+ observe: (s) => ({ paddle: s.y, ball: [s.bx, s.by] }),+ progress: (s) => Math.min(1, s.returns / 10),+ outcome: (s) => (s.returns >= 10 ? "won" : s.misses >= 3 ? "lost" : null),+};++// Games render landscape at 60 fps: ten seconds here.+registerRoot(() => <Composition id="squash" width={1920} height={1080} fps={60} durationInFrames={600} component={Squash} />);+```++The parts that make it a raea game:++- **`step(state, input)` is pure.** It returns a new state from the old one and this frame's keys, and it never+ changes the old state. raea calls it once a frame, in order, from frame 0.+- **`useGameState(initial, step)`** gives the state at the current frame. Draw everything from it. Don't keep game+ state in `useState` or `useEffect`: nothing persists between frames except what the fold computes.+- **It plays itself when nobody is at the keys.** When no key is down, the paddle follows the ball. A render has no+ keys, so the autopilot is what you see in the video, and a live game is never stuck waiting for a key press.+- **`<Arena>`** draws the field in its own units (1600 by 900 here) and scales it to any stage. The score, the+ banner and the key hint each get a band of their own, so text never lands on the field or on other text.+- **`playtest`** tells raea's playtest bots how to play: the keys a player can press, what the player sees, how far+ along a run is, and when it is won or lost. The bots check that the game can be won and never gets stuck.++## 2. Play it++```sh+raea play squash.tsx+```++A window opens and the game runs at the composition's frame rate. Press the up and down arrows to take over the+paddle; let go and it plays itself again.++## 3. Render it++```sh+raea render squash.tsx --at 0,90,240 -o frames/ # three stills of the autopilot's run+raea render squash.tsx -o squash.mp4 # the whole run as a video+```++Because the state is a fold from frame 0, frame 240 renders the same whether you render the whole video or only that+frame.++## 4. Play a scripted run without a window++Agents and CI play games without a window:++```sh+raea play squash.tsx --seconds 1 --offscreen # plays one second headless and prints its timings as JSON+```++## Sound on game events++Cue a sound on the frames something happens with `useGameEvents(initial, step, isEvent)`. It runs the same fold and+returns every frame where `isEvent(before, after)` is true:++```tsx+import { Audio, Sequence, staticFile, useGameEvents } from "raea";++function Hits() {+ const frames = useGameEvents(initial, step, (before, after) => after.returns > before.returns);+ return <>{frames.map((f) => <Sequence key={f} from={f} layout="none"><Audio src={staticFile("hit.wav")} /></Sequence>)}</>;+}+```++`raea sao "a squash ball hitting a wall" -o hit.wav` makes the sound on your own computer.++## Mistakes to avoid++- Changing the state inside `step` (`s.bx += s.vx; return s`). Return a new object.+- Calling `Math.random()` while drawing. It changes every frame, so the thing jumps. Call it inside `step`, where it+ is seeded for that frame and repeats on every render, and keep what it decides in the state.+- Gating the autopilot on whether the game is live. A live game with nobody at the keys should still play itself.+- Placing sound frames by hand from a play-through. Use `useGameEvents`, so the sounds follow the rules when they change.diff --git a/docs/manual/start/first-video.md b/docs/manual/start/first-video.mdnew file mode 100644index 00000000..303a7c7e--- /dev/null+++ b/docs/manual/start/first-video.md@@ -0,0 +1,98 @@+---+title: "Your first video"+summary: "Write a composition in one TSX file, look at three of its frames, and render it to an MP4."+order: 2+sources: ["sdk/raea/src/index.tsx", "engine/cli/src/usage.rs"]+---++After this page you will have written a three-second vertical video in TypeScript and React, looked at its frames,+and rendered it to an MP4. You need raea installed ([Install raea](install.md)) and nothing else: no project+template, no npm install and no browser.++## 1. Write the composition++Make a folder and save this as `hello.tsx` in it:++```tsx file=hello.tsx+// check: frames 0,30,89+import { AbsoluteFill, Composition, Sequence, interpolate, registerRoot, useCurrentFrame } from "raea";++// One card: its text fades in over the first 12 frames of its Sequence.+function Card({ text }: { text: string }) {+ const frame = useCurrentFrame();+ const opacity = interpolate(frame, [0, 12], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });+ return (+ <AbsoluteFill style={{ background: "#000", color: "#fff", justifyContent: "center", alignItems: "center", fontSize: 120 }}>+ <span style={{ opacity }}>{text}</span>+ </AbsoluteFill>+ );+}++// Three seconds at 30 fps, vertical: "Hello" for the first half, "world" for the second.+registerRoot(() => (+ <Composition+ id="hello"+ width={1080}+ height={1920}+ fps={30}+ durationInFrames={90}+ component={() => (+ <>+ <Sequence from={0} durationInFrames={45}>+ <Card text="Hello" />+ </Sequence>+ <Sequence from={45} durationInFrames={45}>+ <Card text="world" />+ </Sequence>+ </>+ )}+ />+));+```++What each part does:++- `registerRoot` tells raea what the file contains. Here it is one `Composition`: 1080 by 1920 pixels, 30 frames a+ second, 90 frames long.+- `Sequence` places its children on the timeline. Inside a Sequence, `useCurrentFrame()` counts from the Sequence's+ own start, so each `Card` fades in from its own frame 0.+- `interpolate(frame, [0, 12], [0, 1], ...)` maps frames 0 to 12 onto an opacity of 0 to 1. The `clamp` options hold+ the value at 0 before frame 0 and at 1 after frame 12.++## 2. Look at three frames++Render the frames you care about as PNGs before you render the whole video:++```sh+raea render hello.tsx --at 0,30,89 -o frames/+```++This writes `frames/frame-00000.png`, `frame-00001.png` and `frame-00002.png`: the first frame (nothing visible yet),+frame 30 ("Hello" fully in) and the last frame ("world"). Open them and check that the text fits and nothing overlaps.++## 3. Check the text in a second++```sh+raea check hello.tsx --quick+```++The quick check renders three stills and measures their text: clipped words, cramped lines, text outside the safe+areas and text too small to read. It takes about a second, so run it after every save.++## 4. Render the video++```sh+raea render hello.tsx -o hello.mp4+```++The MP4 is H.264 with the picture in yuv420p. On a Mac it is encoded by VideoToolbox; on Linux and Windows by+openh264.++## What to try next++- Change `fontSize`, save, and run step 2 again. Every frame is computed from the code, so the same file always+ renders the same pixels.+- Make the cards spring in instead of fading: see [Compositions and frames](../concepts/compositions.md).+- Put footage under the cards and cue them on what is said: see [Captions and cues on words](../guides/words.md).+- Make a landscape version: add a second `Composition` with `id="hello-wide"`, `width={1920}` and `height={1080}`,+ and render it with `raea render hello.tsx --composition hello-wide -o hello-wide.mp4`.diff --git a/docs/manual/start/install.md b/docs/manual/start/install.mdnew file mode 100644index 00000000..7e1d4c3d--- /dev/null+++ b/docs/manual/start/install.md@@ -0,0 +1,106 @@+---+title: "Install raea"+summary: "Install raea on macOS, Linux or Windows, update it, pin a version, and know which files it puts where."+order: 1+sources: ["apps/site/public/install", "apps/site/public/install.ps1", "engine/cli/src/skill.rs"]+---++After this page you will have the `raea` command on your PATH and the raea skill installed for your coding agent.++## Install++On macOS with Apple Silicon, or on Linux on x86_64:++```sh+curl -fsSL https://raea.io/install | sh+```++On Windows 10 or 11, in PowerShell:++```powershell+irm https://raea.io/install.ps1 | iex+```++Then check that it worked:++```sh+raea --version # prints the version you installed+raea help # lists every verb+```++The installer needs no account and no API key. Rendering, playing and checking all run on your own computer.++## What goes where++| Path | What it holds |+|---|---|+| `~/.raea/` | The engine, its runtime and SDK, and your settings file (`~/.raea/env`) |+| `~/.local/bin/raea` | A link to the `raea` command, so it is on your PATH |+| `~/.claude/skills/raea/` | The raea skill, so Claude Code knows how to write and render with raea |++If `~/.local/bin` is not on your PATH, the installer says so and prints the line to add to your shell's profile.++## Update++Run the installer again. It replaces the engine with the newest release that has a build for your machine and+refreshes the skill:++```sh+curl -fsSL https://raea.io/install | sh+```++Then see what changed in [What's new](../whats-new/index.md).++## Pick a version++Set `RAEA_VERSION` to install a particular release instead of the newest:++```sh+RAEA_VERSION=0.1.0-canary.3 curl -fsSL https://raea.io/install | sh+```++On Windows:++```powershell+$env:RAEA_VERSION = "0.1.0-canary.3"; irm https://raea.io/install.ps1 | iex+```++## Installer settings++| Setting | What it does |+|---|---|+| `RAEA_VERSION` | Installs that release instead of the newest |+| `RAEA_PREFIX` | Installs somewhere other than `~/.raea` |+| `RAEA_NO_SKILLS=1` | Leaves the agent skill out |+| `RAEA_DOWNLOAD` | Downloads the release from a mirror or a local folder instead of GitHub |++## The skill for other agents++The installer adds the skill for Claude Code. For another agent, install it where that agent reads skills:++```sh+raea skills install --agent codex # also: claude, kimi, gemini+```++For Claude Code this also adds a hook that runs `raea check --quick` after each composition is saved and hands the+agent what it finds. `--no-hooks` leaves the hook out.++If an agent's copy of the skill names a different version than `raea --version` prints, it should read `raea skill`+instead: that is the skill exactly as your installed raea ships it.++## Build from source++From a checkout of the repository:++```sh+cargo build --release -p raea-cli # the binary is target/release/raea+```++## Supported systems++| System | Status |+|---|---|+| macOS on Apple Silicon | Supported |+| Linux on x86_64 | Supported. An app's window needs a display (X11, Wayland, or Xvfb on a server) |+| Windows 10 and 11 on x86_64 | Supported through `install.ps1` |+| Intel Macs, Linux on ARM | Not yet |diff --git a/docs/manual/whats-new/0.1.0-canary.1.md b/docs/manual/whats-new/0.1.0-canary.1.mdnew file mode 100644index 00000000..5ad43e3d--- /dev/null+++ b/docs/manual/whats-new/0.1.0-canary.1.md@@ -0,0 +1,24 @@+---+title: "raea 0.1.0-canary.1"+version: "0.1.0-canary.1"+date: "2026-10-20"+summary: "The first build of the raea engine you can install: `raea-motion`, the CLI that renders, plays and checks compositions written in React and TypeScript (`@raea/motion`), with the SDK, the lite runtime and the agent skills beside it."+sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.0-canary.1"]+---++The first build of the raea engine you can install: `raea-motion`, the CLI that renders, plays and checks compositions written in React and TypeScript (`@raea/motion`), with the SDK, the lite runtime and the agent skills beside it.++```sh+curl -fsSL https://raea.io/install | sh+```++That installs into `~/.raea`, links `raea-motion` from `~/.local/bin`, and adds the `raea` and `raea-bevy` skills to `~/.claude/skills`, so a coding agent knows how to write and render with raea.++- macOS on Apple Silicon only.+- Canary: it changes daily, and parts of it are rough.+- Music and foley models (TokenSynth, SAO) install themselves the first time a composition asks for them.++`sha256: 2d8fb548ad6e65f7f9a61f25fbdc57ca5f9ebd880010283a68692953716e4e38`++### Web module (added 2026-11-06)+raea_shape_web.js and raea_shape_web_bg.wasm: this release's shapes (rdb/src/shape.rs: box, sphere, minus, hull, text3d with engine/fonts' bundled faces) compiled to wasm with the same mesh() as engine/shape-web, for @raea/r3f's loadShapes() (docs/r3f.feature R3F5). SHA256SUMS-web holds their hashes. Serve both files with your app (GitHub sends them as downloads, no CORS). This release has no raea-web module: engine/web came after it.diff --git a/docs/manual/whats-new/0.1.0-canary.2.md b/docs/manual/whats-new/0.1.0-canary.2.mdnew file mode 100644index 00000000..6cd4c9cc--- /dev/null+++ b/docs/manual/whats-new/0.1.0-canary.2.md@@ -0,0 +1,79 @@+---+title: "raea 0.1.0-canary.2"+version: "0.1.0-canary.2"+date: "2026-10-31"+summary: "The second canary of the raea engine: the `raea` CLI that renders, plays and checks compositions and games written in React and TypeScript, with the SDK, the runtime and the agent skills beside it."+sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.0-canary.2"]+---++The second canary of the raea engine: the `raea` CLI that renders, plays and checks compositions and games written in React and TypeScript, with the SDK, the runtime and the agent skills beside it. It needs no account and talks to no raea server.++```sh+curl -fsSL https://raea.io/install | sh+```++That installs into `~/.raea`, links `raea` from `~/.local/bin`, and adds the `raea` and `raea-bevy` skills to `~/.claude/skills`, so a coding agent knows how to write, render and play with raea. Then:++```sh+mkdir my-video && cd my-video && raea init+raea render # a title card until you cut footage in with `raea cut`+```++## What changed since 0.1.0-canary.1++**One CLI and one SDK, both called raea.** The command is `raea` (it was `raea-motion`; the installer moves an old link over), and the SDK is the `raea` package (it was `@raea/motion`).++**The SDK speaks Bevy.** raea draws with Bevy 0.20, and its TypeScript now uses Bevy's names and shapes: `Camera3d`, `StandardMaterial` with Bevy's fields (textures with their samplers, the metallic-roughness map, fog, specular tint, anisotropy, parallax and the rest), `ExtendedMaterial` for custom shaders, and a material's `animate` track keyed by those same fields and checked by TypeScript. `<Canvas3D>` is no longer needed: a `<Camera3d>` can sit in any page element and draws its view in that element's box (a camera on the whole frame draws under the page, as before).++**The page and the 3D world are one app.** A React page (HTML and CSS, laid out and drawn by Blitz) and a Bevy world now share one App: events and input go both ways (a mesh takes `onClick` like any element), page elements can follow world objects, and CSS filters and backdrop-filter, gradients, blend modes and SVG filters (lighting among them) are drawn as Chrome draws them, each checked against Chrome. A Rust plugin can register its own page element, which TSX then uses as a tag.++**Bevy's plugin ecosystem, from TypeScript.** About fifty Bevy plugins are declared in one catalog, built into `raea` and reachable as `raea/plugins/<name>`, typed from their reflected types, or through raea's adapters and calls where a crate has none: physics (avian, rapier 2D and 3D), tilemaps and levels (tilemap, LDtk, Tiled, TrenchBroom), particles (hanabi, enoki), input (enhanced input, leafwing, a virtual gamepad and picking), audio (kira), cameras (pan, orbit), assets (OBJ, MagicaVoxel, Aseprite), easing, navigation and pathfinding (vleue_navigator, bevy_northstar), and more. `raea/bevy`'s `BevyApp` runs a headless App with any of them from a script. Declaring a plugin in `package.json`'s `raea.plugins` is the same for a Bevy crate, a Blitz extension or raea's own.++**Characters move from goals.** `@raea/character/plugin` runs raea's motion engine as an App system: give a character a goal and it performs it, frame by frame.++**Shaders.** A full-frame pass (`FramePass`) and material extensions over `StandardMaterial`, from TSX.++**Linux.** raea builds, renders and plays on Linux (x86_64, Vulkan, glibc 2.39 or newer, so Ubuntu 24.04 and later), and the same install line picks the Linux build. Install `fonts-noto-cjk` for CJK text. Rendering works on a CPU (llvmpipe); live play wants a GPU. Caches and logs follow XDG (`~/.cache/raea`, `~/.local/state/raea`). `raea song` isn't in the Linux build yet. On a minimal system (a container image, say) raea needs `libasound2t64 libfontconfig1 libvulkan1 mesa-vulkan-drivers` (Debian and Ubuntu names).++**A first run that shows something.** `raea init` makes a project whose edit plays a title card until you cut footage in, so the first `raea render` is never black.++## Windows (added 2026-11-05)++raea now runs on Windows 10 and 11 (x86_64): `raea-0.1.0-canary.2-windows-x86_64.zip` below, the same engine, SDK and skills as the macOS and Linux builds, built from canary.2 plus the Windows port's fixes. To install it, in PowerShell:++```powershell+irm https://raea.io/install.ps1 | iex+```++The installer checks the zip's checksum, puts raea under `~\.raea`, adds its `bin` to your PATH and installs the agent skills. To do the same by hand:++```powershell+$v = "0.1.0-canary.2"; $zip = "raea-$v-windows-x86_64.zip"+$url = "https://github.com/shinyobjectz/raea/releases/download/v$v/$zip"+Invoke-WebRequest $url -OutFile $zip; Invoke-WebRequest "$url.sha256" -OutFile "$zip.sha256"+if ((Get-FileHash $zip -Algorithm SHA256).Hash -ne ((Get-Content "$zip.sha256") -split '\s+')[0]) { throw "checksum mismatch" }+$tmp = Join-Path $env:TEMP "raea-$v"; Expand-Archive $zip -DestinationPath $tmp -Force+Remove-Item "$HOME\.raea\bin", "$HOME\.raea\share" -Recurse -Force -ErrorAction SilentlyContinue+New-Item -ItemType Directory -Force "$HOME\.raea" | Out-Null+Move-Item "$tmp\raea\bin", "$tmp\raea\share" "$HOME\.raea"+[Environment]::SetEnvironmentVariable("Path", "$HOME\.raea\bin;" + [Environment]::GetEnvironmentVariable("Path", "User"), "User")+```++Open a new terminal, then `mkdir my-video; cd my-video; raea init` as on the other platforms. For a coding agent, copy the folders in `~\.raea\share\raea\skills` into `~\.claude\skills`.++- It needs the **Microsoft Visual C++ Redistributable (x64)**, which most machines already have. If raea won't start, install it from https://aka.ms/vs/17/release/vc_redist.x64.exe (or `winget install Microsoft.VCRedist.2015+.x64`).+- It draws with a **DirectX 12 or Vulkan GPU driver**. With no GPU (a VM or a server), WARP, Windows' own software DirectX, crashes compiling one of Bevy's shaders, so use Mesa's lavapipe (software Vulkan) with `WGPU_BACKEND=vulkan`. That is how the zip was checked on GitHub's Windows runners, where it rendered, ran the plugin catalog and installed from the zip alone. It hasn't been tested on a Windows machine with a real GPU yet: reports welcome.+- Not in this build: `raea song` (its beat model's runner is macOS only so far).++## Known missing++- **React parity is the next release.** React apps render on the page (raea's own app passes all 15 of its review screens against Chrome, and 261 of the 265 parity cases pass; the four left draw video frames, seek video, read video back through a canvas and downscale an image), but most of the web platform isn't yet proved against Chrome item by item: 625 of the 3,812 most-used React, CSS, event, text, form, media, accessibility and platform features have a passing case.+- **A composition that cuts between two 3D scenes draws a model's screens (a page shown on a mesh) only in the first one.** Render each scene on its own and join them until this is fixed.+- **Exports aren't signed.** Content credentials come from raea's service, which this free build leaves out.+- **Three plugins are compiled in without a TypeScript API yet:** bevy_asset_loader, iyes_progress and moonshine-save, which are Rust-side libraries. Saving and loading from TypeScript is next.+- Next: a project layout by feature (`raea init --layout feature`, with assets/ found from anywhere in the project).+- macOS needs Apple Silicon; Windows needs x86_64 (no Arm build yet).+- Canary: it changes often, and parts of it are rough.++### Web module (added 2026-11-06)+raea_shape_web.js and raea_shape_web_bg.wasm: this release's core/shape (its shape language: box, sphere, minus, hull, extrude, text3d with its bundled faces) compiled to wasm with engine/shape-web's wrapper, for @raea/r3f's loadShapes() (docs/r3f.feature R3F5). SHA256SUMS-web holds their hashes. Serve both files with your app (GitHub sends them as downloads, no CORS). This release has no raea-web module: engine/web came after it.diff --git a/docs/manual/whats-new/0.1.0-canary.3.md b/docs/manual/whats-new/0.1.0-canary.3.mdnew file mode 100644index 00000000..07b75173--- /dev/null+++ b/docs/manual/whats-new/0.1.0-canary.3.md@@ -0,0 +1,44 @@+---+title: "raea 0.1.0-canary.3"+version: "0.1.0-canary.3"+date: "2026-11-07"+summary: "The third canary of the raea engine: the `raea` CLI that renders, plays and checks compositions, games and apps written in React and TypeScript, with the SDK, the runtime and the agent skills beside it."+sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.0-canary.3"]+---++The third canary of the raea engine: the `raea` CLI that renders, plays and checks compositions, games and apps written in React and TypeScript, with the SDK, the runtime and the agent skills beside it. It needs no account and talks to no raea server.++```sh+curl -fsSL https://raea.io/install | sh+```++On Windows, in PowerShell: `irm https://raea.io/install.ps1 | iex`. Then:++```sh+mkdir my-video && cd my-video && raea init+raea render+```++## What changed since 0.1.0-canary.2++**Apps, on the web or native.** A TSX app is its own program now, and its file says where it runs: `export const app = { target: "web" }` (the default) draws it with Blitz, as before, and `target: "native"` draws it in a native window with Rune. It is one SDK either way: React, `@raea/ui` and Tailwind, plus `@raea/rune` for what only a native window has (window chrome, materials, effect slots). `raea app run` opens it, `raea app bundle` packs it with raea's own bundler, and `raea app check` drives it headless on either target with its own scripted steps (`export const steps`), writes the frames, and reports every prop or call the target can't honour in `unmapped.json`, never dropping one quietly. Both hosts (`raea-rune-host` and `raea-page-host`) ship in this archive. The raea skill's "Apps: web or native" section and `sdk/rune/examples/` show two apps that pass the check on both targets.++**React Three Fiber, both ways.** An R3F scene runs inside a raea composition, a raea composition runs inside an R3F `<Canvas>` (or any three.js app, through `Scene3d`), and `raea` can export a composition as React Three Fiber source. Each way is held to the other renderer, and anything with no counterpart is listed, not lost. raea's solids are on the web too: the shape and web modules are attached to this release (`SHA256SUMS` beside them).++**Ray tracing and denoising.** `<SolariLighting>` turns on Bevy's Solari path tracer for a camera where the GPU can run it, MetalFX denoises and upscales it on the Mac, and `raea render --aov` writes each frame's motion vectors and depth beside its picture. `raea neural mlxdlss` runs MLX-DLSS on a render with raea's own motion and depth; its weights are NVIDIA's and yours to fetch, never shipped with raea.++**Closer to Bevy.** Any field of any component can be set from frame to frame, transforms are Bevy's `Transform` end to end, units are Bevy's, and each Bevy concept has one form in TSX. Bevy's own examples are being ported as the reference: instancing (thousands of entities sharing a mesh and material batch as Bevy batches them), `<Material fragment>` with your own shader file compiled as written, and `<EnvironmentMapLight>` with Bevy's prefiltered maps.++**Skills that stay true.** The `raea` and `raea-bevy` skills are partly generated from the CLI and SDK and checked against this release's `raea` before it ships: a stale reference, a retired name, a flag no command takes or a dead link stops the release.++**Windows.** The Windows zip is still building on GitHub's Windows runner and will be added to this release. Until it is, install canary.2 there: `$env:RAEA_VERSION = "0.1.0-canary.2"; irm https://raea.io/install.ps1 | iex`.++This release is built from `v0.1.0-canary.3`, which is an export of its own commit; the repository's main branch already has later work.++## Known missing++- A Bevy 3D view inside a native app. The native target draws UI; an embedded world is next (it needs Rune's wgpu backend on macOS, since its Metal backend has no depth or MSAA yet).+- On the native target, the page below the app's root is painted white where the web paints it black.+- On the web target, a label in a narrow box can wrap where Chrome wouldn't.+- `raea song` is macOS only.+- On Linux, an app's window (`raea app run`, on either target, and `raea app check`'s web target) needs a display: X11 or Wayland, or Xvfb on a server. A minimal system also needs `libxkbcommon-x11-0 libxcursor1 libxi6 libxrandr2 libx11-xcb1 libvulkan1` (Debian and Ubuntu names). The archive's README lists them.diff --git a/docs/manual/whats-new/0.1.0.md b/docs/manual/whats-new/0.1.0.mdnew file mode 100644index 00000000..8f7f66cd--- /dev/null+++ b/docs/manual/whats-new/0.1.0.md@@ -0,0 +1,67 @@+---+title: "raea 0.1.0"+version: "0.1.0"+date: "2026-11-09"+summary: "The first release of the raea engine: the `raea` CLI that renders, plays and checks compositions, games and apps written in React and TypeScript, with the SDK, the runtime and the agent skills beside it."+sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.0"]+---++raea 0.1.0 is the first release of the raea engine: the `raea` CLI that renders, plays and checks compositions, games and apps written in React and TypeScript, with the SDK, the runtime and the agent skills beside it. It needs no account and talks to no raea server.++```sh+curl -fsSL https://raea.io/install | sh+mkdir my-video && cd my-video && raea init+raea render+```++0.1.0 is for the Mac (Apple silicon) and Linux on x86_64. It has no Windows build: 0.1.1 is the first release with one.++## What changed since 0.1.0-canary.3++**React Three Fiber in, three.js out.** An R3F scene, its GLSL shaders, postprocessing and drei helpers render straight to the GPU, frame-exact and with no browser. It also works the other way: a raea scene plays in three.js on the web. Each way is checked against the other renderer, and anything without a counterpart is listed, not lost.++**Bevy's own examples, matched.** Bevy's examples are ported to raea's TypeScript SDK and checked against Bevy itself, pixel for pixel. 155 of them pass, across 2D shapes, text and atlases, lights, materials, UI, shaders, compute, many_foxes and split screen. Bring your own WGSL: custom materials in 3D and 2D, storage buffers, texture arrays, bindless, prepasses and compute shaders, all from TSX.++**Bevy UI in TSX.** Gradients (linear, radial, conic, with Bevy's colour hints and Oklab), box shadows, stacking, scrolling, grid, text input and IME, and the full feathers widget set, each matched to Bevy, and drivable by scripted input for a render.++**Ray tracing.** Under Solari and the path tracer, see-through materials, `uv_transform` and a panorama's sun all work, so a chrome ball reflects the sky's sun. A `ShaderExtension` that doesn't compile refuses the render, and `<Pathtracer />` no longer panics on its first frame.++**Rune layers in a web page.** Mark an element with `<RuneLayer>` (from `@raea/rune`) and its subtree is drawn by Rune on Bevy's own GPU device, with no copy, inside a page Blitz draws. Presses and the wheel reach the layer's elements, and a press held off the layer still ends there. The same TSX app still builds for a native window or the web, and `raea app check` drives it on both targets.++**Live equals render.** Playing a 3D scene live and rendering it now share one path. Across 190 compositions, 169 match pixel for pixel, and the rest have known causes.++**The same pixels every run.** Draw order in 3D, GPU particles (bevy_hanabi, patched) and Vello's antialiasing no longer vary between runs, so a render is a function of its code.++**HTML closer to Chrome.** `background-clip: text`, SVG paint from stylesheets, `transform-box`, `preserve-3d`, opacity over positioned children, and vendor-prefixed styles, each checked against Chrome and the web-platform tests. An HTML page whose script throws before any timeline registers now fails to render with its error, instead of holding its first frame.++**Video and fonts from the web.** A `<Video>` whose `src` is an `https://` URL now plays: raea fetches it once into its cache, keyed by the URL, so the render stays a function of its code and plays offline after that. A URL it can't fetch stops the render and says why ("HTTP 404 Not Found", or that it isn't cached and `RAEA_OFFLINE` is set). Before, the URL was read as a file next to the composition and refused as "no video track" (#57). And `loadFont("Space Grotesk")` from `raea/text` loads a Google Fonts family by name, every weight and style, once, through the same cache. Families nobody asks for aren't fetched, as in Chrome.++**Black behind an empty composition, in video too.** A composition that paints no background was black behind its content in a PNG but dark blue (13, 10, 26) in an MP4 or MOV. Both are black now. If a video of yours relied on the blue, give its root a `backgroundColor`.++**`raea song` everywhere.** Beat, bar and section maps now come out on Linux and Windows as well as macOS, from the same beat model on every platform, and each release checks it.++**Docs for everything.** raea.io/docs has a page for every CLI verb and every SDK import path, and every SDK prop, field and member is described there. The docs check fails on a missing one.++**Skills for agents.** The raea skill now lives in its own repository, github.com/shinyobjectz/raea-skills, and its craft guides travel with it. Its description leads with what only raea does (3D, physics, matchmove, games, beat-timed cuts), so an agent such as Claude Code, Codex or OpenCode picks raea for those jobs. Each runner checks the skill's CLI reference against the `raea` it just built.++**Built in public.** The macOS and Linux archives are built from this tag by public CI and carry build-provenance attestations. Check one with `gh attestation verify raea-0.1.0-linux-x86_64.tar.gz -R shinyobjectz/raea`.++**Fixes**+- An app's `{ frames: 30 }` and `{ dialog: 1 }` steps play again (#75).+- A guide's `raea export-game` names the real command (#76).+- raea's own git commits work on a Mac with no git email set.++Thank you to everyone who filed issues and sent PRs this round: JimGHTB12, studiodreamsummon, watzon, kevinschaich, tudorsaitoc, Jameschuthink, tobitege and kumanday. 39 issues closed since canary.3.++If you build raea from main: between a3db7b6db and 94d62d7fd (both 11-08, neither in a release), `raea render X.tsx --at N` refused every TSX composition with "no two readbacks with its tag agreed". Full renders were unaffected. It's fixed in this release.++This release is built from `v0.1.0` (d6f41c605).++## Known missing++- No Windows build (0.1.1 has one).+- The engine is unsigned: its renders carry no Content Credentials, and the binaries aren't notarized. The installer doesn't quarantine them, so macOS runs them.+- A Rune layer's elements aren't in the page's layout snapshot yet (their `getBoundingClientRect` is zero), and keys and IME don't reach a layer yet.+- On the native target, the page below the app's root is painted white where the web paints it black.+- On the web target, a label in a narrow box can wrap where Chrome wouldn't.+- On Linux, raea needs ALSA and fontconfig (Ubuntu 24.04: `sudo apt install libasound2t64 libfontconfig1`). An app's window (`raea app run`, on either target, and `raea app check`'s web target) needs a display: X11 or Wayland, or Xvfb on a server. A minimal system also needs `libxkbcommon-x11-0 libxcursor1 libxi6 libxrandr2 libx11-xcb1 libvulkan1` (Debian and Ubuntu names).diff --git a/docs/manual/whats-new/0.1.1.md b/docs/manual/whats-new/0.1.1.mdnew file mode 100644index 00000000..81029cc8--- /dev/null+++ b/docs/manual/whats-new/0.1.1.md@@ -0,0 +1,80 @@+---+title: "raea 0.1.1"+version: "0.1.1"+date: "2026-11-10"+summary: "The engine and, for the first time, the desktop app on the Mac, Windows and Linux: notes the work is held to, findings on every render, and Windows builds."+sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.1"]+---++raea 0.1.1 is the engine and, for the first time, the desktop app on the Mac, Windows and Linux.++The engine is the `raea` CLI. It renders, plays and checks compositions, games and apps written in React and TypeScript, and the SDK, the runtime and the agent skills come with it. The app is where your agents post what they make. You watch it there, leave notes on the picture, and sign off on it.++**Get the app at [raea.io](https://raea.io)** (a Mac with Apple silicon, Windows 10 or 11, or Linux on x86_64).++The engine alone:++```sh+curl -fsSL https://raea.io/install | sh+```++On Windows, in PowerShell: `irm https://raea.io/install.ps1 | iex`.++## What changed since 0.1.0++**The desktop app, on three systems.** raea.app for the Mac is signed, notarized and updates itself. Windows gets an installer for your user alone, with no administrator needed: it adds raea to the Start menu and to Settings > Apps. Linux gets a folder to unpack; run `./install.sh` once to put raea in your desktop's app list. On every system the app opens raea.io to link your account. A page's video and audio now play at their own volume in the app, so its volume slider works (not only mute).+The Windows installer isn't signed yet, so SmartScreen asks before it runs: press More info, then Run anyway.++**Windows.** 0.1.0 shipped without a Windows build. This one has one, with these fixes from your reports:+- `raea play` no longer hangs at start-up. Shaders compile as each frame needs them, as they always have on macOS.+- `raea init`, `play` and `render` work from the unpacked zip without setting `RAEA_HOME` (#78, #80).+- 3D renders work on DX12: the ink-outline shader compiles under FXC (#66).+- A GPU error stops the render and quotes what the GPU said, instead of saving a half-drawn frame as a success (#66).+- On Vulkan, a GPU with little memory of its own (an AMD APU's carve-out) gets smaller shadow maps, so 3D scenes fit (#66).+- HTML renders work from the zip with no `bun` on PATH (#67).+- Bright parts of a video come out whole on GPUs whose shader compilers treat a shift into the sign bit differently, such as a Windows on ARM laptop's (#82).+It's an x86_64 build; on Windows on ARM it runs under emulation, and the GPU work runs natively.++**Notes the work is held to.** A note you leave in the app is kept word for word. `raea notes take` turns it into a file of asks, one per thing you asked, and nothing changes until the agent has said back what it heard. You see the asks on your comment and can correct one in a word. Each ask is then held by a check that must fail on the work as it stands before the work changes, or by a clip of the work that you sign in the app. `raea notes check` refuses a check that passes the first time. The badge on a note says where each ask stands: to restate, to check, failing, to sign, passing or signed.++**Every render says what it found.** Each render writes a manifest beside its output, and its findings are kept: a part clipping into another, a light that cuts, an exposure warning. `raea findings` sets each render against the one before it and shows what's new, what's still there and what you fixed. An error fails the render however its output is piped, and `--despite CHECK WHY` lets one through with a reason on record.++**`raea world` and `raea check`.** `raea world` reads a frame of a composition as one set of facts: each caption's contrast against its real pixels, what covers it, each shot's light and movement, the mix's loudness. Write a rule once in a project controller, as one of raea's checks or a few lines of TypeScript (`raea/check`), and `raea check PROJECT` runs it on every composition. Text is timed by the frames it can actually be read on, so a faded or covered caption doesn't count toward its reading time. On the Mac, text you could read but OCR can't is reported as broken: an error.++**A look per frame, and cuts between cameras.** Post-processing and light colours are now each frame's own, so a look can change mid-shot and a render matches what play shows. Give each shot its own `<Camera3d>` and switch them with `is_active`: one render cuts between them, and the frame after a cut is drawn as that shot would start on its own, with no motion blur or ray-traced history carried over from the other camera.++**Sound on its own.** `raea render X.tsx -o OUT.wav` renders only the sound, and `--audio OUT.wav` writes a video's sound beside it from the same pass. A sound render finds its `staticFile` assets in the edit's folder.++**HTML closer to Chrome.** A filter takes in what its element draws outside its box. An SVG shape turned by a style holding only transforms, and an SVG under a viewBox that doesn't start at 0 0, both land where Chrome puts them. A page of many full-frame layers draws all of them. Frame 0 applies a GSAP timeline's time-0 sets (#79). Several of these are JimGHTB12's (#92, #93, #94).++**Show work, not files.** `raea show` sends what a session wants you to see to the app as an item you can use, rather than opening Preview. `raea hook` sets that up for every agent harness. In the app's live stage you can pick 3D parts, fly a free camera, and set props while it plays (`raea play --pick`, `--view`), and `raea media lod` makes a model at a lower level of detail.++**Plugins.** Plugins you install from npm, Git or a folder can be imported by your compositions.++**Fixes**+- A still late in a long 3D composition no longer replays every frame before it (#77).+- A GPU that stops drawing fails the render instead of writing an empty frame.+- An `ImagePlane` plays its sprite sheet and swaps its picture in an MP4 render.+- A solid's mesh is kept on disk between runs, so a scene with boolean cuts opens faster the second time (a furnished set went from 12.2 s to 4.6 s).+- Video playback on the Mac no longer hitches every 300 frames.+- A scene with `<Grass>` under `<SolariLighting>` renders instead of panicking on its first frame.+- You can paste into a page's text fields.+- Workspaces go in `~/Documents/raea` when no `raea.root` is set.+- `startFrom`, `endAt`, `trimBefore` and `trimAfter` count the composition's frames, not the media's own, and their docs now say so (#89).+- An `<Audio>` or `<Video>` with `fadeOut` fades inside its clip and is silent by its end, rather than playing at full volume to the cut and fading after it (#89).+- A direct GPU render makes the page for 2D image rows only when it draws one, which saved about 160 ms on every render that has none (#70).+- On Linux, `raea-perceive`'s OCR downloads its models again, and its portable build includes `read-lines` and the face commands (#69).+- `<Instances>` no longer use more memory with every frame of a video: a scene of 300,000 instances that ran a machine out of memory now renders 600 frames in 2.7 GB (#84). When a composition sets its own size, frame rate or length, raea says that `--w`, `--h`, `--fps` or `--frames` wasn't applied.+- Moving `<Instances>` move in a video and an `--at` list, as they already did in a still (#85).++Thank you to everyone who filed issues and sent PRs this round: JimGHTB12, Ragulsundaram, SirSicard, Jameschuthink, Zeken0, TRDEFI, JoacoRea, juansilvadesign, Omkar-Hundre, ahmedNY and jbilakhi.++This release is built from `v0.1.1` (7099bb922).++## Known missing++- The Windows and Linux apps don't update themselves yet: download the next version from raea.io. They have no folder chooser yet either.+- On Linux, raea needs ALSA, fontconfig and Vulkan (Ubuntu 24.04: `sudo apt install libasound2t64 libfontconfig1 libvulkan1 mesa-vulkan-drivers`), and the app's window needs X11 or Wayland with libxkbcommon-x11. The README in each download lists the packages.+- In the Windows and Linux apps, a feed card's video stays black on a software GPU (llvmpipe, WARP).+- The OCR half of the reading check runs on the Mac only. On Windows and Linux it says it's waiting.+- The engine's own binaries aren't notarized and its renders carry no Content Credentials. The Mac app is signed and notarized.diff --git a/docs/manual/whats-new/index.md b/docs/manual/whats-new/index.mdnew file mode 100644index 00000000..07b0ab53--- /dev/null+++ b/docs/manual/whats-new/index.md@@ -0,0 +1,17 @@+---+title: "What's new"+summary: "Every raea release, newest first: what changed, how to update, and what is known to be missing."+order: 0+sources: ["docs/manual/whats-new"]+---++Each release's notes, as they were published with it. To update, run the installer again:++```sh+curl -fsSL https://raea.io/install | sh+raea --version+```++On Windows, in PowerShell: `irm https://raea.io/install.ps1 | iex`. The desktop app on the Mac updates itself; on+Windows and Linux, download the new version from [raea.io](https://raea.io). Each release says what is known to be+missing.