diff --git a/og-images.ts b/og-images.ts new file mode 100644 index 0000000..d206869 --- /dev/null +++ b/og-images.ts @@ -0,0 +1,69 @@ +/** + * OG Image Generator — agentify.help only + */ +import { Resvg } from "@resvg/resvg-js"; + +const PNG_CACHE = new Map(); + +function renderSvgToPng(svg: string): Buffer { + const resvg = new Resvg(svg, { + fitTo: { mode: "original" }, + font: { loadSystemFonts: true }, + }); + return Buffer.from(resvg.render().asPng()); +} + +const AGENTIFY_SVG = ` + + + + + + + + + + + + + + + + + + + + + + AI + + AGENTIFY.HELP + Build the AI expert. + Once. Right. + + + CORPUS-GROUNDED + Published works only + + ONE-PER-PERSON + No duplicate clones + + STEWARD-NAMED + Someone accountable + Seven-stage pipeline. VCAP-attested. WellSpr.ing rails. + + wellspr.ing · agentify.help · one agent per person + +`; + +export function getOgPng(domain: "agentify"): Buffer { + if (PNG_CACHE.has(domain)) return PNG_CACHE.get(domain)!; + const png = renderSvgToPng(AGENTIFY_SVG); + PNG_CACHE.set(domain, png); + return png; +} + +setImmediate(() => { + try { getOgPng("agentify"); console.log("[OG] agentify.help card rendered"); } + catch(e: any) { console.error("[OG] agentify render error:", e.message); } +});