docs: document browser plugin entrypoints

This commit is contained in:
Peter Steinberger
2026-06-04 07:22:35 -04:00
parent 2ad6314d72
commit 83e4cfba30
14 changed files with 63 additions and 0 deletions

View File

@@ -1,2 +1,6 @@
/**
* Browser bridge API barrel. It exposes the host/sandbox bridge server handle
* and lifecycle helpers without importing the full browser plugin entry.
*/
export type { BrowserBridge } from "./src/browser/bridge-server.js";
export { startBrowserBridgeServer, stopBrowserBridgeServer } from "./src/browser/bridge-server.js";

View File

@@ -1 +1,5 @@
/**
* Browser CDP helper barrel. It exposes URL parsing/redaction helpers used by
* browser config and diagnostics surfaces.
*/
export { parseBrowserHttpUrl, redactCdpUrl } from "./src/browser/cdp.helpers.js";

View File

@@ -1,3 +1,7 @@
/**
* Browser config API barrel. It re-exports default profile, upload, auth, and
* CDP config helpers for setup/runtime consumers.
*/
export {
DEFAULT_AI_SNAPSHOT_MAX_CHARS,
DEFAULT_BROWSER_DEFAULT_PROFILE_NAME,

View File

@@ -1,3 +1,7 @@
/**
* Browser control-auth API barrel. It exposes auth generation and validation
* helpers for the browser control server.
*/
export type { BrowserControlAuth } from "./src/browser/control-auth.js";
export {
ensureBrowserControlAuth,

View File

@@ -1,3 +1,7 @@
/**
* Browser doctor API barrel. It exposes legacy profile cleanup and Chrome MCP
* readiness helpers for OpenClaw doctor.
*/
export {
detectLegacyClawdBrowserProfileResidue,
maybeArchiveLegacyClawdBrowserProfileResidue,

View File

@@ -1,3 +1,7 @@
/**
* Browser host-inspection API barrel. It exposes Chrome executable discovery
* and version parsing helpers.
*/
export type { BrowserExecutable } from "./src/browser/chrome.executables.js";
export {
parseBrowserMajorVersion,

View File

@@ -1,2 +1,6 @@
/**
* Browser maintenance API barrel. It exposes tab cleanup and trash helpers for
* runtime and doctor flows.
*/
export { closeTrackedBrowserTabsForSessions } from "./src/browser/session-tab-registry.js";
export { movePathToTrash } from "./src/browser/trash.js";

View File

@@ -1,3 +1,7 @@
/**
* Browser profile API barrel. It exposes browser profile defaults and config
* resolution helpers for setup and runtime paths.
*/
export {
DEFAULT_AI_SNAPSHOT_MAX_CHARS,
DEFAULT_BROWSER_ACTION_TIMEOUT_MS,

View File

@@ -1,5 +1,10 @@
/**
* Browser CLI metadata entry. It registers the `openclaw browser` command lazily
* so command discovery does not load the full browser runtime.
*/
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
/** Plugin entry that contributes Browser CLI commands. */
export default definePluginEntry({
id: "browser",
name: "Browser",

View File

@@ -1,3 +1,7 @@
/**
* Browser plugin entry. It wires the browser tool, gateway request handler,
* node-host command, services, reload policy, and security audit collectors.
*/
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import {
browserPluginNodeHostCommands,
@@ -6,6 +10,7 @@ import {
registerBrowserPlugin,
} from "./plugin-registration.js";
/** Main Browser plugin entry for runtime registration. */
export default definePluginEntry({
id: "browser",
name: "Browser",

View File

@@ -1,3 +1,7 @@
/**
* Browser plugin registration helpers. This file keeps registration lazy while
* advertising Browser tools, services, node-host commands, and audits.
*/
import type {
AnyAgentTool,
OpenClawPluginApi,
@@ -140,8 +144,10 @@ function createBrowserToolOptions(ctx: OpenClawPluginToolContext): {
};
}
/** Browser plugin reload policy. */
export const browserPluginReload = { restartPrefixes: ["browser"] };
/** Node-host command descriptors exposed by the Browser plugin. */
export const browserPluginNodeHostCommands: OpenClawPluginNodeHostCommand[] = [
{
command: "browser.proxy",
@@ -153,6 +159,7 @@ export const browserPluginNodeHostCommands: OpenClawPluginNodeHostCommand[] = [
},
];
/** Security audit collectors contributed by the Browser plugin. */
export const browserSecurityAuditCollectors: OpenClawPluginSecurityAuditCollector[] = [
async (ctx) => {
const { collectBrowserSecurityAuditFindings } = await loadBrowserRegistrationRuntimeModule();
@@ -189,6 +196,7 @@ function createLazyBrowserPluginService(): OpenClawPluginService {
};
}
/** Register Browser tool factories, CLI, gateway methods, services, and audits. */
export function registerBrowserPlugin(api: OpenClawPluginApi) {
api.registerTool(((ctx: OpenClawPluginToolContext) =>
createLazyBrowserTool(createBrowserToolOptions(ctx))) as OpenClawPluginToolFactory);

View File

@@ -1,3 +1,7 @@
/**
* Browser runtime registration barrel. Node host commands and plugin
* registration lazy-load these exports when browser runtime behavior is needed.
*/
export { createBrowserTool } from "./src/browser-tool.js";
export { handleBrowserGatewayRequest } from "./src/gateway/browser-request.js";
export { runBrowserProxyCommand } from "./src/node-host/invoke-browser.js";

View File

@@ -1,3 +1,7 @@
/**
* Browser runtime API barrel. It exposes the full Browser runtime surface for
* plugin consumers while keeping the entrypoint itself declarative.
*/
export { createBrowserTool } from "./src/browser-tool.js";
export {
applyBrowserProxyPaths,

View File

@@ -1,3 +1,7 @@
/**
* Browser setup entry. It auto-enables the Browser plugin when config or tool
* policies reference browser control.
*/
import type { OpenClawConfig } from "openclaw/plugin-sdk/plugin-entry";
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -26,6 +30,7 @@ function hasBrowserToolReference(config: OpenClawConfig): boolean {
: false;
}
/** Setup entry that detects existing Browser configuration references. */
export default definePluginEntry({
id: "browser",
name: "Browser Setup",