harness-safari: copy the modules beside the page, not just brain.js

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dhu3iHseRewQ2WpBSVLokG
This commit is contained in:
teahubxyzandClaude Fable 5.1 committed 2026-10-21 22:17:59 +00:00
1 parent f855ee15b7
commit f33029c261
1 file changed
+2 -1
+2 -1
View File
@@ -23,7 +23,8 @@ gate = '<button id="go" style="position:fixed;top:0;left:0;z-index:99;padding:20
script = script.replace('(async () => {\n document.dispatchEvent(new Event("keydown"));', "(async () => {\n await window.__gate;", 1)
assert "await window.__gate" in script, "the fragment's opening line changed; update the gate"
(out / "run.html").write_text(page.replace("</body>", gate + script + "</body>"))
(out / "brain.js").write_text((ROOT / "brain.js").read_text())
for js in list(ROOT.glob("*.js")) + list(ROOT.glob("ui/*.js")): # the modules and brain.js, beside the page
(out / js.relative_to(ROOT)).parent.mkdir(exist_ok=True); (out / js.relative_to(ROOT)).write_text(js.read_text())
for extra in ("sw.js", "manifest.json", "favicon.svg"):
if (ROOT / extra).exists(): (out / extra).write_text((ROOT / extra).read_text())