Cookie Factory Simulator
Home Live explorer
Live simulation data for the demo datasource

This service exposes a toy cookie production line over HTTP. The GMS editor can bind screens to it via the CookieFactory datasource (same path contract as the historical in-repo server). Use this page as a reference for URLs and the shape of queryable state.

HTTP API

POST /api/variables — body: JSON array of slash-separated paths into the live state object. Response: JSON object mapping each path to its value (or { "error": "Not found" }).
["ingredients/flour","machines/oven1/status","batches/*"]
Path segments support wildcards: * for all children, and {a,b} for a subset.
GET /api/discover?path= — list child keys at a path (for exploration).
GET /api/variables?path= — legacy query form; prefer POST for clients. CORS is open (Access-Control-Allow-Origin: *) for local demos.

State & example paths

Top-level keys include: Under machines/<name>/ you’ll find lifecycle/phase timestamps (lifecycleState, processPhase, phaseEnteredAt, assignmentEnteredAt), plus PV/target/limit triples where applicable—for example ovens expose temperature, targetTemp, tempLimitLow/tempLimitHigh derived from bake setpoint and config/factory-limits.json (optional override via FACTORY_LIMITS_PATH). Editor tags often mirror machines/<name>/<metric> and batches/<id>/<metric>.

Using with the GMS editor

Point the datasource base URL at this host (default http://localhost:8081). The simulation tick runs once per second; variable reads go through /api/variables as above.