fix(browser): break doctor client import cycle

This commit is contained in:
Peter Steinberger
2026-04-25 01:22:40 +01:00
parent 4e42a4cfe8
commit 8a490f4509
4 changed files with 37 additions and 26 deletions

View File

@@ -1,34 +1,21 @@
import { buildProfileQuery, withBaseUrl } from "./client-actions-url.js";
import { fetchBrowserJson } from "./client-fetch.js";
import type { BrowserTab, BrowserTransport, SnapshotAriaNode } from "./client.types.js";
import type {
BrowserStatus,
BrowserTab,
BrowserTransport,
SnapshotAriaNode,
} from "./client.types.js";
import type { BrowserDoctorReport } from "./doctor.js";
export type { BrowserTab, BrowserTransport, SnapshotAriaNode } from "./client.types.js";
export type {
BrowserStatus,
BrowserTab,
BrowserTransport,
SnapshotAriaNode,
} from "./client.types.js";
export type { BrowserDoctorCheck, BrowserDoctorReport } from "./doctor.js";
export type BrowserStatus = {
enabled: boolean;
profile?: string;
driver?: "openclaw" | "existing-session";
transport?: BrowserTransport;
running: boolean;
cdpReady?: boolean;
cdpHttp?: boolean;
pid: number | null;
cdpPort: number | null;
cdpUrl?: string | null;
chosenBrowser: string | null;
detectedBrowser?: string | null;
detectedExecutablePath?: string | null;
detectError?: string | null;
userDataDir: string | null;
color: string;
headless: boolean;
noSandbox?: boolean;
executablePath?: string | null;
attachOnly: boolean;
};
export type ProfileStatus = {
name: string;
transport?: BrowserTransport;

View File

@@ -1,5 +1,28 @@
export type BrowserTransport = "cdp" | "chrome-mcp";
export type BrowserStatus = {
enabled: boolean;
profile?: string;
driver?: "openclaw" | "existing-session";
transport?: BrowserTransport;
running: boolean;
cdpReady?: boolean;
cdpHttp?: boolean;
pid: number | null;
cdpPort: number | null;
cdpUrl?: string | null;
chosenBrowser: string | null;
detectedBrowser?: string | null;
detectedExecutablePath?: string | null;
detectError?: string | null;
userDataDir: string | null;
color: string;
headless: boolean;
noSandbox?: boolean;
executablePath?: string | null;
attachOnly: boolean;
};
export type BrowserTab = {
/** Best handle for agents to pass back as targetId: label, then tabId, then raw targetId. */
suggestedTargetId?: string;

View File

@@ -1,4 +1,4 @@
import type { BrowserStatus, BrowserTransport } from "./client.js";
import type { BrowserStatus, BrowserTransport } from "./client.types.js";
export type BrowserDoctorCheckStatus = "pass" | "warn" | "fail" | "info";

View File

@@ -14,6 +14,7 @@ describe("browser doctor readiness", () => {
},
{
noteFn,
env: { DISPLAY: ":99" },
resolveManagedExecutable: () => ({ kind: "chrome", path: "/usr/bin/google-chrome" }),
},
);