| 710 | const GLOBAL_CONFIG_PATH_JSON = join(GLOBAL_CONFIG_DIR, "dcp.json") |
| 711 | |
| 712 | function findOpencodeDir(startDir: string): string | null { |
| 713 | let current = startDir |
| 714 | while (current !== "/") { |
| 715 | const candidate = join(current, ".opencode") |
| 716 | if (existsSync(candidate) && statSync(candidate).isDirectory()) { |
| 717 | return candidate |
| 718 | } |
| 719 | const parent = dirname(current) |
| 720 | if (parent === current) { |
| 721 | break |
| 722 | } |
| 723 | current = parent |
| 724 | } |
| 725 | return null |
| 726 | } |
| 727 | |
| 728 | function getConfigPaths(ctx?: PluginInput): { |
| 729 | global: string | null |