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:
ingredients— inventory (flour, sugar, eggs, butter, etc.)utilities— cumulativeelectricity,naturalGas,waterpackaging— boxes, wrappers, labelsmachines— keyed by name:mixer1,mixer2,oven1,oven2, conveyorsA/B/C,qc1,pack1batches— map of batch id → fields (recipe, step, quantities, instrumentation:phaseName,stepEnteredAtMs,goodPiecesTotal,rejectPiecesByReason, etc.)activeBatches— in-progress batches arrayorders— keyed work orders linking to batches (status,requestedAtMs,completedAtMs)factoryLimits— read-only view of tolerance JSON merged at startup (config/factory-limits.jsonorFACTORY_LIMITS_PATH)
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.