import { runContinueJob } from "../packages/adapter-kit/src/background-jobs.js"; import { GraphileJobPublisher } from "../packages/adapters/src/wakeup.js"; import { createDb } from "../packages/db/src/index.js"; async function run() { const { prisma, pool } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo"); const jobs = new GraphileJobPublisher(pool); const runIds = [ "cmu7k4dc50016iryyrv036xze", // Security & QA Auditor "cmu7k4db10012iryyuhfoukpt", // DevOps Engineer "cmu7k4d9n000yiryy0zz4obmq", // Code Architect "cmu7k4d8k000uiryy086x000a", // Apex Quant ]; await prisma.computerExecutionLease.updateMany({ where: { computerId: "cmu6wn6uq0004wjyyotjo50s1" }, data: { expiresAt: new Date(0) }, }); console.log("✓ Expired all computerExecutionLeases."); await prisma.run.updateMany({ where: { id: { in: runIds } }, data: { status: "queued", leaseOwner: null, leaseExpiresAt: new Date(0), }, }); console.log("✓ Reset runs to queued with expired lease."); for (const id of runIds) { await jobs.enqueue(runContinueJob(id)); } console.log("✓ Re-enqueued runContinueJob for all 4 specialists!"); } run() .catch(console.error) .finally(() => process.exit(0));