Architecture
SlopWorld uses RimWorld 1.7 as the interface for coding agents. The C# mod presents
sessions in the colony and workspace; the Rust daemon, slopd, manages the processes
and host resources behind them.
Components and ownership
| Component | Responsibility | Source |
|---|---|---|
| Mod | RimWorld integration through Harmony, colony simulation, workspace panels, terminal rendering, and user input | mod/Source/SlopWorld/ |
| Daemon | Session lifecycle, projects, files, Git operations, tasks, workers, sandbox configuration, and terminal capture | slopd/src/ |
| Host tools | Launching, installation, and slopctl access to daemon operations | slopd/src/bin/ |
| Shared protocol | Protobuf messages exchanged by the daemon and mod | shared/ |
| Sidecar | Linux container packaging for the daemon and its runtime dependencies | slopcar/ |
Within the mod, Patches/ owns Harmony integration, Sim/ owns simulation, and
UI/ owns workspace presentation. Client/SessionHub/ coordinates connections
and hands updates to the session, task, catalog, terminal, usage, and audio services.
Within the daemon, api/ owns transport and request handling, while
application/state.rs composes API state and application feature dependencies.
session/runtime.rs coordinates live sessions and their operation guards. Configuration,
persistence, sandbox construction, Git operations, and terminal emulation have
separate owners. The daemon source map
and mod source map
identify the focused entry points for implementation work.
Requests and live updates
The mod talks to the daemon over HTTP and WebSocket using Protobuf messages. HTTP carries requests and responses; WebSocket carries live events and terminal traffic. The mod maintains client views of daemon state and renders them in the workspace and colony. Connection coordination and presentation belong to the mod; host operations and session management belong to the daemon.
See the API reference for authentication and transport contracts, and the route inventory for available operations.
Sessions and terminals
The daemon manages tmux sessions and builds agent sandboxes. Its terminal capture pipeline feeds a terminal emulator and publishes the resulting state to the mod. The mod renders terminal cells and sends user input back through the client.
Session lifecycle, terminal display, and colony simulation are separate concerns. For their user-facing behavior, see Session lifecycle, Input and panes, and “Gameplay”. Sandbox access boundaries are described in the Security model.
Daemon deployment
The daemon can run directly on the game’s machine or on a remote Linux machine. The game/mod connects to the selected daemon over HTTP and WebSocket.
In sidecar mode, the game runs on the host and connects to a Docker container
running the daemon, tmux, and agent sandboxes. Workspace paths must match between
the host and container. Container tooling lives in slopcar/.
Replacing the container ends its tmux processes, while persistent private state can remain. See Sidecar mode for setup and lifecycle procedures.