@pixelaid/http provides a localhost-only HTTP-style automation layer over @pixelaid/automation. It includes a request handler, in-memory job store, progress snapshots, cancellation, and a small Node server factory.
Implemented as a private workspace package and tested as a local handler/server layer. It is WIP as a product surface: there is no root script, no published binary, no auth model, and no release packaging yet. Use it for development experiments and future local API work, not as a public service.
From the repo root:
npm run test -w @pixelaid/http
npm run build -w @pixelaid/http
npm run typecheck -w @pixelaid/httpFrom packages/http:
npm run test
npm run build
npm run typecheckThe handler understands these routes:
GET /healthGET /v1/statusPOST /v1/jobs/inspectPOST /v1/jobs/fixPOST /v1/jobs/exportGET /v1/jobs/:idDELETE /v1/jobs/:idPOST /v1/jobs/:id/cancel
Job requests use JSON bodies with local file paths. Fix requests can target either a single sprite output or a sheet output directory depending on the body fields.
import { createPixelAidHttpServer } from "@pixelaid/http";
const api = createPixelAidHttpServer({ host: "127.0.0.1", port: 0 });
const address = await api.listen();
console.log(address);createPixelAidHttpServer only accepts localhost hosts: 127.0.0.1, localhost, ::1, or [::1].
- Keep the default server localhost-only until the project has a security model for remote access.
- Keep request parsing strict and JSON-only.
- Keep long-running operation state in the job store, not in global module state.
- Add tests for route changes, job lifecycle changes, cancellation, and response envelopes.
Run the HTTP tests after changing routes, job status, cancellation, server binding, or response formats:
npm run test -w @pixelaid/http