by adom
The hero-image lab with a human gate: `hero-studio pose <owner/slug>` opens the studio in front of the human, posed for their package, and blocks until they click Generate, producing the provenance-stamped 2000x1250 PNG the registry's hero gate requires. The image carries the title and artwork; the exported image also bakes the type pill (top right) and full wiki slug (bottom right); the page shows the hero bare, and only the homepage marquee overlays its own dynamic info. Every hero wears its P
master
Colby Knox
Publish 0.25.2
2aa6af7
// When is a studio's gate open? `approved` is the session's record of the
// last Generate and is never cleared, so "approved.page === page" alone
// read a re-posed gate as closed whenever that page had been generated
// earlier in the session (hero-studio#77: a second thread's pose then took
// over the live gate). The gate is open when it is posed and the last
// approval of that page came before the pose.
export function gateOpen(state) {
if (!state || !state.verify || !state.page) return false;
const a = state.approved;
if (!a || a.page !== state.page) return true;
const posed = Number(state.posedAt) || 0;
const approvedAt = Number(a.ts) || 0;
return posed > approvedAt;
}