${heading}
${message}
${details ? `${details}
` : ""}
/** * HTML pages served by the loopback callback server. * * Pattern adapted from pi-mono's `oauth-page.ts` (MIT) — same dark * card style, no third-party assets, escapes user-supplied strings. */ function escapeHtml(value: string): string { return value .replaceAll("&", "&") .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll('"', """) .replaceAll("'", "'"); } function renderPage(opts: { title: string; heading: string; message: string; details?: string; }): string { const title = escapeHtml(opts.title); const heading = escapeHtml(opts.heading); const message = escapeHtml(opts.message); const details = opts.details ? escapeHtml(opts.details) : undefined; return `
${message}
${details ? `