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
Workspaces go in ~/Documents/raea when no raea.root is set
shinyobjectz4ca98b13a398
diff --git a/apps/workspace/src/lib.rs b/apps/workspace/src/lib.rsindex bb8d79f1..dc350281 100644--- a/apps/workspace/src/lib.rs+++ b/apps/workspace/src/lib.rs@@ -16,7 +16,7 @@ mod workspace;pub use controllers::{controller, module, summary};pub use registry::context;pub use literal::{tidy, tidy_deep, ts_literal};-pub use workspace::{project, projects, root, slug, up, workspace};+pub use workspace::{default_root, project, projects, root, slug, up, workspace};pub type R<T> = Result<T, String>;diff --git a/apps/workspace/src/tests.rs b/apps/workspace/src/tests.rsindex f0f6c4f0..37fbf3ab 100644--- a/apps/workspace/src/tests.rs+++ b/apps/workspace/src/tests.rs@@ -94,3 +94,19 @@ fn doctor_finds_old_briefs_and_old_skills() {assert!(reinstalled.get() && out.starts_with("APPLIED 1 of 2 fixed"), "{out}");let _ = std::fs::remove_dir_all(&d);}++#[test]+fn the_root_with_none_set() {+ let home = scratch("home-root");+ assert_eq!(default_root(&home), home.join("Documents/raea"));+ // an empty ~/Studio isn't one; one with a workspace stays the root+ std::fs::create_dir_all(home.join("Studio/notes")).unwrap();+ assert_eq!(default_root(&home), home.join("Documents/raea"));+ std::fs::create_dir_all(home.join("Studio/acme/.raea")).unwrap();+ std::fs::write(home.join("Studio/acme/.raea/workspace"), "").unwrap();+ assert_eq!(default_root(&home), home.join("Studio"));+ // iCloud keeping Documents: ~/raea+ let synced = scratch("home-icloud");+ std::fs::create_dir_all(synced.join("Library/Mobile Documents/com~apple~CloudDocs/Documents")).unwrap();+ assert_eq!(default_root(&synced), synced.join("raea"));+}diff --git a/apps/workspace/src/workspace.rs b/apps/workspace/src/workspace.rsindex 4cada651..91808bfc 100644--- a/apps/workspace/src/workspace.rs+++ b/apps/workspace/src/workspace.rs@@ -79,17 +79,42 @@ pub(crate) fn new_id(prefix: &str) -> String {format!("{prefix}_{:08x}", (t as u64 ^ (std::process::id() as u64) << 20) as u32)}-/// Where workspaces live on this machine: `git config --global raea.root`, else ~/Studio.+/// Where workspaces live on this machine: `git config --global raea.root`, else default_root.pub fn root() -> PathBuf {let set = config(None, &["--global", "raea.root"]).ok().filter(|s| !s.is_empty());let home = std::env::var_os("HOME").map(PathBuf::from).unwrap_or_default();match set {Some(s) if s.starts_with("~/") => home.join(&s[2..]),Some(s) => PathBuf::from(s),- None => home.join("Studio"),+ None => default_root(&home),}}+/// Where workspaces go with no raea.root set: ~/Studio where workspaces are already (the root before 11-10), else+/// ~/Documents/raea, or ~/raea when iCloud keeps the Documents folder (a workspace's git history and footage don't+/// belong in a synced folder). The feed's host says the same (raea-feed host/workspace.ts defaultRoot).+pub fn default_root(home: &Path) -> PathBuf {+ let studio = home.join("Studio");+ if holds_workspace(&studio) {+ studio+ } else if home.join("Library/Mobile Documents/com~apple~CloudDocs/Documents").is_dir() {+ home.join("raea")+ } else {+ home.join("Documents/raea")+ }+}++/// Whether a folder in `dir` is a workspace (it has .raea/workspace).+fn holds_workspace(dir: &Path) -> bool {+ let Ok(entries) = std::fs::read_dir(dir) else { return false };+ for e in entries.flatten() {+ if e.path().join(".raea/workspace").exists() {+ return true;+ }+ }+ false+}+/// The include in a repo's own config that makes `git config` read a committed file. Idempotent; the path is relative/// to the config file, which for a submodule lives under the workspace's .git/modules.pub(crate) fn include(repo: &Path, file: &Path) -> R<()> {@@ -212,7 +237,7 @@ fn make_workspace(dir: &Path, name: &str, layout: &str) -> R<()> {if !dir.join(".git").exists() && parent.exists() {let top = git(parent, &["rev-parse", "--show-toplevel"]).ok().map(PathBuf::from);if top.is_some_and(|t| t.canonicalize().ok() == parent.canonicalize().ok()) {- return Err(format!("{} would be a folder of the git repo {}: set where workspaces go, `git config --global raea.root ~/Studio`", dir.display(), parent.display()));+ return Err(format!("{} would be a folder of the git repo {}: set where workspaces go, `git config --global raea.root ~/Documents/raea`", dir.display(), parent.display()));}}std::fs::create_dir_all(dir.join("projects")).map_err(|e| format!("{}: {e}", dir.display()))?;@@ -268,7 +293,7 @@ fn register(ws: &Path, dir: &Path, rel: &str, storage: &str) -> R<String> {fn show_workspace(json_out: bool) -> R<String> {let here = std::env::current_dir().map_err(|e| e.to_string())?;- let ws = up(&here, ".raea/workspace").ok_or("not in a workspace: raea workspace init NAME makes one (under `git config --global raea.root`, else ~/Studio)")?;+ let ws = up(&here, ".raea/workspace").ok_or("not in a workspace: raea workspace init NAME makes one (under `git config --global raea.root`, else ~/Documents/raea)")?;let file = ws.join(".raea/workspace");let ps = projects(&ws);if json_out {diff --git a/docs/manual/reference/cli/context.md b/docs/manual/reference/cli/context.mdindex c7a923df..37eca973 100644--- a/docs/manual/reference/cli/context.md+++ b/docs/manual/reference/cli/context.md@@ -10,7 +10,7 @@ taste and the workspace's house rules, the project's brief and look, the floor aruns [`raea doctor`](doctor.md)'s checks too, and prints `CONTEXT_STALE` when they find something to fix first.```sh-raea context ~/Studio/acme/projects/spring-launch+raea context ~/Documents/raea/acme/projects/spring-launch```<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->diff --git a/docs/manual/reference/cli/next.md b/docs/manual/reference/cli/next.mdindex 6c24930d..51aa68ed 100644--- a/docs/manual/reference/cli/next.md+++ b/docs/manual/reference/cli/next.md@@ -11,7 +11,7 @@ or the person to pick from; nothing runs.```shraea next-raea next ~/Studio/acme/projects/spring-launch+raea next ~/Documents/raea/acme/projects/spring-launch```<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->diff --git a/docs/manual/reference/cli/workspace.md b/docs/manual/reference/cli/workspace.mdindex ddf78a56..5d73677b 100644--- a/docs/manual/reference/cli/workspace.md+++ b/docs/manual/reference/cli/workspace.md@@ -5,12 +5,12 @@ order: 23sources: ["apps/workspace/src/workspace.rs"]----A workspace is a git repository, one per studio or client, under your raea root (`~/Studio` unless+A workspace is a git repository, one per studio or client, under your raea root (`~/Documents/raea` unless`git config raea.root` says otherwise). It holds projects, controllers and the house taste in `taste.ts`. Everychange raea makes in it is a commit.```sh-raea workspace init acme # a new workspace, ~/Studio/acme+raea workspace init acme # a new workspace, ~/Documents/raea/acmeraea workspace adopt ~/clients/acme # an existing folder made a workspace in placeraea workspace --json # the current workspace, its projects and their paths```@@ -23,7 +23,7 @@ holding a `brief.ts` as a project. `raea workspace init` inside a cloned workspa## Usage```sh-raea workspace init [NAME] [--layout LAYOUT] | raea workspace adopt DIR [--name NAME] | raea workspace [--json] (a workspace: a git repo of projects and controllers under raea.root, ~/Studio unless git config says)+raea workspace init [NAME] [--layout LAYOUT] | raea workspace adopt DIR [--name NAME] | raea workspace [--json] (a workspace: a git repo of projects and controllers under raea.root, ~/Documents/raea unless git config says)```Headless: it needs nothing running and opens no window. Takes up to 2 arguments besides its flags.diff --git a/engine/cli/src/cli.rs b/engine/cli/src/cli.rsindex 544e1733..151999f9 100644--- a/engine/cli/src/cli.rs+++ b/engine/cli/src/cli.rs@@ -129,7 +129,7 @@ pub fn run(args: &[String]) -> R<String> {let usage = format!("{usage}\n raea library [new NAME [--cloud] | add LIBRARY PATH | files LIBRARY | tag SHA TAGS | status | scan ...] | raea library search \"WORDS\" [--library LIBRARY] [--kind KIND] [--limit N] [--sound] (the person's libraries in the raea app: folders and drives indexed on this machine, searched by meaning; a folder an agent adds waits for the person's yes)");let usage = format!("{usage}\n raea show FILE... [--title T] [--ask LINE] [--project P] [--replaces ITEM] [--as NAME] [--role ROLE] [--inbox NAME] [--open] | raea show --question Q --choice A --choice B [STILL...] | raea show [--title T] --question Q [--preview FILE] --choice A [--preview FILE] --choice B ... [--question Q2] ... | raea show --on ITEM [--working ID] [--done ID] [--note LINE] [--sub NAME] (shown in the raea app as an item the person can use and answer, posted quietly with a notice, the window left where they are unless --open: stills (several, a storyboard), a video, a sound, a NAME.script.ts or .md, a .tsx (an interactive artifact; a project's composition opens in its editor), or questions, all of them one item, each question and choice with a --preview to play or read while answering (a still, a video, a sound, a script or .md; after a --choice that choice's, else the question's); what they send comes to ~/.raea/inbox/INBOX.jsonl; their edit comments are tasks: --working ID as you start one, --done ID when it's settled, or with the version that settles it, FILE --replaces ITEM --done ID; never open media in Preview while the app is installed)");// a workspace's files and specs (docs/projects.feature), listed under render's usage like library- let usage = format!("{usage}\n raea spec FILE.ts [--as brief|script|taste|plan|controller] (a spec's default export as JSON, checked against its schema: brief.ts, script.ts, taste.ts, plan.ts, controllers/ID.ts)\n raea workspace init [NAME] [--layout LAYOUT] | raea workspace adopt DIR [--name NAME] | raea workspace [--json] (a workspace: a git repo of projects and controllers under raea.root, ~/Studio unless git config says)\n raea project new NAME [--storage inline|submodule] | raea project split NAME [--remote URL] | raea project join NAME | raea project [--json] (a project in the workspace: its folder, brief.ts, media/, out/; split and join keep its history)\n raea controller ls [--json] | raea controller get PATH [--json] | raea controller set PATH VALUE [--project] [--by NAME] | raea controller write FILE.ts [--by NAME] | raea controller rm ID [--by NAME] (the workspace's controllers, controllers/ID.ts; PATH is controller.group.field; every change a commit)\n raea check EDIT.tsx --quick [--shape S] [--platform P] [--taste T] [-o check.json] (three stills of a composition checked for text: clipped, cramped, safe areas, sizes; about a second)\n raea hook [claude|codex|gemini|kimi] (every agent's tool hooks, which raea skills install adds: before a shell command, media opened in the Mac's viewer while the raea app is installed is stopped once for raea show (the same command again goes through); after a save, the quick check on a composition)\n raea next [DIR] (the two or three useful next steps for the project, from its brief, compositions, renders and checks)\n raea doctor [--fix] [DIR] (what doesn't match this raea: old brief files, an older workspace format, an agent's skill from another version)\n raea app run|check|bundle APP.tsx [--target web|native] [--size WxH] [--script steps.json] [--png DIR] [-o App.app] (a TSX app on @raea/ui: its window, the headless check, a Mac app; web is Blitz on Bevy, native is Rune; the app's `export const app` sets the target, web when it doesn't; raea rune ... is --target native)\n {}\n {}", skill::USAGE, tools::blender::USAGE);+ let usage = format!("{usage}\n raea spec FILE.ts [--as brief|script|taste|plan|controller] (a spec's default export as JSON, checked against its schema: brief.ts, script.ts, taste.ts, plan.ts, controllers/ID.ts)\n raea workspace init [NAME] [--layout LAYOUT] | raea workspace adopt DIR [--name NAME] | raea workspace [--json] (a workspace: a git repo of projects and controllers under raea.root, ~/Documents/raea unless git config says)\n raea project new NAME [--storage inline|submodule] | raea project split NAME [--remote URL] | raea project join NAME | raea project [--json] (a project in the workspace: its folder, brief.ts, media/, out/; split and join keep its history)\n raea controller ls [--json] | raea controller get PATH [--json] | raea controller set PATH VALUE [--project] [--by NAME] | raea controller write FILE.ts [--by NAME] | raea controller rm ID [--by NAME] (the workspace's controllers, controllers/ID.ts; PATH is controller.group.field; every change a commit)\n raea check EDIT.tsx --quick [--shape S] [--platform P] [--taste T] [-o check.json] (three stills of a composition checked for text: clipped, cramped, safe areas, sizes; about a second)\n raea hook [claude|codex|gemini|kimi] (every agent's tool hooks, which raea skills install adds: before a shell command, media opened in the Mac's viewer while the raea app is installed is stopped once for raea show (the same command again goes through); after a save, the quick check on a composition)\n raea next [DIR] (the two or three useful next steps for the project, from its brief, compositions, renders and checks)\n raea doctor [--fix] [DIR] (what doesn't match this raea: old brief files, an older workspace format, an agent's skill from another version)\n raea app run|check|bundle APP.tsx [--target web|native] [--size WxH] [--script steps.json] [--png DIR] [-o App.app] (a TSX app on @raea/ui: its window, the headless check, a Mac app; web is Blitz on Bevy, native is Rune; the app's `export const app` sets the target, web when it doesn't; raea rune ... is --target native)\n {}\n {}", skill::USAGE, tools::blender::USAGE);let (export_game, scene, physics, splat) = (raea_app_game::USAGE, export::SCENE_USAGE, motion::physics::USAGE, tools::splat::USAGE);let apps = format!(" {}\n {}\n {}\n {}\n", raea_app_check::USAGE, raea_app_solid::USAGE, raea_app_judge::USAGE, raea_app_direction::USAGE);return Ok(format!("raea: renders, plays and checks raea compositions (React and TypeScript) on the GPU.\n\nusage: {usage}\n raea init (a project's files where they're missing: edit.tsx, cuts.ts, components/, AGENTS.md)\n raea cut TAKE \"line\" ... | --at A-B ... [--append] (cuts.ts and words.json: a take under media/ cut in the pauses around each line it says, transcribed first if it has no TAKE.words.json; or at those seconds)\n raea frame TAKE [--at S] (how a take fits the edit: a talking take for <FaceFrame>, a screen for <ScreenFit>, from where its face is)\n raea part list | raea part add NAME ... [--force] (a ready part copied into components/, yours to change)\n raea brand DOMAIN|URL (the brand kit read from its website on this machine: brand/brand.css, brand/brand.json, BRAND.md, logos in media/brand; says when a plain fetch saw too little)\n raea guide [NAME] (craft, the floor read before any edit; the modes: pitch, explain, story, play, tool; motion, music, layout and the rest; bevy and bevy/NAME for 3D)\n raea context PROJECT (what to read before working on a project: taste, brief, look, the floor and its modes' guides)\n{apps} raea play EDIT.tsx [--input | --input-script KEYS.json] [--size WxH] [--seconds N|end] (a game, live; also: --input-log FILE --offscreen --snapshot T FILE --json FILE --seek F FILE --pick X,Y --view YAW,PITCH,DISTANCE --scrub N --baked --autoplay --no-vsync --master --3d)\n {export_game} (a game as a program of its own: a Mac app or a command)\n {scene} (what each 3D part rests on: floating, sunk and clipping parts; light: the scene's lighting)\n {physics} (the bakes <Physics> and <Goo> make)\n {splat} (footage trained into a Gaussian splat for <Splat>; setup installs its tools)\n raea run SCRIPT.ts (a TypeScript program on the engine, headless: its default export is called, what it prints is the answer; a check like a room's checkLayout; also: --timeout S)\n raea gen image|video|music|sfx|speech|mesh|text \"PROMPT\" | gen plan|run FLOW.ts|FLOW.json | gen comfy import|export|run|schema FILE | gen models | gen balance (generated media through made.app, fal, Replicate, OpenRouter, Modal or ComfyUI; ComfyUI workflows both ways: raea gen alone lists its flags)\n {neural_usage} (DLSS 5 neural rendering on a `render --aov` folder, with its motion and depth: your own MLX-DLSS build and weights, RAEA_MLXDLSS and RAEA_DLSS_MODEL)\n raea mezz [--check] PATH... (an intra-only ProRes copy of each long-GOP source over 1080p, for smooth scrubbing; --check says which would get one)\n raea traces [show [N|last|DIR]] (the sessions raea left, newest first: how each ended, its glitches; show tells one in full)"));