(workspaceDir)
| 142 | * List all bootstrap files with content and char count. |
| 143 | */ |
| 144 | export async function listBootstrapFiles(workspaceDir) { |
| 145 | if (!workspaceDir) return [] |
| 146 | const dir = bootstrapDir(workspaceDir) |
| 147 | const results = [] |
| 148 | try { |
| 149 | const entries = await readdir(dir) |
| 150 | for (const name of entries.sort()) { |
| 151 | if (!name.endsWith('.md')) continue |
| 152 | try { |
| 153 | const content = await readFile(join(dir, name), 'utf8') |
| 154 | results.push({ name, content, charCount: content.length }) |
| 155 | } catch { /* skip unreadable */ } |
| 156 | } |
| 157 | } catch { /* dir missing */ } |
| 158 | return results |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Save a bootstrap file. Returns { ok, charCount }. |
no test coverage detected