deploy-local payloads
nix run .#deploy-local posts one JSON body to POST /api/user/code with Content-Type: application/json and the auth token in an X-Token header. The body is built at Nix build time; the shape is always
{ "branch": "default", "modules": { "<module name>": "<JS source as a string>" } }Each module value is the file’s JavaScript embedded as a single JSON string (newlines escaped as \n, quotes as \"). Below, the string is replaced by a link to that payload’s JS file.
js tutorial version (nix run .#deploy-local -- tutorial-js)
One module per .js file in tutorial-js/section1/, keyed by filename with .js stripped.
{
"branch": "default",
"modules": {
"main": tutorial-js/main.js,
"role.harvester": tutorial-js/harvester.js
}}
dox-populi version (nix run .#deploy-local)
Two modules, each an esbuild CJS bundle: main from harness/main.ts (with role.harvester left external so the require survives bundling), and role.harvester from harness/role.harvester.ts.
{
"branch": "default",
"modules": {
"main": dox-populi/main.js,
"role.harvester": dox-populi/harvester.js
}}