(projectRoot, relativePath, maxChars = 24000)
| 40 | } |
| 41 | |
| 42 | function readText(projectRoot, relativePath, maxChars = 24000) { |
| 43 | const filePath = path.join(projectRoot, relativePath); |
| 44 | if (!fs.existsSync(filePath)) return ''; |
| 45 | return fs.readFileSync(filePath, 'utf8').slice(0, maxChars); |
| 46 | } |
| 47 | |
| 48 | function listFiles(root, predicate = () => true, limit = 50) { |
| 49 | if (!fs.existsSync(root)) return []; |