/** * public/main.ts — esbuild entry point for the browser frontend. * * Bootstraps the multi-tab app: a tab bar (#tabbar) over a stack of terminal * panes (#term), each tab an independent TerminalSession (own WS + server * session). The mobile key bar routes input to the active tab. * * Per-session terminal/WS/reconnect logic lives in terminal-session.ts; * tab management + persistence in tabs.ts. */ // CSS side-effect import processed by esbuild (→ public/build/main.css). // tsc cannot resolve CSS paths; @ts-ignore suppresses the single diagnostic. // @ts-ignore import '@xterm/xterm/css/xterm.css' import { mountKeybar } from './keybar.js' import { TabApp } from './tabs.js' const paneHost = document.getElementById('term') const tabBar = document.getElementById('tabbar') if (!paneHost) throw new Error('#term element not found in DOM') if (!tabBar) throw new Error('#tabbar element not found in DOM') const app = new TabApp(paneHost, tabBar) // Key bar (mobile) sends to whichever tab is active. mountKeybar((data) => app.sendToActive(data))