import { createDb } from "../packages/db/src/index.js"; async function run() { const { prisma } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo"); const group = await prisma.chatGroup.findFirst({ where: { name: "Executive Board" }, include: { thread: { include: { messages: { orderBy: { seq: "desc" }, take: 2, }, }, }, }, }); const latestMsg = group?.thread?.messages[0]; console.log("Chief Message in Executive Board:"); console.log(JSON.stringify(latestMsg?.blocks, null, 2)); const run = await prisma.run.findUnique({ where: { id: "cmu7k3m4x000qiryyt59ju2n0" }, }); console.log("Run status:", run?.status); } run() .catch(console.error) .finally(() => process.exit(0));