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
SK13: Grok Bot as a raea skills install target. Grok Bot (xAI's desktop agent, /Applications/Grok Bot.app 1.1.0) keeps its skills and MCP servers on a computer of its own in the cloud and has no hooks, CLI or ACP; what reaches this Mac is its Execution on this computer. So raea skills install --agent grokbot stages raea's skill in ~/.raea/grokbot/skills (RAEA_GROKBOT_HOME), stamped, with a preface after the front matter saying raea runs on the person's Mac and how to run it there, and prints Grok Bot's own links that finish it: grokbot://app/v1/settings?id=local-execution and a prompt link, filled in but not sent, asking the Bot to make the skill from the staged file (or Skills, Add new skill, Upload file). No MCP server: Grok Bot would run its command on its own computer. apps/tools agent_grokbot.rs holds the folder, the preface, the links (encoded as Grok Bot encodes its own, within its 1000 and 2048 character limits) and the closing text; engine/cli skill.rs adds the agent and splits install_into for a test. Not built here: cargo test -p raea-app-tools agent_grokbot and the engine/cli skill tests need the integrator's lane build.
shinyobjectzc939b27aeeea
diff --git a/apps/tools/src/agent_grokbot.rs b/apps/tools/src/agent_grokbot.rsnew file mode 100644index 00000000..808f22ee--- /dev/null+++ b/apps/tools/src/agent_grokbot.rs@@ -0,0 +1,116 @@+//! Grok Bot (xAI's desktop agent, made by Anysphere: /Applications/Grok Bot.app, bundle com.anysphere.sand) as a+//! `raea skills install --agent grokbot` target (docs/skills.feature SK13). Read from its app.asar, 1.1.0 (11-14):+//! Grok Bot keeps nothing on this Mac that raea could write. Its agent runs on a computer of its own in the cloud (its+//! "box"), its skills are held there, and its MCP servers belong to the person's account (Settings → Integrations →+//! Add a custom connector), a server's command running on that computer, not here. It has no hooks, no CLI and no ACP.+//! What does reach this Mac is its Execution on this computer: the Bot runs a command here, through its local daemon.+//! So raea stages its skill in a folder of its own, stamped and with a preface saying where raea runs, and gives the+//! grokbot:// links that finish it in Grok Bot: the Execution setting, and a message to the Bot, filled in but not+//! sent, asking it to make the skill from the staged file ("Ask your Bot to create one", as Grok Bot itself says).+use std::path::{Path, PathBuf};++type R<T> = Result<T, String>;++/// The folder raea stages Grok Bot's copy in: $RAEA_GROKBOT_HOME, else grokbot in raea's own folder in the home.+pub fn home() -> R<PathBuf> {+ match std::env::var_os("RAEA_GROKBOT_HOME").filter(|v| !v.is_empty()) {+ Some(d) => Ok(PathBuf::from(d)),+ None => Ok(crate::agent_mcp::user_home()?.join(".raea").join("grokbot")),+ }+}++/// Where the staged skills go, one folder per skill holding SKILL.md, as for every agent.+pub fn skills_dir() -> R<PathBuf> {+ Ok(home()?.join("skills"))+}++/// The app, where macOS keeps it (/Applications, or ~/Applications).+pub fn app() -> Option<PathBuf> {+ let home = crate::agent_mcp::user_home().ok();+ [Some(PathBuf::from("/Applications")), home.map(|h| h.join("Applications"))].into_iter().flatten().map(|d| d.join("Grok Bot.app")).find(|a| a.join("Contents/Info.plist").is_file())+}++/// What the staged SKILL.md says first, after its front matter: raea runs on the person's Mac, not on the Bot's computer.+pub fn preface(dir: &Path) -> String {+ format!(+ "> **On Grok Bot.** raea runs on the person's Mac, not on your computer. Run every `raea` command there, and read\n> every file this skill links (3d.md, reference/cli.md and the rest) from its copy there, in {}, both\n> with Run a command on your local computer (the person turns on Settings → Computer → Execution on this computer).\n> No raea MCP server or hook is set up for you: after saving a composition run `raea check EDIT.tsx --quick` yourself,\n> and `raea show FILE` puts media in front of the person.\n",+ dir.join("raea").display()+ )+}++/// SKILL.md with the preface after its front matter (or first, when it has none); a copy that has one keeps only one.+pub fn with_preface(text: &str, dir: &Path) -> String {+ let p = preface(dir);+ if text.contains("> **On Grok Bot.**") {+ return text.to_string();+ }+ let Some(rest) = text.strip_prefix("---\n") else { return format!("{p}\n{text}") };+ let Some(end) = rest.find("\n---\n") else { return format!("{p}\n{text}") };+ let (front, body) = (&rest[..end], rest[end + 5..].trim_start_matches('\n'));+ format!("---\n{front}\n---\n\n{p}\n{body}")+}++/// A query value as Grok Bot builds its own links (encodeURIComponent): every byte but A-Z a-z 0-9 - _ . ! ~ * ' ( ).+fn encode(v: &str) -> String {+ v.bytes().map(|b| if b.is_ascii_alphanumeric() || b"-_.!~*'()".contains(&b) { (b as char).to_string() } else { format!("%{b:02X}") }).collect()+}++/// One of Grok Bot's deep links (its route table: grokbot://app/v1/ROUTE?KEY=VALUE).+pub fn link(route: &str, key: &str, value: &str) -> String {+ format!("grokbot://app/v1/{route}?{key}={}", encode(value))+}++/// The message to the Bot that makes the skill: at most 1000 characters, as its prompt link takes.+pub fn ask(skill_md: &Path) -> String {+ format!("Please make a private skill named raea from the file {} on my Mac: read it with Run a command on your local computer and keep its text as it is. raea runs on my Mac, so run every raea command there.", skill_md.display())+}++/// What `raea skills install --agent grokbot` says once the copy is staged: where it is, and the links that finish it.+pub fn finish(dir: &Path) -> String {+ let md = dir.join("raea/SKILL.md");+ let here = match app() {+ Some(a) => format!("Grok Bot is at {}.", a.display()),+ None => "Grok Bot isn't installed on this Mac (cursor.com/download/bot); the copy is ready for when it is.".into(),+ };+ format!(+ "{here} It keeps its skills on its own computer and its MCP servers on your account, so the copy waits here: {}. No hooks, and no MCP server: Grok Bot runs a server's command on its computer, where the blender server can't reach this Mac's Blender.\nTo finish, in Grok Bot, signed in:\n 1. turn on Execution on this computer: {}\n 2. send the message this fills in, and the Bot makes the skill from the copy: {}\n or by hand: Skills → Add new skill → Upload file → {}\n`open LINK` opens a link in Grok Bot",+ dir.display(),+ link("settings", "id", "local-execution"),+ link("prompt", "text", &ask(&md)),+ md.display()+ )+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn the_preface_goes_after_the_front_matter_once() {+ let d = Path::new("/h/.raea/grokbot/skills");+ let md = "---\nname: raea\ndescription: d\nversion: 1\n---\n\n# raea\n";+ let out = with_preface(md, d);+ assert!(out.starts_with("---\nname: raea\ndescription: d\nversion: 1\n---\n\n> **On Grok Bot.** raea runs on the person's Mac"), "{out}");+ assert!(out.contains("in /h/.raea/grokbot/skills/raea, both") && out.ends_with("\n\n# raea\n"), "{out}");+ assert_eq!(with_preface(&out, d), out);+ assert!(with_preface("# no front matter\n", d).starts_with("> **On Grok Bot.**"));+ }++ #[test]+ fn links_are_built_as_grok_bot_builds_its_own() {+ assert_eq!(link("settings", "id", "local-execution"), "grokbot://app/v1/settings?id=local-execution");+ assert_eq!(link("prompt", "text", "a b/ü&+=?#'()"), "grokbot://app/v1/prompt?text=a%20b%2F%C3%BC%26%2B%3D%3F%23'()");+ // its prompt route takes at most 1000 characters of text in a link of at most 2048, with no format characters+ let a = ask(Path::new("/h/a-home-folder-with-a-rather-long-name/.raea/grokbot/skills/raea/SKILL.md"));+ assert!(a.chars().count() <= 1000 && link("prompt", "text", &a).len() <= 2048, "{a}");+ assert!(a.chars().all(|c| !c.is_control() && !('\u{200B}'..='\u{200F}').contains(&c) && !('\u{202A}'..='\u{202E}').contains(&c)));+ }++ #[test]+ fn finish_says_where_the_copy_is_and_both_links() {+ let f = finish(Path::new("/h/.raea/grokbot/skills"));+ assert!(f.contains("the copy waits here: /h/.raea/grokbot/skills."), "{f}");+ assert!(f.contains("grokbot://app/v1/settings?id=local-execution") && f.contains("grokbot://app/v1/prompt?text=Please%20make%20a%20private%20skill"), "{f}");+ assert!(f.contains("Upload file → /h/.raea/grokbot/skills/raea/SKILL.md"), "{f}");+ }+}diff --git a/apps/tools/src/lib.rs b/apps/tools/src/lib.rsindex 537142d0..93eb3504 100644--- a/apps/tools/src/lib.rs+++ b/apps/tools/src/lib.rs@@ -11,5 +11,7 @@ pub mod splat;/// the MCP servers `raea skills install` offers an agent (blender, for a running Blender)pub mod agent_mcp;pub mod agent_hooks;+/// Grok Bot as a `raea skills install` target: its copy staged on this Mac, and the links that finish it in Grok Bot+pub mod agent_grokbot;/// `raea setup blender` and `raea blender run`pub mod blender;diff --git a/engine/cli/src/skill.rs b/engine/cli/src/skill.rsindex c245f965..0600a222 100644--- a/engine/cli/src/skill.rs+++ b/engine/cli/src/skill.rs@@ -4,12 +4,13 @@//! `raea --version` the agent reads `raea skill` instead.use super::*;-pub const USAGE: &str = "raea skill [NAME] [--reference cli|feed|files|sdk] | raea skills install --agent claude|codex|kimi|gemini [--pin MOVE]... [--no-mcp] [--no-hooks] (the agent skill this raea ships, for its version, which raea --version prints: an agent whose copy names another version reads this; install puts raea's skills where that agent reads skills, adds the blender MCP server unless --no-mcp, makes each --pin MOVE a /MOVE of its own, and adds raea's hooks to that agent unless --no-hooks (raea hook AGENT: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved); a skill folder that's a link is left as it is)";+pub const USAGE: &str = "raea skill [NAME] [--reference cli|feed|files|sdk] | raea skills install --agent claude|codex|kimi|gemini|grokbot [--pin MOVE]... [--no-mcp] [--no-hooks] (the agent skill this raea ships, for its version, which raea --version prints: an agent whose copy names another version reads this; install puts raea's skills where that agent reads skills, adds the blender MCP server unless --no-mcp, makes each --pin MOVE a /MOVE of its own, and adds raea's hooks to that agent unless --no-hooks (raea hook AGENT: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved); a skill folder that's a link is left as it is; grokbot, the Grok Bot app, keeps its skills on its own computer, so its copy is staged on this Mac (RAEA_GROKBOT_HOME moves it) with the grokbot:// links that finish it in Grok Bot, and gets no hooks or MCP server)";/// Where each agent reads a person's skills, one folder per skill holding SKILL.md. Checked by hand on 11-05:/// claude: ~/.claude/skills (Claude Code's docs); codex: ~/.agents/skills (developers.openai.com/codex/skills, the user/// scope; older builds read ~/.codex/skills); kimi: $KIMI_CODE_HOME/skills, else ~/.kimi-code/skills (kimi 2.3.3's own/// binary; it also reads ~/.agents/skills and ~/.claude/skills); gemini: ~/.gemini/skills (geminicli.com/docs/cli/skills).+/// grokbot (11-14): Grok Bot reads no folder here (apps/tools agent_grokbot.rs), so its copy is staged in raea's own.fn target(agent: &str) -> R<PathBuf> {let home = tools::agent_mcp::user_home()?;Ok(match agent {@@ -17,13 +18,14 @@ fn target(agent: &str) -> R<PathBuf> {"codex" => home.join(".agents/skills"),"kimi" => std::env::var_os("KIMI_CODE_HOME").filter(|v| !v.is_empty()).map(PathBuf::from).unwrap_or_else(|| home.join(".kimi-code")).join("skills"),"gemini" => home.join(".gemini/skills"),- a => return Err(format!("no agent {a:?}: claude, codex, kimi or gemini")),+ "grokbot" => tools::agent_grokbot::skills_dir()?,+ a => return Err(format!("no agent {a:?}: claude, codex, kimi, gemini or grokbot")),})}/// Each agent and the folder it reads skills from, for `raea doctor` (an agent with no folder is skipped).pub fn agents() -> Vec<(&'static str, PathBuf)> {- ["claude", "codex", "kimi", "gemini"].into_iter().filter_map(|a| target(a).ok().map(|t| (a, t))).collect()+ ["claude", "codex", "kimi", "gemini", "grokbot"].into_iter().filter_map(|a| target(a).ok().map(|t| (a, t))).collect()}/// `raea doctor [--fix] [DIR]` (SK10): what doesn't match this raea, an agent's skill reinstalled by --fix.@@ -102,14 +104,18 @@ fn copy(from: &Path, to: &Path) -> R<()> {Ok(())}-/// `raea skills install --agent claude|codex|kimi|gemini`: raea's skills, stamped with this version, where that agent-/// reads them; each replaces the copy that was there, but a link (a checkout of raea-skills) is the person's to keep.+/// `raea skills install --agent claude|codex|kimi|gemini|grokbot`: raea's skills, stamped with this version, where that+/// agent reads them; each replaces the copy that was there, but a link (a checkout of raea-skills) is the person's to keep.pub fn install(args: &[String]) -> R<String> {if args.first().map(String::as_str) != Some("install") {return Err(format!("usage: {USAGE}"));}- let agent = args.iter().position(|a| a == "--agent").and_then(|i| args.get(i + 1)).ok_or("which agent: --agent claude|codex|kimi|gemini")?;- let to = target(agent)?;+ let agent = args.iter().position(|a| a == "--agent").and_then(|i| args.get(i + 1)).ok_or("which agent: --agent claude|codex|kimi|gemini|grokbot")?;+ install_into(agent, &target(agent)?, args)+}++/// `skills install` for one agent into its skills folder `to`.+fn install_into(agent: &str, to: &Path, args: &[String]) -> R<String> {let (from, v) = (shipped()?, version());let mut out = String::new();for name in installed_names()? {@@ -130,8 +136,17 @@ pub fn install(args: &[String]) -> R<String> {for (i, a) in args.iter().enumerate() {if a == "--pin" {let m = args.get(i + 1).ok_or("--pin takes a move: quieter, bolder, layout, adapt...")?;- out += &tools::agent_mcp::pin(&to, m, &v)?;+ out += &tools::agent_mcp::pin(to, m, &v)?;+ }+ }+ // Grok Bot (SK13): its copy says where raea runs, and the links finish it there; it has no hooks, and an MCP+ // server's command would run on its own computer, not this Mac. A linked folder is the person's: left as it is.+ if agent == "grokbot" {+ let md = to.join("raea/SKILL.md");+ if !to.join("raea").is_symlink() && let Ok(text) = std::fs::read_to_string(&md) {+ std::fs::write(&md, tools::agent_grokbot::with_preface(&text, to)).map_err(|e| format!("{}: {e}", md.display()))?;}+ return Ok(format!("{out}{}", tools::agent_grokbot::finish(to)));}// every agent's hooks (A5d, SK10), in its own config: --no-hooks leaves it aloneif !args.iter().any(|a| a == "--no-hooks") { out += &tools::agent_hooks::install(agent)?; }@@ -169,6 +184,26 @@ mod tests {assert!(target("claude").unwrap().ends_with(".claude/skills"));assert!(target("codex").unwrap().ends_with(".agents/skills"));assert!(target("gemini").unwrap().ends_with(".gemini/skills"));+ assert_eq!(target("grokbot").unwrap(), tools::agent_grokbot::skills_dir().unwrap());assert!(target("cursor").is_err());+ assert!(agents().iter().any(|(a, _)| *a == "grokbot"));+ }++ #[test]+ fn grokbot_gets_a_staged_copy_with_its_preface_and_no_hooks_or_mcp() {+ let d = std::env::temp_dir().join(format!("raea-grokbot-skills-{}", std::process::id()));+ let _ = std::fs::remove_dir_all(&d);+ let args: Vec<String> = ["install", "--agent", "grokbot", "--pin", "quieter"].map(String::from).to_vec();+ let out = install_into("grokbot", &d, &args).unwrap();+ let md = std::fs::read_to_string(d.join("raea/SKILL.md")).unwrap();+ assert!(md.starts_with("---\nname: raea\n") && md.contains(&format!("\nversion: {}\n---\n\n> **On Grok Bot.**", version())), "{}", &md[..400.min(md.len())]);+ assert!(md.len() < 256_000, "Grok Bot's Add new skill takes a file of at most 256 KB");+ assert!(d.join("raea/reference/cli.md").is_file() && d.join("quieter/SKILL.md").is_file());+ assert!(out.contains("grokbot://app/v1/settings?id=local-execution") && out.contains("grokbot://app/v1/prompt?text="), "{out}");+ assert!(!out.contains("hooks `raea hook") && !out.contains("MCP server blender added"), "{out}");+ // again: the copy is replaced, and its preface is there once+ install_into("grokbot", &d, &args).unwrap();+ assert_eq!(std::fs::read_to_string(d.join("raea/SKILL.md")).unwrap().matches("> **On Grok Bot.**").count(), 1);+ let _ = std::fs::remove_dir_all(&d);}}