Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Capabilities & AI

The engine's second signature idea: every function a human can operate in the editor is a named, JSON-schema'd capability that an AI agent can call — the same code path, the same permissions. The roadmap calls this the rule of double addressability.

The registry

re_agent::CapabilityRegistry holds ToolSpec (name, description, parameter schema) plus a runner closure. One registry serves three consumers: the editor UI, the in-process agent loop (run_agent with an AiProvider — Ollama, llama.cpp, OpenAI-compatible, Anthropic), and an MCP export for external clients.

World tools

re_agent::register_world_tools binds a live WorldPartition into the registry behind an Arc<Mutex<…>> shared with the editor:

ToolWhat it does
world.statstime, camera, cell budget, IO telemetry, HLOD, instance count
world.cells.resident / world.cell.statewhat is streamed where
world.hlod.listfar-field clusters
world.instances.list / .spawn / .move / .removescene editing
world.camera.set / world.tickmove the viewpoint, advance the simulation
#![allow(unused)]
fn main() {
use re_agent::{register_world_tools, CapabilityRegistry, SharedWorld};

let mut reg = CapabilityRegistry::new();
register_world_tools(&mut reg, shared_world);
let stats = reg.call("world.stats", serde_json::json!({})).unwrap();
}

Why it matters

Because editing and querying run through one door, an agent can do exactly what the editor does — no second scripting API to keep in sync, no "automation layer" that drifts from the UI. The M4 editor consumes the same registry for its own panels.

Rustdoc: re_agent.