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

// 修复第791-793行
lines[790] = `    const searchTag = String.fromCharCode(60) + '/think' + String.fromCharCode(62);`;
lines[791] = `    const thinkEndIdx = cleanedStr.indexOf(searchTag);`;
lines[792] = `    if (thinkEndIdx !== -1) {`;
lines[793] = `      cleanedStr = cleanedStr.substring(thinkEndIdx + searchTag.length).trim();`;

fs.writeFileSync(file, lines.join('\n'), 'utf8');
console.log('✅ 第791-793行已修复');
