| 57 | } |
| 58 | |
| 59 | function repoConfig() { |
| 60 | if (process.env.A3S_CONFIG_FILE && fs.existsSync(process.env.A3S_CONFIG_FILE)) { |
| 61 | return process.env.A3S_CONFIG_FILE |
| 62 | } |
| 63 | let dir = path.dirname(new URL(import.meta.url).pathname) |
| 64 | for (let i = 0; i < 8; i++) { |
| 65 | const cand = path.join(dir, '.a3s', 'config.acl') |
| 66 | if (fs.existsSync(cand)) return cand |
| 67 | dir = path.dirname(dir) |
| 68 | } |
| 69 | return null |
| 70 | } |
| 71 | |
| 72 | // ── Unit (hermetic): exports + ServeHandle lifecycle ──────────────────────── |
| 73 | assert.equal(typeof ServeHandle, 'function', 'ServeHandle must be exported') |