evOo-local/scripts/check-auditor-final.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

43 lines
1.1 KiB
TypeScript

import { createDb } from "../packages/db/src/index.js";
async function run() {
const { prisma } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo");
const auditor = await prisma.bot.findFirst({
where: { name: "Security & QA Auditor" },
include: {
thread: {
include: {
messages: {
orderBy: { seq: "desc" },
take: 2,
},
},
},
},
});
const lastMsg = auditor?.thread?.messages[0];
console.log(`Auditor last msg (role: ${lastMsg?.role}, seq: ${lastMsg?.seq}):`);
if (lastMsg?.role === "bot") {
console.log(JSON.stringify(lastMsg?.blocks, null, 2));
} else {
console.log("Still working/executing...");
}
const latestEvents = await prisma.event.findMany({
where: { botId: auditor?.id },
orderBy: { createdAt: "desc" },
take: 4,
});
console.log("\nLatest events:");
for (const e of latestEvents) {
console.log(
`[${e.createdAt.toISOString()}] ${e.type}: ${JSON.stringify(e.payload || e.data).slice(0, 120)}`,
);
}
}
run()
.catch(console.error)
.finally(() => process.exit(0));