(codexCli?: string)
| 110 | * executor server usually inherits the user's shell PATH), then the common |
| 111 | * install locations for launch contexts that do not. */ |
| 112 | const resolveCodexCli = (codexCli?: string): string | undefined => { |
| 113 | if (codexCli !== undefined) return isExecutableFile(codexCli) ? codexCli : undefined; |
| 114 | const dirs = [ |
| 115 | ...(process.env["PATH"] ?? "").split(path.delimiter), |
| 116 | path.join(os.homedir(), ".bun", "bin"), |
| 117 | path.join(os.homedir(), ".local", "bin"), |
| 118 | "/opt/homebrew/bin", |
| 119 | "/usr/local/bin", |
| 120 | ]; |
| 121 | for (const dir of dirs) { |
| 122 | if (dir.length === 0) continue; |
| 123 | const candidate = path.join(dir, "codex"); |
| 124 | if (isExecutableFile(candidate)) return candidate; |
| 125 | } |
| 126 | return undefined; |
| 127 | }; |
| 128 | |
| 129 | // --------------------------------------------------------------------------- |
| 130 | // Manifest shapes — only the fields discovery needs. Everything else in the |
no test coverage detected