Files
photoreport/apps/print-agent
sparkandClaude Opus 5.5 64d52fc691
ci / rust (push) Successful in 15m6s
ci / typescript (push) Successful in 18m21s
Errors to errors.bitreport.pt from API, worker, app, desktop, sites and print agent
API and worker report error log lines, unhandled 5xx and crashes to the hub with the
photoreport ingest key (ERROR_REPORTING_TOKEN); browsers (app, desktop webview, sites),
Next server renders and the print agent send through POST /v1/client-errors so the key
stays on the server. Repeats folded, rate-limited. docs/errors.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-14 19:32:54 +01:00
..

apps/print-agent

Runs on the computer next to the printers (macOS or Linux with CUPS, or Windows with the printer's driver). It pairs with PhotoReport once, tells the server which printers it sees, takes print jobs for printers loaded with the job's paper, prints them and reports back. Jobs from a station that dies mid-print go back to the queue after five minutes.

pnpm --filter @photoreport/print-agent build
node apps/print-agent/dist/cli.js pair ABCD2345 --api https://api.photoreport.pt   # code from Impressão > Estações
node apps/print-agent/dist/cli.js printers                                          # what CUPS sees
node apps/print-agent/dist/cli.js run
  • Paper: in the app, tick the sizes loaded in each printer (15x20 by default). CUPS media names for dye-sub printers (Gutenprint, Mitsubishi CP-D90DW): 10x15 w288h432, 15x20 w432h576, 20x30 w576h864; override with "media": {"15x20": "..."} in the config file (~/.config/photoreport-print-agent/config.json).
  • --folder <dir> at pairing prints into folders instead (training, tests without paper).
  • Windows: the spooler, through Windows PowerShell 5.1 and .NET (nothing else to install besides Node 22). It picks the driver's paper that matches the job's size (4x6, 5x7, 6x8 or 8x12 in), prints without margins and turns the photo to the paper. If a driver names a size differently, set "paper": {"15x20": [600, 800]} (hundredths of an inch) in the config, %APPDATA%\PhotoReport\photoreport-print-agent\config.json. To start it with Windows: schtasks /Create /SC ONLOGON /TN "PhotoReport impressao" /TR "node C:\photoreport\apps\print-agent\dist\cli.js run". Still to confirm on a real Windows computer with a dye-sub printer (DNP, Mitsubishi).