const fs = require('fs');
const file = 'src/modules/book-generator/langgraph-controller.ts';
let c = fs.readFileSync(file, 'utf8');
const lines = c.split('\n');

// 修复第323-324行
for (let i = 322; i < 325; i++) {
  if (lines[i].includes('console.log([LangGraph]')) {
    lines[i] = '    console.log(`[LangGraph] 生成任务已加入队列: bookId=${book.id}, jobId=${jobId}`);';
    if (lines[i+1] && lines[i+1].trim() === '});') {
      lines.splice(i+1, 1);
    }
    break;
  }
}

fs.writeFileSync(file, lines.join('\n'), 'utf8');
console.log('✅ 语法错误已修复');
