/** * Brand: the few things that make the TUI look like a particular product: the mark shown next to * the version, the startup art and tagline, and the accent colours of the chrome. * * chassis ships a neutral default. A separate package layers its own identity on top by calling * `registerBrand()` from client.ts: * * import { registerBrand } from "pi-chassis/client"; * export default function () { * registerBrand({ name: "Acme", glyph: "A", colors: { primary: "#E4572E" } }); * } * * The brand is stored on globalThis (the same reason the widget registry is: pi loads every * extension in its own module scope) and read while rendering, so load order does not matter and * a later registration simply wins. Fields left out keep the defaults. * * This file has no imports, so client.ts can re-export it without loading anything else. */ /** `#RRGGBB` (or any colour string pi-tui's parseColor accepts). */ export type ColorValue = string; export interface BrandColors { /** Build-mode rail and badge, focus marks, the mark next to the version. */ primary: ColorValue; /** Darker companion of `primary`. */ primaryDark: ColorValue; /** Plan-mode rail and badge, and the provider glyph in the sidebar. */ plan: ColorValue; /** Quiet brand neutral used for taglines. */ neutral: ColorValue; } export interface BrandSurfaces { /** Sidebar, user messages, tool blocks. Keep in step with the theme's panel colour. */ panel: ColorValue; /** The prompt box. Keep in step with the theme's raised panel colour. */ element: ColorValue; } /** * `surfaces` are for dark themes, and `lightSurfaces` for light ones (a theme says which it is with * its `appearance`). Text that chassis draws in a brand colour is darkened on a light surface until * it can be read; rails, bars and the mode pill keep the brand colour exactly. */ export interface BrandSpec { /** Shown as " pi ". Leave out for " pi ". */ name?: string; /** A single-cell mark. Pick one your users' fonts have, or ship a font that does. */ glyph?: string; /** Line under the startup art. */ tagline?: string; /** Startup header art, one string per row, painted in `primary`. Default: the pi logo. */ art?: string[]; colors?: Partial; /** For dark themes. */ surfaces?: Partial; /** For light themes. Default: a light neutral pair. */ lightSurfaces?: Partial; /** * The icon set to use when the user has not chosen one: "nerd" for a brand whose users have a * Nerd Font (or that ships one), "plain" for icons that need no special font. Default: "plain". */ icons?: "nerd" | "plain"; } export declare const DEFAULT_BRAND: { readonly glyph: "●"; readonly colors: { readonly primary: "#4F8EB3"; readonly primaryDark: "#3B6B87"; readonly plan: "#EAB65D"; readonly neutral: "#C9CCC9"; }; readonly surfaces: { readonly panel: "#121212"; readonly element: "#1C1C1C"; }; readonly lightSurfaces: { readonly panel: "#F0F0F0"; readonly element: "#E6E6E6"; }; }; export interface ResolvedBrand { name?: string; glyph: string; tagline?: string; art?: string[]; colors: BrandColors; surfaces: BrandSurfaces; lightSurfaces: BrandSurfaces; icons?: "nerd" | "plain"; /** Changes whenever the brand does; part of render cache keys. */ version: number; } /** The brand in effect, with defaults filled in. Cheap: cached per change. */ export declare function getBrand(): ResolvedBrand; /** * Merge a brand onto the current one. Nested `colors`, `surfaces` and `lightSurfaces` merge key by key. Returns a * function that restores the previous brand (used by tests and by packages that unload). */ export declare function setBrand(spec: BrandSpec): () => void; /** Forget any registered brand and go back to the defaults. */ export declare function resetBrand(): void;