| 117 | const files: string[] = []; |
| 118 | |
| 119 | function scanDir(dir: string, prefix: string = '') { |
| 120 | const entries = fs.readdirSync(dir, { withFileTypes: true }); |
| 121 | for (const entry of entries) { |
| 122 | if (entry.name.startsWith('.')) continue; |
| 123 | const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name; |
| 124 | if (entry.isDirectory()) { |
| 125 | scanDir(path.join(dir, entry.name), relativePath); |
| 126 | } else { |
| 127 | files.push(relativePath); |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | scanDir(skillPath); |
| 133 | return { count: files.length, files }; |