ComputerWorld
an ultra computer world simulator written in Rust
pip install computerworld
from computerworld import World
world = World(definition, seed=42)
env = world.environment({"actor": "alice", "machines": ["alice-mac"],
"actions": ["pointer.v1", "keyboard.v1", "application.v1"],
"observations": ["semantic.v1"]})
env.step([{"family": "application.v1", "op": "launch",
"machine": "alice-mac", "payload": {"kind": "code"}}])
scene = env.scene(1440, 900) # roles, names, geometry — no pixels needed
frame = env.render(1440, 900) # or exact RGBA, if your model wants pixels
import init, { World } from "computerworld";
await init();
const world = new World(definition, 42n);
const env = world.environment({ actor: "alice", machines: ["alice-mac"],
actions: ["pointer.v1", "keyboard.v1", "application.v1"],
observations: ["semantic.v1"] });
env.step([{ family: "pointer.v1", op: "click",
machine: "alice-mac", payload: { x: 480, y: 620, width: 1440, height: 900 } }]);
const scene = env.scene(1440, 900);
const snapshot = world.snapshot(); // fork it, replay it, diff it
use computerworld::{reference_world, ActionEnvelope, EnvironmentConfig, World};
let mut world = World::new(reference_world(), 7)?;
let session = world.environment(EnvironmentConfig::desktop("alice", "alice-mac"))?;
world.step(&session, vec![ActionEnvelope::new(
"terminal.v1", "execute", "alice-mac",
serde_json::json!({ "command": "python3 primes.py" }),
)])?;
let checkpoint = world.snapshot();
let branch = world.fork(&checkpoint)?; // explore both futures