import { createDb } from "../packages/db/src/index.js"; async function main() { const { prisma } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo"); const session = await prisma.session.findFirst({ orderBy: { createdAt: "desc" } }); if (!session) throw new Error("No active session"); const uxBot = await prisma.bot.findFirst({ where: { name: "UX Designer" } }); if (!uxBot) throw new Error("UX Designer not found"); const execGroup = await prisma.chatGroup.findFirst({ where: { name: "Executive Board" } }); if (!execGroup) throw new Error("Executive Board not found"); console.log("Dispatching direct task to UX Designer..."); const res1 = await fetch("http://127.0.0.1:3100/rpc/threads/send", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${session.token}`, }, body: JSON.stringify({ json: { botId: uxBot.id, text: "AUFTRAG DER GESCHAEFTSFUEHRUNG [P0]: Erstelle die vollstaendige UX/UI-Spezifikation fuer das mobile Apex-Trading Dashboard auf dem iPhone (390x844px Viewport). Definiere die 4 Haupt-Module: 1) Real-Time P&L & Sharpe Ratio Chart, 2) Circuit-Breaker Status & Drawdown Gauge, 3) Live Order Execution Feed, 4) Bot Telemetry & Not-Aus (Emergency Stop). Schreibe deine gesamte Spezifikation inklusive Wireframe-Skizzen und Farb-Tokens in die Datei apex-trading/MOBILE_DASHBOARD_UX.md und berichte hier ausfuehrlich.", }, }), }); console.log("UX Designer send status:", res1.status, await res1.json()); console.log("Announcing to Executive Board..."); const res2 = await fetch("http://127.0.0.1:3100/rpc/threads/send", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${session.token}`, }, body: JSON.stringify({ json: { groupId: execGroup.id, text: "@Steve Jobs @Chief @UX Designer Vorgabe der Geschaeftsfuehrung: UX Designer ist live und erarbeitet das Mobile-First iPhone Dashboard in apex-trading/MOBILE_DASHBOARD_UX.md. Steve Jobs und DevOps Engineer setzen parallel die naechsten technischen Schritte fuer Phase 1 um.", }, }), }); console.log("Executive Board send status:", res2.status, await res2.json()); } main() .catch(console.error) .finally(() => process.exit(0));