mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 11:55:47 -06:00
26210c1600
* refactor(browser): collapse Playwright export paths * refactor(browser): remove dead plugin exports * refactor(codex): remove dead app-server exports * refactor(codex): remove remaining dead exports * test(codex): use canonical private-type owners * test(browser): isolate proxy startup state * test(browser): remove stale chrome imports * refactor(codex): privatize remaining helpers * chore(deadcode): refresh export baseline after rebase * refactor(browser): finish canonical helper ownership * refactor: fix dead-export cleanup gates * refactor(codex): keep runtime facades LOC-neutral * chore(ci): refresh TypeScript LOC baseline * chore(deadcode): refresh ratchets after rebase * chore(ci): refresh LOC baseline after main advance * chore(deadcode): align ratchets with latest main
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
/** Shared path candidates for Codex's macOS desktop app bundle. */
|
|
import { existsSync } from "node:fs";
|
|
|
|
type MacOSDesktopCodexAppPathCandidate = {
|
|
appName: "ChatGPT.app" | "Codex.app";
|
|
appBundlePath: string;
|
|
appServerCommandPath: string;
|
|
bundledMarketplacePath: string;
|
|
};
|
|
|
|
const MACOS_DESKTOP_CODEX_APP_PATH_CANDIDATES: readonly MacOSDesktopCodexAppPathCandidate[] = [
|
|
{
|
|
appName: "ChatGPT.app",
|
|
appBundlePath: "/Applications/ChatGPT.app",
|
|
appServerCommandPath: "/Applications/ChatGPT.app/Contents/Resources/codex",
|
|
bundledMarketplacePath: "/Applications/ChatGPT.app/Contents/Resources/plugins/openai-bundled",
|
|
},
|
|
{
|
|
appName: "Codex.app",
|
|
appBundlePath: "/Applications/Codex.app",
|
|
appServerCommandPath: "/Applications/Codex.app/Contents/Resources/codex",
|
|
bundledMarketplacePath: "/Applications/Codex.app/Contents/Resources/plugins/openai-bundled",
|
|
},
|
|
] as const;
|
|
|
|
export function resolveMacOSDesktopCodexBundledMarketplaceCandidates(
|
|
platform: NodeJS.Platform = process.platform,
|
|
): string[] {
|
|
return platform === "darwin"
|
|
? MACOS_DESKTOP_CODEX_APP_PATH_CANDIDATES.map((candidate) => candidate.bundledMarketplacePath)
|
|
: [];
|
|
}
|
|
|
|
export function resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath(
|
|
params: {
|
|
platform?: NodeJS.Platform;
|
|
candidates?: readonly string[];
|
|
pathExists?: (filePath: string) => boolean;
|
|
} = {},
|
|
): string | undefined {
|
|
const candidates =
|
|
params.candidates ?? resolveMacOSDesktopCodexBundledMarketplaceCandidates(params.platform);
|
|
const pathExists = params.pathExists ?? existsSync;
|
|
return candidates.find((candidate) => pathExists(candidate));
|
|
}
|