/** * Theme Manager Plugin — injects CSS custom properties into HTML responses. * * Reads the X-User-Theme header from requests, merges with plugin config, * and injects CSS variables into HTML responses via a `; const body = response.body.replace(/]*)>/i, `${styleTag}`); return { ...response, body }; } /** * onInstall lifecycle hook — log installation. */ export function onInstall(ctx) { console.log(`[theme-manager] Installed v${ctx?.version || "unknown"}`); } /** * onActivate lifecycle hook — log activation. */ export function onActivate(ctx) { console.log(`[theme-manager] Activated with config:`, ctx?.config || {}); } /** * onDeactivate lifecycle hook — log deactivation. */ export function onDeactivate(ctx) { console.log(`[theme-manager] Deactivated`); }