#!/usr/bin/env node // 🤖 tools/marketing-shots/device-link.mjs — mint a fresh "add a device" sign-in // link for the demo space's operator identity ("Cass"), pointed at whatever // origin you give. // // Each link is SINGLE-USE, so run this once per device you want to sign in: // node tools/marketing-shots/device-link.mjs # link on the seeded base (localhost) // node tools/marketing-shots/device-link.mjs https://try-abc.11relay.com # link on the tunnel origin (phone) // // Reads .demo-state.json (written by seed-team.mjs) for the base, admin token, // and Cass's keypair. Prints just the link on stdout. import { readState, mintDeviceLink } from "./demo-lib.mjs"; const origin = process.argv[2] || null; async function main() { const s = readState(); if (!s) { console.error("device-link: no .demo-state.json — run seed-team.mjs first."); process.exit(1); } const link = await mintDeviceLink(s.base, s.adminToken, s.cass, origin || s.base, "You"); console.log(link); } main().catch((e) => { console.error("device-link:", e.message); process.exit(1); });