(workspaceDir)
| 56 | * Ensure bootstrap directory exists and create default files if missing. |
| 57 | */ |
| 58 | export 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. |
no test coverage detected