import { spawn } from 'node:child_process'; const origin = (process.env.MACHINE_INBOX_ORIGIN || 'https://machineinbox.com').replace(/\/$/, ''); const child = spawn( 'npx', [ '@stripe/link-cli', 'mpp', 'pay', `${origin}/api/v1/inboxes`, '--context', 'Create one seven-day Machine Inbox for an automated task', ], { stdio: 'inherit' }, ); child.once('exit', code => process.exitCode = code ?? 1); child.once('error', error => { console.error(`Could not start Stripe Link CLI: ${error.message}`); process.exitCode = 1; });