import type { ExtensionAPI, Theme } from "@earendil-works/pi-coding-agent"; import { VERSION } from "@earendil-works/pi-coding-agent"; function getDinoHeader(theme: Theme): string[] { const purple = (text: string) => theme.fg("accent", text); const muted = (text: string) => theme.fg("muted", text); const dim = (text: string) => theme.fg("dim", text); // Block-letter ASCII for "DINO" const d = ["█████", "█ █", "█ █", "█ █", "█████"]; const i = [" ███ ", " █ ", " █ ", " █ ", " ███ "]; const n = ["█ █", "██ █", "█ █ █", "█ ██", "█ █"]; const o = [" ███ ", "█ █", "█ █", "█ █", " ███ "]; const letters = [d, i, n, o]; const titleLines: string[] = []; for (let i = 0; i < 5; i++) { titleLines.push(purple(letters.map((l) => l[i]).join(" "))); } const dino = [ " ████████", " ██░░░░░░░░██", " ██░░░░░░░░░░░░██", " █░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█", " █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█", "███████████████████████████████████████", "█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█", "█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█", " ████████████████████████████████████", " █ █ █ █", " █ █ █ █", ]; const subtitle = `${muted(" friendly purple dinosaur")}${dim(` v${VERSION}`)}`; return ["", ...titleLines, subtitle, "", ...dino.map(purple), ""]; } export default function (pi: ExtensionAPI) { pi.on("session_start", async (_event, ctx) => { if (ctx.mode === "tui") { ctx.ui.setHeader((_tui, theme) => { return { render(_width: number): string[] { return getDinoHeader(theme); }, invalidate() {}, }; }); } }); pi.registerCommand("dino-header", { description: "Restore built-in header", handler: async (_args, ctx) => { ctx.ui.setHeader(undefined); ctx.ui.notify("Built-in header restored", "info"); }, }); }