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: { id: { in: [ "cmu7k4dc50016iryyrv036xze", "cmu7k4db10012iryyuhfoukpt", "cmu7k4d9n000yiryy0zz4obmq", "cmu7k4d8k000uiryy086x000a", ], }, }, include: { bot: true }, }); for (const r of runs) { console.log( `Bot: ${r.bot?.name.padEnd(25)} | Status: ${r.status} | Completed: ${r.completedAt} | Error: ${r.error}`, ); } const latestEvents = await prisma.event.findMany({ where: { type: { in: ["thread.message.created", "tool.started", "tool.completed", "thread.progress"] }, createdAt: { gte: new Date(Date.now() - 30_000) }, }, orderBy: { createdAt: "desc" }, take: 8, }); console.log("\nLatest stream/message events count:", latestEvents.length); for (const e of latestEvents) { console.log(`[${e.createdAt.toISOString()}] Type: ${e.type} | Bot: ${e.botId}`); } } run() .catch(console.error) .finally(() => process.exit(0));