* Load commands from commands.yaml
(sessionDir: string)
| 50 | * Load commands from commands.yaml |
| 51 | */ |
| 52 | async function loadCommands(sessionDir: string): Promise<Command[]> { |
| 53 | const commandsPath = path.join(sessionDir, 'commands.yaml') |
| 54 | |
| 55 | try { |
| 56 | const content = await fs.readFile(commandsPath, 'utf-8') |
| 57 | const commands = yaml.load(content) as Command[] |
| 58 | return commands || [] |
| 59 | } catch { |
| 60 | return [] |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Parse YAML front-matter from a capture file |