import { fromApiKey } from '@auvy-synapse/client'
async function nightlySummary() {
const auvy = await fromApiKey()
const { receptor } = await auvy.receptors.get(auvy.workspaceSlug!, 'nightly-summary')
const { job_id } = await auvy.receptors.fire(
receptor.id,
{ message: 'Summarize open incidents from the last 24h' },
{ async: true },
)
const result = await auvy.jobs.wait(job_id, { timeout_ms: 600_000 })
console.log(JSON.stringify(result, null, 2))
}
nightlySummary().catch((err) => {
console.error(err)
process.exit(1)
})