Skip to content

armgit / raea

Public Imported from GitHub
0

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.

apps/engines: Blender's TypeScript runner and Godot in a crate of their own, so apps/tools and engine/cli stay under the 2,000-line crate limit (tools/size.sh)

shinyobjectz4dc3083c6e0e
diff --git a/Cargo.lock b/Cargo.lock
index 967fd428..83a43f9d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -13633,6 +13633,20 @@ dependencies = [
"serde_json",
]
+[[package]]
+name = "raea-app-engines"
+version = "0.1.0"
+dependencies = [
+ "dunce",
+ "raea-app-tools",
+ "raea-io-home",
+ "raea-runtime-bundle",
+ "raea-runtime-calls",
+ "raea-runtime-export",
+ "serde_json",
+ "zip",
+]
+
[[package]]
name = "raea-app-game"
version = "0.1.0"
@@ -13754,7 +13768,6 @@ dependencies = [
name = "raea-app-tools"
version = "0.1.0"
dependencies = [
- "dunce",
"raea-io-assets",
"raea-io-gen",
"raea-io-home",
@@ -13762,7 +13775,6 @@ dependencies = [
"raea-runtime-bundle",
"raea-runtime-export",
"serde_json",
- "zip",
]
[[package]]
@@ -13989,6 +14001,7 @@ dependencies = [
"raea-app-check",
"raea-app-ci",
"raea-app-direction",
+ "raea-app-engines",
"raea-app-game",
"raea-app-judge",
"raea-app-media",
diff --git a/Cargo.toml b/Cargo.toml
index 01d375c4..7bde0598 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -160,6 +160,7 @@ members = [
"apps/workspace/registry",
"apps/ci",
"apps/tools",
+ "apps/engines",
"apps/judge",
"apps/solid",
"apps/media",
diff --git a/apps/engines/Cargo.toml b/apps/engines/Cargo.toml
new file mode 100644
index 00000000..34948897
--- /dev/null
+++ b/apps/engines/Cargo.toml
@@ -0,0 +1,20 @@
+[package]
+name = "raea-app-engines"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "The `raea` verbs that script other engines from TypeScript: Blender (`setup blender`, `blender run`) and Godot with GodotJS (`setup godot`, `godot run|types|open`)"
+
+[dependencies]
+# Blender found or downloaded, its scripts in Python, and the helpers Godot's setup shares (apps/tools/src/blender.rs)
+raea-app-tools = { path = "../tools" }
+raea-io-home = { path = "../../io/home" }
+# a TypeScript script bundled and run on raea's engine, posting raea/blender's batches to the bridge (blender.post)
+raea-runtime-bundle = { path = "../../runtime/bundle" }
+raea-runtime-export = { path = "../../runtime/export" }
+raea-runtime-calls = { path = "../../runtime/calls" }
+serde_json = "1"
+# Godot with GodotJS, unpacked from its release zip (`raea setup godot`), and the script path the bundler imports
+zip = { version = "9", default-features = false, features = ["deflate-flate2"] }
+dunce = "1"
diff --git a/apps/tools/src/blender_bridge.rs b/apps/engines/src/blender_bridge.rs
similarity index 100%
rename from apps/tools/src/blender_bridge.rs
rename to apps/engines/src/blender_bridge.rs
diff --git a/apps/engines/src/blender_ts.rs b/apps/engines/src/blender_ts.rs
new file mode 100644
index 00000000..a5e496d0
--- /dev/null
+++ b/apps/engines/src/blender_ts.rs
@@ -0,0 +1,40 @@
+//! `raea blender run SCRIPT.ts [FILE.blend] [ARGS...]`: a headless Blender with raea's bridge (FILE.blend opened, ARGS
+//! its sys.argv after --), the script on raea's engine with each batch posted to it (blender.post), Blender quit after.
+
+use std::path::PathBuf;
+
+use raea_runtime_calls::blender::{BRIDGE, post};
+use serde_json::json;
+
+use crate::{R, blender_bridge};
+
+/// What the script's entry does after it: its default export called and awaited, then the session closed
+/// (sdk/blender/src/blender.ts's __raea_blender_end), so a failure in Blender the script never awaited fails the run,
+/// as an uncaught Python exception would.
+const END: &str = "Promise.resolve().then(() => (typeof (M as any).default === \"function\" ? (M as any).default() : undefined)).then(() => (globalThis as any).__raea_blender_end?.()).then(() => call(\"done\", JSON.stringify({ code: 0 })), (e: any) => { call(\"print\", JSON.stringify({ text: \"error: \" + String(e) + (e && e.name === \"BlenderError\" ? (e.pythonTrace ? \"\\n\" + e.pythonTrace : \"\") : e && e.stack ? \"\\n\" + e.stack : \"\") })); call(\"done\", JSON.stringify({ code: 1 })); });";
+
+pub fn run(args: &[String]) -> R<String> {
+ let ts = PathBuf::from(&args[2]).canonicalize().map_err(|e| format!("{}: {e}", args[2]))?;
+ let (bin, _) = raea_app_tools::blender::find().ok_or("no Blender: raea setup blender finds or downloads one")?;
+ let file = args.get(3).filter(|a| a.ends_with(".blend")).map(PathBuf::from);
+ // ARGS for Blender's sys.argv, without raea's own --timeout SECS
+ let mut rest = args[if file.is_some() { 4 } else { 3 }..].to_vec();
+ let mut secs = 3600.0;
+ if let Some(i) = rest.iter().position(|a| a == "--timeout") {
+ secs = rest.get(i + 1).and_then(|t| t.parse().ok()).unwrap_or(secs);
+ rest.drain(i..(i + 2).min(rest.len()));
+ }
+ let bridge = blender_bridge::start(&bin, file.as_deref(), &rest)?;
+ *BRIDGE.lock().map_err(|e| e.to_string())? = Some((bridge.port, bridge.token.clone()));
+ let out = std::env::temp_dir().join(format!("raea-blender-{}.js", std::process::id()));
+ let ran = raea_runtime_bundle::bundle_module(&ts, &out, END).and_then(|_| raea_runtime_export::run_bundle(&out, secs));
+ let _ = std::fs::remove_file(&out);
+ let _ = post(&json!({ "sid": "raea", "ops": [{ "o": "quit" }] }));
+ *BRIDGE.lock().map_err(|e| e.to_string())? = None;
+ bridge.wait();
+ let (code, _) = ran?;
+ if code != 0 {
+ return Err(format!("{} ended with exit {code}", args[2]));
+ }
+ Ok(String::new())
+}
diff --git a/apps/tools/src/godot.rs b/apps/engines/src/godot.rs
similarity index 96%
rename from apps/tools/src/godot.rs
rename to apps/engines/src/godot.rs
index 7d84bcca..afd15532 100644
--- a/apps/tools/src/godot.rs
+++ b/apps/engines/src/godot.rs
@@ -34,7 +34,7 @@ fn pin() -> R<Pin> {
/// Where raea keeps the Godot it downloads.
fn own_dir() -> R<PathBuf> {
- Ok(crate::agent_mcp::user_home()?.join(".raea/tools/godot"))
+ Ok(raea_app_tools::agent_mcp::user_home()?.join(".raea/tools/godot"))
}
/// The release a download in own_dir came from (raea.json beside it), so a moved pin downloads again.
@@ -46,7 +46,7 @@ fn own_release() -> Option<String> {
/// The Godot to use and where it came from: `git config --global raea.godot` (a GodotJS build of your own), else
/// raea's download. A Godot without GodotJS isn't looked for: it can't run raea/godot's scripts.
pub fn find() -> Option<(PathBuf, &'static str)> {
- let configured = crate::blender::run(Command::new("git").args(["config", "--global", "raea.godot"]), "git config").ok().map(|out| PathBuf::from(out.trim()));
+ let configured = raea_app_tools::blender::run(Command::new("git").args(["config", "--global", "raea.godot"]), "git config").ok().map(|out| PathBuf::from(out.trim()));
if let Some(p) = configured.filter(|p| p.is_file()) {
return Some((p, "raea.godot in git config"));
}
@@ -75,9 +75,9 @@ fn download() -> R<(PathBuf, String)> {
std::fs::create_dir_all(&tmp).map_err(|e| format!("{}: {e}", tmp.display()))?;
let file = tmp.join(p.asset);
let url = format!("https://github.com/godotjs/GodotJS/releases/download/{RELEASE}/{}", p.asset);
- crate::blender::run(Command::new("curl").args(["-fL", "--retry", "3", "-o"]).arg(&file).arg(&url), "downloading Godot with GodotJS")?;
+ raea_app_tools::blender::run(Command::new("curl").args(["-fL", "--retry", "3", "-o"]).arg(&file).arg(&url), "downloading Godot with GodotJS")?;
let size = std::fs::metadata(&file).map_err(|e| e.to_string())?.len();
- if size != p.size || crate::blender::sha256(&file)? != p.sha256 {
+ if size != p.size || raea_app_tools::blender::sha256(&file)? != p.sha256 {
return Err(format!("{} doesn't match the sha256 raea pins ({size} bytes); nothing installed (it's in {})", p.asset, tmp.display()));
}
let unpacked = tmp.join("unpacked");
diff --git a/apps/tools/src/godot_run.rs b/apps/engines/src/godot_run.rs
similarity index 100%
rename from apps/tools/src/godot_run.rs
rename to apps/engines/src/godot_run.rs
diff --git a/apps/engines/src/lib.rs b/apps/engines/src/lib.rs
new file mode 100644
index 00000000..66e3801b
--- /dev/null
+++ b/apps/engines/src/lib.rs
@@ -0,0 +1,47 @@
+//! The verbs that script other engines from TypeScript: Blender (`raea setup blender`, `raea blender run SCRIPT.py|.ts`;
+//! finding and setting Blender up is apps/tools/src/blender.rs) and Godot with GodotJS (`raea setup godot`,
+//! `raea godot run|types|open`; sdk/blender and sdk/godot are their TypeScript sides).
+
+/// the Blender a TypeScript script drives (`raea blender run SCRIPT.ts`, sdk/blender)
+pub mod blender_bridge;
+/// `raea blender run SCRIPT.ts`: the script on raea's engine, its batches posted to the bridge's Blender
+pub mod blender_ts;
+/// `raea setup godot`, `raea godot types` and `raea godot open`: Godot with GodotJS (sdk/godot)
+pub mod godot;
+/// `raea godot run SCRIPT.ts`: a TypeScript script in Godot through GodotJS
+pub mod godot_run;
+
+use raea_app_tools::blender;
+
+type R<T> = Result<T, String>;
+
+/// The CLI's verbs here, or None for any other: `setup blender|godot`, `blender ...` and `godot ...`.
+pub fn cli(args: &[String]) -> Option<R<String>> {
+ let second = args.get(1).map(String::as_str);
+ Some(match (args.first()?.as_str(), second) {
+ ("setup", Some("blender")) => blender::setup(&args[2..]),
+ ("setup", Some("godot")) => godot::setup(&args[2..]),
+ ("blender", Some("run")) if args.get(2).is_some_and(|s| blender_bridge::is_ts(s)) => blender_ts::run(args),
+ ("blender", _) => blender::blender(args),
+ ("godot", _) => godot::godot(args),
+ _ => return None,
+ })
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn args(s: &str) -> Vec<String> {
+ s.split_whitespace().map(str::to_string).collect()
+ }
+
+ // other verbs pass through untouched, and a bare `godot` or `blender` gets its usage, not a run
+ #[test]
+ fn takes_only_its_verbs() {
+ assert!(cli(&args("setup audio")).is_none());
+ assert!(cli(&args("render edit.tsx")).is_none());
+ assert!(cli(&[]).is_none());
+ assert!(cli(&args("godot")).unwrap().unwrap_err().contains(godot::USAGE));
+ }
+}
diff --git a/apps/tools/Cargo.toml b/apps/tools/Cargo.toml
index 2f667b08..9b998b3b 100644
--- a/apps/tools/Cargo.toml
+++ b/apps/tools/Cargo.toml
@@ -16,6 +16,3 @@ serde_json = "1"
# the verbs' flags read as a render reads its own
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-runtime-export = { path = "../../runtime/export" }
-# Godot with GodotJS, unpacked from its release zip (`raea setup godot`), and the script path the bundler imports
-zip = { version = "9", default-features = false, features = ["deflate-flate2"] }
-dunce = "1"
diff --git a/apps/tools/src/blender.rs b/apps/tools/src/blender.rs
index c5c04261..5f3ce237 100644
--- a/apps/tools/src/blender.rs
+++ b/apps/tools/src/blender.rs
@@ -54,7 +54,7 @@ fn version(bin: &Path) -> R<String> {
String::from_utf8_lossy(&o.stdout).lines().find(|l| l.starts_with("Blender ")).map(str::to_string).ok_or_else(|| format!("{} --version printed no version", bin.display()))
}
-pub(crate) fn run(cmd: &mut Command, what: &str) -> R<String> {
+pub fn run(cmd: &mut Command, what: &str) -> R<String> {
let o = cmd.output().map_err(|e| format!("{what}: {e}"))?;
if !o.status.success() {
return Err(format!("{what} failed: {}{}", String::from_utf8_lossy(&o.stderr).trim(), String::from_utf8_lossy(&o.stdout).trim()));
@@ -89,7 +89,7 @@ fn newest(listing: &str) -> Option<String> {
best.map(|(_, v)| v)
}
-pub(crate) fn sha256(file: &Path) -> R<String> {
+pub fn sha256(file: &Path) -> R<String> {
let out = if cfg!(windows) {
run(Command::new("certutil").arg("-hashfile").arg(file).arg("SHA256"), "certutil")?.lines().nth(1).unwrap_or_default().replace(' ', "")
} else {
diff --git a/apps/tools/src/lib.rs b/apps/tools/src/lib.rs
index 855268ba..537142d0 100644
--- a/apps/tools/src/lib.rs
+++ b/apps/tools/src/lib.rs
@@ -13,9 +13,3 @@ pub mod agent_mcp;
pub mod agent_hooks;
/// `raea setup blender` and `raea blender run`
pub mod blender;
-/// the Blender a TypeScript script drives (`raea blender run SCRIPT.ts`, sdk/blender)
-pub mod blender_bridge;
-/// `raea setup godot`, `raea godot types` and `raea godot open`: Godot with GodotJS (sdk/godot)
-pub mod godot;
-/// `raea godot run SCRIPT.ts`: a TypeScript script in Godot through GodotJS
-pub mod godot_run;
diff --git a/docs/godot.feature b/docs/godot.feature
index 6419615d..b8f00b39 100644
--- a/docs/godot.feature
+++ b/docs/godot.feature
@@ -9,7 +9,7 @@ Feature: Godot from TypeScript: raea/godot (sdk/godot) on GodotJS
Background:
Given GodotJS release v1.1.0.beta1-4.6.1 (Godot 4.6.1), its editor builds pinned by size and sha256 in
- apps/tools/src/godot.rs, the typings generated from that build by sdk/godot/tools/gen.sh
+ apps/engines/src/godot.rs, the typings generated from that build by sdk/godot/tools/gen.sh
And until raea builds GodotJS from its vendored source, `raea setup godot` downloads GodotJS's own release builds
Rule: Godot is installed by raea, pinned
diff --git a/engine/cli/Cargo.toml b/engine/cli/Cargo.toml
index daf35517..4f303e40 100644
--- a/engine/cli/Cargo.toml
+++ b/engine/cli/Cargo.toml
@@ -56,6 +56,7 @@ raea-app-notes = { path = "../../apps/notes" }
raea-app-sound = { path = "../../apps/sound" }
raea-app-ci = { path = "../../apps/ci" }
raea-app-tools = { path = "../../apps/tools" }
+raea-app-engines = { path = "../../apps/engines" }
# raea solid info|view: a solid file measured and pictured
raea-app-solid = { path = "../../apps/solid" }
# raea judge: review sheets judged by clef-omni
diff --git a/engine/cli/src/cli.rs b/engine/cli/src/cli.rs
index e84b5db4..99a1e349 100644
--- a/engine/cli/src/cli.rs
+++ b/engine/cli/src/cli.rs
@@ -120,38 +120,6 @@ pub fn run_script(args: &[String]) -> R<i32> {
Ok(code)
}
-/// What `raea blender run SCRIPT.ts`'s entry does after the script: its default export called and awaited, then the
-/// session closed (src/blender.ts's __raea_blender_end), so a failure in Blender the script never awaited fails the
-/// run, as an uncaught Python exception would.
-const BLENDER_END: &str = "Promise.resolve().then(() => (typeof (M as any).default === \"function\" ? (M as any).default() : undefined)).then(() => (globalThis as any).__raea_blender_end?.()).then(() => call(\"done\", JSON.stringify({ code: 0 })), (e: any) => { call(\"print\", JSON.stringify({ text: \"error: \" + String(e) + (e && e.name === \"BlenderError\" ? (e.pythonTrace ? \"\\n\" + e.pythonTrace : \"\") : e && e.stack ? \"\\n\" + e.stack : \"\") })); call(\"done\", JSON.stringify({ code: 1 })); });";
-
-/// `raea blender run SCRIPT.ts [FILE.blend] [ARGS...]`: a headless Blender with raea's bridge (FILE.blend opened, ARGS
-/// its sys.argv after --), the script on raea's engine with each batch posted to it (blender.post), Blender quit after.
-fn blender_ts(args: &[String]) -> R<String> {
- let ts = PathBuf::from(&args[2]).canonicalize().map_err(|e| format!("{}: {e}", args[2]))?;
- let (bin, _) = tools::blender::find().ok_or("no Blender: raea setup blender finds or downloads one")?;
- let file = args.get(3).filter(|a| a.ends_with(".blend")).map(PathBuf::from);
- // ARGS for Blender's sys.argv, without raea's own --timeout SECS
- let mut rest = args[if file.is_some() { 4 } else { 3 }..].to_vec();
- if let Some(i) = rest.iter().position(|a| a == "--timeout") {
- rest.drain(i..(i + 2).min(rest.len()));
- }
- let bridge = tools::blender_bridge::start(&bin, file.as_deref(), &rest)?;
- *raea_runtime_react::native::blender::BRIDGE.lock().map_err(|e| e.to_string())? = Some((bridge.port, bridge.token.clone()));
- let out = std::env::temp_dir().join(format!("raea-blender-{}.js", std::process::id()));
- let secs: f64 = flag(args, "--timeout").and_then(|t| t.parse().ok()).unwrap_or(3600.0);
- let ran = bundle_module(&ts, &out, BLENDER_END).and_then(|_| run_bundle(&out, secs));
- let _ = std::fs::remove_file(&out);
- let _ = raea_runtime_react::native::blender::post(&json!({ "sid": "raea", "ops": [{ "o": "quit" }] }));
- *raea_runtime_react::native::blender::BRIDGE.lock().map_err(|e| e.to_string())? = None;
- bridge.wait();
- let (code, _) = ran?;
- if code != 0 {
- return Err(format!("{} ended with exit {code}", args[2]));
- }
- Ok(String::new())
-}
-
pub fn run(args: &[String]) -> R<String> {
// no arguments, or asking for help: the usage, plainly (the render line's refusal is for a render missing its file)
// `help --json`: the same help, each verb's usage, flags and access tag (tools/skills.sh gen reads it)
@@ -167,7 +135,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] [--ask TEXT] [--status S] [--states S1,S2] [--sign N --clip FILE --render HASH] [--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 (each --ask with it one ask you read it as, for the person to correct; --status and --states where the note and each ask stand: to restate, to check, failing, to sign, passing, signed; --sign N --clip FILE --render HASH a clip under ask N for them to sign; a note closes when they retire it, never with --done), --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, ~/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 {}\n {}", skill::USAGE, tools::blender::USAGE, tools::godot::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 {}\n {}", skill::USAGE, tools::blender::USAGE, raea_app_engines::godot::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 {}\n {}\n {}\n", raea_app_direction::check::USAGE, raea_app_check::USAGE, raea_app_solid::USAGE, raea_app_judge::USAGE, raea_app_direction::USAGE, raea_app_direction::findings::USAGE, raea_app_notes::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)"));
@@ -216,22 +184,9 @@ pub fn run(args: &[String]) -> R<String> {
if args[0] == "doctor" {
return skill::doctor(&args[1..]);
}
- // `setup blender` and `blender run SCRIPT.py`: Blender found or downloaded, its MCP add-on, headless scripts (SK11)
- if args[0] == "setup" && args.get(1).map(String::as_str) == Some("blender") {
- return tools::blender::setup(&args[2..]);
- }
- if args[0] == "blender" {
- if args.get(1).map(String::as_str) == Some("run") && args.get(2).is_some_and(|s| tools::blender_bridge::is_ts(s)) {
- return blender_ts(args);
- }
- return tools::blender::blender(args);
- }
- // `setup godot` and `godot run|types|open`: Godot with GodotJS, TypeScript scripts in it (sdk/godot)
- if args[0] == "setup" && args.get(1).map(String::as_str) == Some("godot") {
- return tools::godot::setup(&args[2..]);
- }
- if args[0] == "godot" {
- return tools::godot::godot(args);
+ // `setup blender|godot`, `blender ...` and `godot ...`: Blender and Godot scripted (SK11, apps/engines)
+ if let Some(done) = raea_app_engines::cli(args) {
+ return done;
}
// `spec FILE.ts`: a spec's data as JSON, for a program that reads specs without evaluating TypeScript (the feed's host)
if args[0] == "spec" {
diff --git a/runtime/calls/src/blender.rs b/runtime/calls/src/blender.rs
index fc18bdc6..7f392878 100644
--- a/runtime/calls/src/blender.rs
+++ b/runtime/calls/src/blender.rs
@@ -1,5 +1,5 @@
//! `blender.post {sid, ops}`: a batch of raea/blender's operations (sdk/blender) posted to the Blender bridge that
-//! `raea blender run SCRIPT.ts` started (apps/tools/src/blender_bridge.rs), and its reply: the results the script
+//! `raea blender run SCRIPT.ts` started (apps/engines/src/blender_bridge.rs), and its reply: the results the script
//! asked for and the batch's first error. On the JS thread, so the script waits for Blender as Python would.
use std::io::{Read, Write};
diff --git a/sdk/godot/README.md b/sdk/godot/README.md
index d89a828e..df7f9578 100644
--- a/sdk/godot/README.md
+++ b/sdk/godot/README.md
@@ -54,4 +54,4 @@ Things to know:
- `src/host/main.js`: the main loop `raea godot run` gives Godot.
- `test/typing.ts` (tsc), `test/run.test.ts` (bun test, against the installed Godot).
-The spec is `docs/godot.feature`; the pin and the verbs are `apps/tools/src/godot.rs` and `godot_run.rs`.
+The spec is `docs/godot.feature`; the pin and the verbs are `apps/engines/src/godot.rs` and `godot_run.rs`.
diff --git a/sdk/godot/tools/gen.sh b/sdk/godot/tools/gen.sh
index ac5cc3fb..8241b427 100755
--- a/sdk/godot/tools/gen.sh
+++ b/sdk/godot/tools/gen.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# sdk/godot's generated files, from the GodotJS editor raea setup godot installs (apps/tools/src/godot.rs pins it):
+# sdk/godot's generated files, from the GodotJS editor raea setup godot installs (apps/engines/src/godot.rs pins it):
# src/types/*.d.ts Godot's whole API as TypeScript, as GodotJS's codegen writes it (--generate-types, headless,
# on an empty project), and src/types/index.d.ts, which references each
# src/shim/names.gen.js the "godot" module's names, which the bundles' shim answers (tools/names.ts says why)
diff --git a/tools/layers.toml b/tools/layers.toml
index b49b6b93..4016028a 100644
--- a/tools/layers.toml
+++ b/tools/layers.toml
@@ -146,6 +146,7 @@ raea-app-notes = "apps"
raea-app-sound = "apps"
raea-app-ci = "apps"
raea-app-tools = "apps"
+raea-app-engines = "apps"
raea-app-judge = "apps"
raea-app-solid = "apps"
raea-app-media = "apps"
diff --git a/tools/skills.sh b/tools/skills.sh
index d612026f..6727ba56 100755
--- a/tools/skills.sh
+++ b/tools/skills.sh
@@ -252,7 +252,7 @@ help_stale() {
built=$(stat -f %m "$R" 2>/dev/null || stat -c %Y "$R")
# the history is the binary's own checkout's (an L0 export has none)
local co; co=$(cd "$(dirname "$(realpath "$R")")/../.." 2>/dev/null && pwd); [ -f "$co/engine/cli/src/cli.rs" ] || co=$ROOT
- newest=$(git -C "$co" log -1 --no-merges --format=%at -- engine/cli/src apps/check/src apps/game/src apps/tools/src runtime/react/src/scene.rs runtime/react/src/scene 2>/dev/null)
+ newest=$(git -C "$co" log -1 --no-merges --format=%at -- engine/cli/src apps/check/src apps/game/src apps/tools/src apps/engines/src runtime/react/src/scene.rs runtime/react/src/scene 2>/dev/null)
[ -n "$newest" ] && [ "$built" -lt "$newest" ]
}