- New "Route Planner" tab: pick a dragon colour, a goal (only this dragon / best odds this run) and a data sample. The solver runs in the browser from policy.json and walks the valley: every decision shows each option's chance of bonding the colour (with the best play afterwards) and of reaching an encounter alive; every roll shows its probabilities; deaths show where they happen; "stays best in N% of re-runs" and "no clear winner" flag noisy recommendations. Click any option on the map or in the list to explore another branch. - solver.js: values now carry P(reaching an encounter alive); advisor.step() gives the planner the next decision, roll or outcome at any history. - valley.js shares its painting with the planner. - Fix: route-map target chips no longer capture clicks on other chip rows. - Pages build gets a doctype and charset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
32 lines
1.6 KiB
JavaScript
32 lines
1.6 KiB
JavaScript
// Assemble the static Atlas site into dist/ (no dependencies).
|
|
// node scripts/build-site.js [outDir]
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const root = path.resolve(__dirname, "..");
|
|
const out = path.resolve(root, process.argv[2] || "dist");
|
|
|
|
const copy = (from, to) => {
|
|
fs.mkdirSync(path.dirname(path.join(out, to)), { recursive: true });
|
|
fs.copyFileSync(path.join(root, from), path.join(out, to));
|
|
};
|
|
|
|
fs.rmSync(out, { recursive: true, force: true });
|
|
for (const f of fs.readdirSync(path.join(root, "apps/atlas"))) copy(`apps/atlas/${f}`, f);
|
|
// The page is written as an Artifact body (the artifact host adds the document skeleton). For GitHub Pages and
|
|
// local serving, give it its own doctype, charset and viewport.
|
|
{
|
|
const p = path.join(out, "index.html");
|
|
const html = fs.readFileSync(p, "utf8");
|
|
if (!/^\s*<!doctype/i.test(html))
|
|
fs.writeFileSync(p, `<!doctype html>\n<meta charset="utf-8">\n<meta name="viewport" content="width=device-width, initial-scale=1">\n${html}`);
|
|
}
|
|
copy("packages/core/src/engine.js", "engine.js");
|
|
copy("packages/core/src/graph.js", "graph.js");
|
|
copy("packages/core/src/solver.js", "solver.js");
|
|
for (const f of ["form_responses.json", "register.json", "graph.json", "policy.json"]) copy(`data/public/${f}`, `data/${f}`);
|
|
// Source files shown in the page's "view the code" panel
|
|
for (const f of ["analyze.py", "clean.py", "stats_core.py"]) copy(`research/python/${f}`, `python/${f}`);
|
|
copy("README.md", "README.md");
|
|
fs.writeFileSync(path.join(out, ".nojekyll"), "");
|
|
console.log(`Site built in ${path.relative(root, out) || "."}`);
|