import { createDb } from "../packages/db/src/index.js"; async function run() { const { prisma } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo"); const msgs = await prisma.message.findMany({ where: { threadId: "cmu6ydgme0001ywyy269411bb" }, orderBy: { seq: "desc" }, take: 5, }); console.log("Recent messages:"); for (const m of msgs.reverse()) { console.log(`[Seq ${m.seq} | Role ${m.role} | RunId ${m.runId}]`); console.log(JSON.stringify(m.blocks)); } const activeRuns = await prisma.run.findMany({ where: { status: "running" }, }); console.log("\nActive running runs count:", activeRuns.length); for (const r of activeRuns) { console.log( `Run ${r.id} | sourceMsg ${r.sourceMessageId} | started: ${r.createdAt.toISOString()}`, ); } } run() .catch(console.error) .finally(() => process.exit(0));