| 25 | } from '../src/index.js'; |
| 26 | |
| 27 | function writeWorkflow(cwd: string, frontMatter = ''): string { |
| 28 | const workflowPath = path.join(cwd, '.codexbridge', 'mission', 'WORKFLOW.md'); |
| 29 | fs.mkdirSync(path.dirname(workflowPath), { recursive: true }); |
| 30 | const text = frontMatter.trim().length > 0 |
| 31 | ? `---\n${frontMatter.trim()}\n---\nExecute the mission carefully and verify the result.\n` |
| 32 | : 'Execute the mission carefully and verify the result.\n'; |
| 33 | fs.writeFileSync(workflowPath, text, 'utf8'); |
| 34 | return workflowPath; |
| 35 | } |
| 36 | |
| 37 | function initGitRepo(cwd: string): void { |
| 38 | execFileSync('git', ['init', '-b', 'main'], { cwd, stdio: 'ignore' }); |