Build GhostlightDungeon kernel and private Eve harness

This commit is contained in:
Meta Vens 2026-08-16 16:35:50 +02:00
commit 6f51f3a4a3
24 changed files with 5159 additions and 0 deletions

36
web/src/main.ts Normal file
View file

@ -0,0 +1,36 @@
import { renderEveSurface } from "@gamecult/eve-browser-lowering";
import "@gamecult/eve-browser-lowering/styles.css";
import "./style.css";
const host = document.querySelector<HTMLElement>("#surface")!;
const status = document.querySelector<HTMLElement>("#status")!;
const receipt = document.querySelector<HTMLElement>("#receipt")!;
let revision = 0;
let actorId = "player";
async function refresh() {
const response = await fetch("/api/surface");
if (response.status === 401) { status.textContent = "This laboratory requires an unused invite link."; return; }
const surface = await response.json();
revision = Number(surface.version ?? 0);
renderEveSurface(surface, host, { body: document.body, clientId: "ghostlight.browser", statusElement: status });
}
async function send(command: unknown) {
status.textContent = "The world is considering the command…";
const response = await fetch("/api/command", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(command) });
const body = await response.json();
receipt.hidden = false;
receipt.textContent = JSON.stringify(body, null, 2);
if (!response.ok) { status.textContent = body.error ?? "The command was refused."; return; }
await refresh();
}
document.querySelector<HTMLFormElement>("#composer")!.addEventListener("submit", event => {
event.preventDefault();
const text = document.querySelector<HTMLTextAreaElement>("#attempt")!.value.trim();
if (!text) return;
void send({ type: "assess", expected_revision: revision, intent: { actor_id: actorId, description: text, intended_effect: text } });
});
document.querySelector<HTMLButtonElement>("#wait")!.addEventListener("click", () => void send({ type: "wait", expected_revision: revision, minutes: 60 }));
void refresh();

2
web/src/style.css Normal file
View file

@ -0,0 +1,2 @@
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:opsz,wght@8..144,400;8..144,600&family=IBM+Plex+Mono:wght@400;600&display=swap');
:root{color-scheme:dark;font-family:"Crimson Pro",serif;background:#0c1110;color:#e8e1cf}body{margin:0;min-height:100vh;background:radial-gradient(circle at 15% 0,#253229 0,transparent 38rem),linear-gradient(145deg,#0c1110,#111513)}header,main{width:min(920px,calc(100% - 2rem));margin:auto}header{padding:3rem 0 1.25rem;border-bottom:1px solid #66543d}h1{font-size:clamp(2.6rem,8vw,5.5rem);font-weight:400;letter-spacing:-.045em;margin:.1rem 0}.eyebrow,#status,label,button,pre{font-family:"IBM Plex Mono",monospace}.eyebrow{color:#d49b58;letter-spacing:.18em;font-size:.72rem}#status{color:#9aa69f;font-size:.78rem}main{padding:1.5rem 0 5rem}#surface{min-height:15rem}form{margin-top:1.5rem;padding:1rem;border:1px solid #66543d;background:#17201ddd}label{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.12em;margin-bottom:.65rem}textarea{box-sizing:border-box;width:100%;min-height:7rem;resize:vertical;background:#0b0f0d;color:#f2e7d0;border:1px solid #4a5148;padding:.9rem;font:1.25rem/1.4 "Crimson Pro",serif}button{margin:.8rem .5rem 0 0;padding:.65rem 1rem;border:1px solid #d49b58;background:#d49b58;color:#17120c;cursor:pointer}button+button{background:transparent;color:#d49b58}pre{white-space:pre-wrap;padding:1rem;background:#080b09;color:#aeb9af;overflow:auto;font-size:.72rem}@media(max-width:600px){header{padding-top:2rem}h1{font-size:3rem}}