MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / listBootstrapFiles

Function listBootstrapFiles

tools/claw-launcher-ui/bootstrap.mjs:144–159  ·  view source on GitHub ↗
(workspaceDir)

Source from the content-addressed store, hash-verified

142 * List all bootstrap files with content and char count.
143 */
144export 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 }.

Callers 1

server.mjsFile · 0.90

Calls 3

bootstrapDirFunction · 0.85
readFileFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected