Two-process setup:
src/generator.js: pre-generates standalone HTML documents (inline CSS + inline JS, no backend dependencies inside the page) and stores them incache/pages/*.json.src/server.js: serves a random cached HTML page on/instantly.
Each browser refresh hits a random pre-generated hallucinated webpage.
npm install
cp .env.example .envSet OPENROUTER_API_KEY in .env.
Terminal 1 (generator daemon):
npm run generate:daemonTerminal 2 (server):
npm run serveOpen http://localhost:3000 and refresh repeatedly.
One-time generation batch:
npm run generate -- --count 20 --concurrency 2 --chaos 0.95Strict real-OpenRouter run (no local fallback allowed):
npm run generate -- --count 20 --concurrency 2 --chaos 0.95 --strict-openrouterDaemon with custom cache tuning:
npm run generate:daemon -- --target-size 200 --batch-size 8 --concurrency 3 --interval-ms 4000 --chaos 0.95--chaos 0..1(orCHAOS_LEVELenv var) controls prompt mutation intensity and sampling aggression.- Generator injects entropy capsules (nonce/hash/time jitter/style laws/artifacts/taboo words) to push outputs into new creative regions.
--strict-openrouter(orOPENROUTER_STRICT=1) disables fallback and exits on any OpenRouter failure.
- Generated pages are self-contained HTML/CSS/JS and should not call network APIs.
- If OpenRouter fails or key/model is invalid, generator falls back to locally generated self-contained hallucination pages unless strict mode is enabled.
- Debug endpoint:
GET /api/stats - Fetch a specific cached page by id:
GET /page/:id