JSHack now has a headless runtime path that runs the real rules scheduler and world view pipeline without main.js.
deno task headless --turns 500 --report-every 100Options:
--seed <number>: world seed (default0xC0FFEE)--class <id>: player class id (defaultoutlaw)--name <text>: player name (defaultHeadless Hero)--depth <number>: dungeon start depth (default1)--turns <number>: turns to simulate (default500)--report-every <number>: emit periodic JSON report every N turns (default100)--player-wait true|false: dispatchrules.waiteach turn instead of rawworld.tick(1)(defaultfalse)--dungeon-type <id>: optional floor profile override--actions-file <path>: JSON schedule of actions by turn
--actions-file expects a JSON array:
[
{
"at": 1,
"action": { "type": "rules.wait", "payload": {} }
},
{
"at": 2,
"action": { "type": "rules.move", "payload": { "dx": 1, "dy": 0 } }
}
]Actions are passed through makeRulesDispatcher, so they use the same intent translation path as the app.
Shared runtime facade lives at:
src/main/runtime/gameRuntime.js
It owns:
- world creation and scheduler configuration
- dungeon initialization
- player creation and class loadout
- action dispatch (
makeRulesDispatcher) - simulation stepping
- world snapshot and
buildWorldViewprojection
This keeps browser-only concerns in main.js and allows deterministic simulation/perf tooling from Deno.