import { createDb } from "../packages/db/src/index.js"; async function run() { const { prisma } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo"); const runs = await prisma.run.findMany({ where: { bot: { name: { in: ["Apex Quant", "Code Architect", "DevOps Engineer", "Security & QA Auditor"] }, }, }, orderBy: { createdAt: "desc" }, take: 4, include: { bot: true, attempts: true, }, }); for (const r of runs) { console.log(`\nBot: ${r.bot?.name}`); console.log( ` Run: ${r.id} | Status: ${r.status} | LeaseOwner: ${r.leaseOwner} | LeaseExpires: ${r.leaseExpiresAt}`, ); for (const a of r.attempts) { console.log( ` Attempt: ${a.id} | Status: ${a.status} | Error: ${a.error} | Finished: ${a.finishedAt}`, ); } } } run() .catch(console.error) .finally(() => process.exit(0));