Create a world#
A desktop for one agent, ready to copy#
If what you want is one machine an agent can use — a desktop, a browser, the
everyday applications and a couple of documents — copy the built-in agent-desktop
world (GET /v1/templates/agent-desktop returns its whole definition) instead
of writing a world from scratch. It is one Ubuntu workstation for the user ada, with
Terminal, Files, Text Editor, Firefox, Calculator, Calendar, Notes, Image Viewer,
LibreOffice Calc and Visual Studio Code installed, three seeded documents under
~/Documents, and an intranet wiki at http://wiki.internal/ for the browser to
reach. The gateway is closed to the internet and to the host, as every world's is.
The grants an actor needs are in the definition, under metadata.actor_session, so the
session is a copy rather than a guess:
import json
from computerworld import World
definition = json.load(open("agent-desktop.json")) # the template's definition, saved
world = World(definition, seed=7)
env = world.environment(definition["metadata"]["actor_session"]) # hand only env to the agent
Over the hosted API, POST /v1/simulations {"template": "agent-desktop"} boots it and
POST /v1/simulations/{id}/agents with that actor_session as the body lets in an
external agent with the same session (the hosted API). To keep a world of
your own as a template, POST /v1/templates {name, definition}.
metadata.desktop_themes is what gives the machine a shell to draw; without it there
are windows but no desktop around them. installed_apps is what makes an application
launchable — an id that is not there is not_found with the reason
application_not_installed, and application.v1 list shows the whole catalogue with
the reason each unlaunchable entry carries.
The engine's own tests drive this world through an actor session only, so it cannot rot.
Anything else#
Start from the built-in unrelated-lab world, or copy the structure of the built-in
company-2026 world and replace its fixtures (both are in GET /v1/templates). The kernel has no required company domain or machine.
The built-in worlds are written in a source form and resolved to ordinary world definitions before they are served; what you send the API is always the plain JSON definition.
- Define OS profiles and each machine's address, user and initial files.
- Define service nodes and explicit links from clients to those nodes.
- Place service instances with registered kinds and state. Give them domains.
- Declare DNS records and gateway restrictions as needed. The public web is not
yours to declare: every world joins the built-in internet
unless it sets
internet: false, and a machine reaches it when its gateway'sallow_internetsays so. Nameedge-routerto choose the uplink yourself, or leave it and each machine gets one. - Boot it (
POST /v1/simulations {"definition": ...}over the hosted API, afterPOST /v1/validateif you like, orWorld(definition, seed)in the 0.3.0 packages) and grant an agent only the intended machines and action families. - Test behavior from actor actions: resolving, navigating, mutating and reading from a second machine. Owner inspection is diagnostic evidence, not the actor's solution.
Keep secret evaluation answers outside the definition's actor-visible files and service responses. Use deterministic context values for generated fixtures. Store the definition, engine version, module versions, seed and action sequence when sharing a reproducible episode.
The fields each of these steps fills in are listed in the world schema. A machine's insides are computers and its screen is the desktop; the wiring between machines is networking. Once the world runs, the agent API is how an actor is let into it.