browse
Version:
Unified Browserbase CLI for browser automation and cloud APIs.
34 lines (33 loc) • 1.52 kB
JavaScript
/**
* Stub Browserbase capability used by `build:local-only`. It contains no API
* key handling and never reaches the cloud. Any attempt to use a remote target
* fails loudly.
*/
const DISABLED_MESSAGE = "Remote (Browserbase) mode is disabled in this local-only build of browse. Rebuild without local-only to use cloud sessions.";
export function resolveExplicitRemoteTarget() {
throw new Error(DISABLED_MESSAGE);
}
export function autoSelectRemoteTarget() {
return null;
}
export function remoteStagehandOptions() {
throw new Error(DISABLED_MESSAGE);
}
export function classifyRemoteInitError(error) {
// Remote targets cannot be selected in a local-only build, so this is only
// reachable if a remote error somehow surfaces anyway; preserve it as-is.
return {
code: "remote_session_create_failed",
message: error instanceof Error ? error.message : String(error),
};
}
export function driverInitHints() {
// Key-free variants: a local-only artifact must not mention the API key.
return {
chromeNotFound: "No Chrome or Chromium found on this machine. Install one (Linux: apt install chromium \u00b7 macOS: brew install --cask google-chrome, or Chromium with CHROME_PATH set) or attach to a running browser with --cdp <port>.",
repeatedInitFailure: " (failing repeatedly — check your browser setup or run browse doctor)",
};
}
export function remoteDoctorCheck() {
return { ok: true, message: "remote disabled (local-only build)" };
}