(name: string)
| 14 | } |
| 15 | |
| 16 | export function loadSkill(name: string): string { |
| 17 | const resolved = resolve(SKILLS_DIR, `${name}.txt`); |
| 18 | if (!resolved.startsWith(resolve(SKILLS_DIR) + "/")) { |
| 19 | throw new Error(`Invalid skill name: ${name}`); |
| 20 | } |
| 21 | return readFileSync(resolved, "utf-8"); |
| 22 | } |