// Splash screen -- logo + embedded InputBar when no messages yet. Signal reads in JSX. import fs from "fs"; import path from "path"; import { palette, LOOM_LOGO } from "../theme.ts"; import { providerName, modelName, providerKeyOk } from "../store.ts"; import { InputBar } from "./InputBar.tsx"; // Read the real version from package.json (same source as `loom --version`), // never a hardcoded label that drifts out of sync with releases. const LOOM_VERSION = (() => { try { const pkg = fs.readFileSync(path.join(import.meta.dir, "..", "..", "package.json"), "utf8"); return "v" + pkg.match(/"version":\s*"([^"]+)"/)[1]; } catch { return ""; } })(); export function SplashScreen() { const ui = palette("loom"); return ( {LOOM_LOGO.map((line, i) => ( {line} ))} {"Build"} {" "} {providerName()} {" "} {modelName()} {" "} {providerKeyOk() ? "connected" : "no key"} {LOOM_VERSION} {"Tip: "} {"Type /help @ for files ! for shell tab to cycle mode"} {"ctrl+p palette ctrl+b sidebar esc interrupt"} ); }