/** * ADR 0194, the public CSS custom-property contract. * * ## Why this exists * * Every Olotalk surface renders inside a shadow root, so a host page's CSS * cannot reach in. That is deliberate: it is what keeps citations, the grounding * badge, the refusal state and the "Powered by" attribution *structural* rather * than dismantlable. A host can restyle what we render; it cannot delete what we * say. * * But the same boundary made the assistant impossible to blend into a host page. * Everything it drew used our type and our colours, and the only escape hatch * was a JS `theme` object with a handful of named fields, set once at init, * invisible to the stylesheet the developer is actually editing. * * CSS custom properties are the one exception to shadow encapsulation: they * **inherit across the boundary**. So a small, curated set of `--olotalk-*` * properties gives hosts genuine control over appearance without exposing * structure. Tokens change how a surface looks; they can never change what it * discloses. * * ## Scope, typography, colour and radius only * * Spacing and layout primitives are deliberately NOT exposed. Inheriting a * host's full styling is what makes an embedded component look broken on any * page with unusual CSS, and we would own that support burden. * * ## Precedence * * host CSS token > operator dashboard setting > built-in default * * The token wins because it is the most local expression of intent: a developer * editing the page they are embedding into. If the dashboard value won, setting * `--olotalk-accent` would silently do nothing, the exact failure mode this * contract exists to remove. * * ## Backward compatibility * * Every token falls back to the value the surface used *before* this contract * existed. A page that sets no tokens renders identically to before, verified, * not assumed (see the ADR). Adding the contract is not a restyle. */ /** The public namespace. Anything outside it is private implementation detail. */ export declare const PUBLIC_TOKEN_PREFIX = "--olotalk-"; /** * The complete public contract. Adding a name here widens the API surface we * are committing to support across surfaces, do it deliberately. * * Internal properties (`--otw-*` on the chat assistant) are NOT part of this * contract and may change in any release. */ export declare const PUBLIC_TOKENS: readonly ["font-family", "font-size", "line-height", "accent", "text", "muted", "surface", "surface-alt", "border", "radius", "radius-panel", "shadow"]; export type PublicToken = (typeof PUBLIC_TOKENS)[number]; /** * Build a `var()` reference to a public token with the pre-contract value as its * fallback. * * The fallback is what guarantees backward compatibility, so pass the value the * surface would have used anyway, never a fresh guess. * * @example * "--otw-surface": cssToken("surface", surface) * // → "var(--olotalk-surface, #ffffff)" */ export declare function cssToken(name: PublicToken, fallback: string): string;