(kaos: Kaos, path: string)
| 161 | } |
| 162 | |
| 163 | async function readAgentFile(kaos: Kaos, path: string): Promise<AgentFile | undefined> { |
| 164 | if (!(await isFile(kaos, path))) return undefined; |
| 165 | const content = (await kaos.readText(path, { errors: 'ignore' })).trim(); |
| 166 | if (content.length === 0) return undefined; |
| 167 | return { path, content }; |
| 168 | } |
| 169 | |
| 170 | async function pathExists(kaos: Kaos, path: string): Promise<boolean> { |
| 171 | try { |