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
//! What an agent writes for raea, as Rust types: a project's brief, a script (storyboard or screenplay), a person's
//! taste and an object's parts. The agent writes them as TypeScript modules (docs/handoff/authoring.md); `raea run`
//! evaluates one, and its default export arrives here as JSON. The TypeScript declarations are generated from these
//! types (`declarations`), so what tsc checks is exactly what this crate reads.
pub mod brief;
pub mod cut;
pub mod goal;
pub mod make;
pub mod parts;
pub mod script;
pub mod taste;
pub use brief::Brief;
pub use make::Make;
pub use parts::Parts;
pub use script::Script;
pub use taste::Taste;
use serde::de::DeserializeOwned;
use ts_rs::{Config, TS};
/// Reads one of the schemas from the JSON a module's default export evaluated to. The error names the field and
/// what was wrong with it (an unknown field is an error too, so a misspelt `belive` isn't silently dropped).
pub fn read<T: DeserializeOwned>(what: &str, json: &str) -> Result<T, String> {
serde_json::from_str(json).map_err(|e| format!("{what}: {e}"))
}
macro_rules! decls {
($cfg:ident; $($t:ty),* $(,)?) => { vec![$(format!("export {}", <$t as TS>::decl(&$cfg))),*] };
}
/// The TypeScript declarations of every schema, one file's worth: sdk/raea/src/brief.gen.ts is this, checked by a test, and
/// `raea/brief` (sdk/raea/src/brief.ts) types its builders with it, so the declarations ship with the SDK.
pub fn declarations() -> String {
let cfg = Config::new();
let mut out = vec!["// Generated from raea-core-brief (core/brief) by its `declarations`; edit the Rust, not this.".to_string()];
out.extend(decls!(cfg;
brief::Brief, brief::Section, brief::Deliverable, brief::Reference, brief::Agent,
script::Script, script::Scene, script::Beat, script::Line,
taste::Taste, taste::TasteSection, taste::Rule, taste::RuleCheck, taste::RuleLevel, taste::Check,
parts::Parts, parts::Concept, parts::Level, parts::Count, parts::Part,
make::Make, make::Kind, make::Source, make::DialValue, make::Dial, make::Route, make::Origin, make::Pick, make::Object, make::Shot,
cut::Cut, cut::Quoted<u32>, cut::CutPlan, cut::Phrase, cut::Cta, cut::Open,
goal::Goal, goal::GoalRule,
));
out.join("\n\n") + "\n"
}
#[cfg(test)]
mod tests;