const fs = require('fs'); // 1. Remove status and listJobs from server.ts let serverCode = fs.readFileSync('src/server.ts', 'utf8'); serverCode = serverCode.replace(/app\.get\('\/api\/status'[\s\S]*?\}\);\n/g, ""); fs.writeFileSync('src/server.ts', serverCode); // 2. Fix agent-session-runner.ts let runnerCode = fs.readFileSync('src/agent-session-runner.ts', 'utf8'); runnerCode = runnerCode.replace(/import \{ createLLM, toOAITools, LLMMessage \} from "\.\/llm";/g, 'import { callVibnChat } from "./llm/vibn-chat-model";\nimport { ChatMessage } from "./llm/gemini-chat";'); runnerCode = runnerCode.replace(/import \{ ingestSessionEvents \} from "\.\/vibn-events-ingest";/g, ''); runnerCode = runnerCode.replace(/ingestSessionEvents\([\s\S]*?\),/g, ''); // Since the whole loop needs to use the new frontend loop, // I should just replace the loop in runSessionAgent with a placeholder // for now to make it compile, then we can copy the actual loop.