()
| 137 | export const use = serviceUse(Service) |
| 138 | |
| 139 | function globalConfigFile() { |
| 140 | const candidates = ["opencode.jsonc", "opencode.json", "config.json"].map((file) => |
| 141 | path.join(Global.Path.config, file), |
| 142 | ) |
| 143 | for (const file of candidates) { |
| 144 | if (existsSync(file)) return file |
| 145 | } |
| 146 | return candidates[0] |
| 147 | } |
| 148 | |
| 149 | function patchJsonc(input: string, patch: unknown, path: string[] = []): string { |
| 150 | if (!isRecord(patch)) { |