()
| 17 | const { Agent } = require('@a3s-lab/code'); |
| 18 | |
| 19 | function repoConfigPath() { |
| 20 | let dir = dirname(fileURLToPath(import.meta.url)); |
| 21 | for (let i = 0; i < 10; i++) { |
| 22 | const candidate = join(dir, '.a3s', 'config.acl'); |
| 23 | if (existsSync(candidate)) return candidate; |
| 24 | dir = dirname(dir); |
| 25 | } |
| 26 | throw new Error('could not locate .a3s/config.acl above this example'); |
| 27 | } |
| 28 | |
| 29 | async function main() { |
| 30 | const agent = await Agent.create(repoConfigPath()); |