import QRCode from "qrcode"; import { uiError } from "./errors"; export async function renderQr(url: string): Promise { try { return await QRCode.toString(url, { type: "terminal", small: true, margin: 1, }); } catch (cause) { throw uiError("qr_failed", "Could not render terminal QR code", { action: "Use the OSC link in the /ui widget instead.", retryable: true, cause, }); } }