mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 19:51:11 +00:00
* Plugin SDK: route browser helper surfaces through browser facade * Browser doctor flow: add facade path regression and export parity guards * Contracts: dedupe browser facade parity checks without reducing coverage * Browser tests: restore host-inspection semantics coverage in extension * fix: add changelog note for browser facade consolidation (#63957) (thanks @joshavant)
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader.js";
|
|
|
|
export type BrowserExecutable = {
|
|
kind: "brave" | "canary" | "chromium" | "chrome" | "custom" | "edge";
|
|
path: string;
|
|
};
|
|
|
|
type BrowserHostInspectionSurface = {
|
|
resolveGoogleChromeExecutableForPlatform: (platform: NodeJS.Platform) => BrowserExecutable | null;
|
|
readBrowserVersion: (executablePath: string) => string | null;
|
|
parseBrowserMajorVersion: (rawVersion: string | null | undefined) => number | null;
|
|
};
|
|
|
|
function loadBrowserHostInspectionSurface(): BrowserHostInspectionSurface {
|
|
return loadBundledPluginPublicSurfaceModuleSync<BrowserHostInspectionSurface>({
|
|
dirName: "browser",
|
|
artifactBasename: "browser-host-inspection.js",
|
|
});
|
|
}
|
|
|
|
export function resolveGoogleChromeExecutableForPlatform(
|
|
platform: NodeJS.Platform,
|
|
): BrowserExecutable | null {
|
|
return loadBrowserHostInspectionSurface().resolveGoogleChromeExecutableForPlatform(platform);
|
|
}
|
|
|
|
export function readBrowserVersion(executablePath: string): string | null {
|
|
return loadBrowserHostInspectionSurface().readBrowserVersion(executablePath);
|
|
}
|
|
|
|
export function parseBrowserMajorVersion(rawVersion: string | null | undefined): number | null {
|
|
return loadBrowserHostInspectionSurface().parseBrowserMajorVersion(rawVersion);
|
|
}
|