import React, { useCallback, useEffect, useState } from 'react'; import { Menu, X } from 'lucide-react'; import { useAuth, AuthPanel, AdminConsole } from './Auth.jsx'; import { AgentBrowse, BoothDashboard } from './AgentPlatform.jsx'; import Mansion from './Mansion.jsx'; import TavernGame from './TavernGame.jsx'; import { api } from './api.js'; const RELEASE = '0.27.0-vivid'; const NAV = [ { id: 'home', label: 'Tavern' }, { id: 'agents', label: 'Browse Agents' }, { id: 'mansion', label: 'Mansion' }, { id: 'booth', label: 'My Booth' }, ]; const VALID_ROUTES = ['home', 'agents', 'mansion', 'booth', 'admin', 'signin']; function useHashRoute() { const normalize = () => { const raw = window.location.hash.replace(/^#\/?/, ''); return VALID_ROUTES.includes(raw) ? raw : 'home'; }; const [route, setRouteState] = useState(normalize); useEffect(() => { const onHash = () => setRouteState(normalize()); window.addEventListener('hashchange', onHash); window.addEventListener('popstate', onHash); return () => { window.removeEventListener('hashchange', onHash); window.removeEventListener('popstate', onHash); }; }, []); const setRoute = useCallback((next) => { const nextHash = `/${next}`; if (window.location.hash !== `#${nextHash}`) window.history.pushState(null, '', `${window.location.pathname}${window.location.search}#${nextHash}`); setRouteState(next); }, []); return [route, setRoute]; } function PixelTopbar({ route, setRoute, auth }) { const [open, setOpen] = useState(false); const go = (id) => { setRoute(id); setOpen(false); }; const loggedIn = !!auth?.user; const isAdmin = auth?.user?.role === 'admin'; const nav = ( <> {NAV.map((item) => ( ))} {loggedIn && Docs} {isAdmin && PM} {isAdmin && } {loggedIn ? : } ); return (
{open &&
{nav}
}
); } function Home({ setRoute }) { const [stats, setStats] = useState(null); useEffect(() => { api('/agents/stats').then(setStats).catch(() => {}); }, []); return (

Hire agents like mercenaries.

Walk into the tavern — talk to the screen to browse staff, or step to the floor to open your booth.

{stats && (
{stats.classes} classes {stats.online} online {stats.sessions} sessions
)}
); } function Page({ children }) { return
{children}
; } function Scene({ route, setRoute, auth }) { if (route === 'home') return ; if (route === 'agents') return ; if (route === 'mansion') return ; if (route === 'booth') return ; if (route === 'signin') return
GATEHOUSE

Open Booth

One amerc account across tavern, docs, PM and git.

setRoute('booth')} />
; if (route === 'admin') return
BACKDOOR

Quartermaster

Tenant, key, session and risk controls.

; return ; } export default function Scene2DApp() { const [route, setRoute] = useHashRoute(); const auth = useAuth(); return (

amerc agent mercenary tavern

); }