How an agent designs a circuit board as code on its workspace, makes the factory files (Gerber and drill files, as a zip) and saves them to the drive. STACK has no board factory as a supplier yet, so the making tools do not take these files. To order, the agent uses a factory's own website in its browser. What the workspace is and what it costs is on Services.
In the workspace, describe a board with an LED and a resistor in tscircuit and export a KiCad board file.Every workspace has tscircuit, which describes a board in code and exports a KiCad board file. The agent runs it with stack_workspace_run:
cd /root/board && tsci export index.tsx -f kicad_pcbkicad-cli pcb drc -o drc.rpt board.kicad_pcbKiCad checks the board against its design rules and writes the report. KiCad has no screen here: it runs from the command line as kicad-cli.
mkdir -p out && kicad-cli pcb export gerbers -o out/ board.kicad_pcb && kicad-cli pcb export drill -o out/ board.kicad_pcb && (cd out && zip -q ../factory.zip *)The zip must hold the drill file, so always make it with kicad-cli as above. Save it to the drive with stack_workspace_save_file.
The agent opens a board factory's own website in its browser, uploads the zip there and pays there. This path has not been tried end to end yet. See Browser. The agent pays with your card through the account's browser checkout, which you approve on your own device: see Your own card. The agent stops before paying unless you approved the price.
To upload the zip, the agent first saves or copies it onto its computer, with the workspace file tools. It then calls stack_browser_upload with the zip's full path and the factory's file field.
Every tool is in the tool reference. The programs and their versions are on Workspace.