(loc: Location)
| 88 | // opencode auto-creates .jsonc on first run, so that's the dominant |
| 89 | // real-world case and the sensible default for greenfield installs. |
| 90 | function configPath(loc: Location): string { |
| 91 | const dir = configBaseDir(loc); |
| 92 | const jsonc = path.join(dir, 'opencode.jsonc'); |
| 93 | const json = path.join(dir, 'opencode.json'); |
| 94 | if (fs.existsSync(jsonc)) return jsonc; |
| 95 | if (fs.existsSync(json)) return json; |
| 96 | return jsonc; |
| 97 | } |
| 98 | |
| 99 | function instructionsPath(loc: Location): string { |
| 100 | return path.join(configBaseDir(loc), 'AGENTS.md'); |
no test coverage detected