(p: string, content: string)
| 184 | O_NOFOLLOW |
| 185 | |
| 186 | async function safeWriteFile(p: string, content: string): Promise<void> { |
| 187 | const fh = await open(p, SAFE_WRITE_FLAGS, 0o600) |
| 188 | try { |
| 189 | await fh.writeFile(content, 'utf8') |
| 190 | } finally { |
| 191 | await fh.close() |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | /** Normalize and validate a skill-relative path; throws on traversal. */ |
| 196 | function resolveSkillFilePath(baseDir: string, relPath: string): string { |
no test coverage detected