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

Function initBootstrap

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

Source from the content-addressed store, hash-verified

56 * Ensure bootstrap directory exists and create default files if missing.
57 */
58export async function initBootstrap(workspaceDir) {
59 if (!workspaceDir) return
60 const dir = bootstrapDir(workspaceDir)
61 await mkdir(dir, { recursive: true })
62
63 const soulPath = join(dir, 'SOUL.md')
64 if (!existsSync(soulPath)) {
65 await writeFile(soulPath, DEFAULT_SOUL, 'utf8')
66 }
67
68 // Auto-generate IDENTITY.md with runtime metadata
69 await regenerateIdentity(dir)
70
71 // Initial load
72 cachedBootstrap = await assembleChain(dir)
73}
74
75/**
76 * Return the cached bootstrap prompt string.

Callers 1

mainFunction · 0.90

Calls 4

bootstrapDirFunction · 0.85
writeFileFunction · 0.85
regenerateIdentityFunction · 0.85
assembleChainFunction · 0.85

Tested by

no test coverage detected