import { cpSync, existsSync, mkdirSync } from "node:fs"; import { createDb } from "../packages/db/src/index.js"; async function run() { 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 session"); const steve = await prisma.bot.findFirst({ where: { name: "Steve Jobs" } }); const chief = await prisma.bot.findFirst({ where: { name: "Chief" } }); if (!steve || !chief) throw new Error("Missing Steve or Chief"); // 1. Update Chief metadata & instructions const chiefInstructions = `# Chief - Executive Chief Executive Officer (CEO) ## Role & Identity You are **Chief**, the Chief Executive Officer (CEO) of **evOo**. You form the Executive Board together with the Owner (Human User) and Steve Jobs (CTO). Your focus is strategic vision, commercial dominance, resource allocation, and decisive leadership. ## Rules of Engagement - **The Trio**: You, the Owner, and Steve Jobs lead evOo. Steve handles deep technical engineering and design perfection; you steer strategy, execution speed, business viability, and holistic synergy. - **Action & Clarity**: Be decisive, concise, and razor-sharp. Format updates clearly with Unicode symbols (use \`→\` or \`->\`, never LaTeX like \`$\\rightarrow$\`). - **Autonomous Alignment**: Collaborate with Steve Jobs and the team seamlessly. `; await prisma.bot.update({ where: { id: chief.id }, data: { title: "Chief Executive Officer (CEO)", description: "Strategic leadership, commercial vision, executive governance, and capital allocation.", instructions: chiefInstructions, modelProvider: "openai-compatible", modelId: "gemma-4-26b-a4b", }, }); console.log("Updated Chief bot profile."); // 2. Provision Chief home sandbox const chiefHome = `/Users/ingowagner/evOo/data/homes/team-9d790f3a504d3e9ef577ca4f2118e446/bots/${chief.id}`; const steveHome = `/Users/ingowagner/evOo/data/homes/team-9d790f3a504d3e9ef577ca4f2118e446/bots/${steve.id}`; if (!existsSync(chiefHome)) { mkdirSync(chiefHome, { recursive: true }); cpSync(steveHome, chiefHome, { recursive: true }); console.log("Provisioned Chief sandbox home directory at:", chiefHome); } // 3. Create Group Chat "Executive Board" via RPC const res = await fetch("http://127.0.0.1:3100/rpc/groups/create", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${session.token}`, }, body: JSON.stringify({ json: { name: "Executive Board", botIds: [chief.id, steve.id], }, }), }); console.log("Group create status:", res.status); const data = await res.json(); console.log("Group create response:", JSON.stringify(data, null, 2)); } run() .catch(console.error) .finally(() => process.exit(0));