Workspace

Local agent API

Open a workspace

Use JSON over loopback. The browser and agents use the same handlers. To share the current browser workspace, use the session ID below. A new session starts with thickness probing enabled.

curl -X POST http://127.0.0.1:8765/api/sessions -H 'Content-Type: application/json' -d '{}'
GET /api/sessions/{id}
GET /api/machine
GET /api/materials

Send actions to POST /api/sessions/{id}/{action}. Include the latest integer revision and the action fields in one JSON object. Success returns {session, ...}. A stale revision returns 409. On an uncertain upload outcome, inspect the physical queue before resubmitting.

Workspace actions

capture
Acquire a rectified bed image. The detector sets sheet.used automatically. Each polygon is an array of [x,y] points in bed-space millimetres, measured from the top left.
import
{name:"panel.dxf", text:"..."}. Imports ASCII DXF, placing fitting parts on the sheet and staging the others beside the bed. The session’s insideArea map reports coverage by part ID. Unitless drawings use mm.
move · delete
Supply ids of parts. Delete also accepts path or source entity IDs. For move, add dx and dy in mm.
arrange
Pack parts into available stock using rotations, including in override mode. Non-fitting parts remain beside the bed.
assign
{ids:[pathId],op:"cut"}. Choose cut, engrave, score or ignore. Use path IDs or source line IDs from path.entities. Select a part through its paths, a connected group by connectedId, or matching paths by color. Pass optional settings with speed, power, frequency or engrave resolution. A null override field inherits its material value.
settings
Supply any of name, material, probe, allowOutside, kerfMode, measuredKerf. Kerf modes are none, profile and custom. Material is a complete session copy of a profile.
calibrate · measure
Selecting custom kerf stages a 20 mm square. Use move-calibration with {x,y} in millimetres to position it. Calibrate queues the square alone. Use stage-calibration to place another square or set measuredKerf directly in settings. After cutting and measuring the loose square, send {width,height} to measure. A material change resets calibration.
export · export-calibration
Return SVG in the response's svg field.
submit
Validate the automatically masked layout and active process settings, compile with the Epilog firmware toolchain and upload to the physical laser queue. The response includes a submission receipt in session.jobs[0]. Start the job at the machine.

Material administration

The local operator can import a JSON array using .venv/bin/python materials.py import profiles.json. Records are upserted by name in the local SQLite database. Reload the page to pick up library changes. Use a profile with verified settings for this laser. Null values leave a process unconfigured.

[{
  "name": "Profile name", "thickness": 3, "kerf": 0,
  "cut": {"speed": null, "power": null, "frequency": null},
  "score": {"speed": null, "power": null, "frequency": null},
  "engrave": {"speed": null, "power": null, "frequency": null}
}]