mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 20:51:10 +00:00
refactor(browser): lazy-load plugin registration
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
import {
|
||||
createBrowserPluginService,
|
||||
createBrowserTool,
|
||||
definePluginEntry,
|
||||
handleBrowserGatewayRequest,
|
||||
registerBrowserCli,
|
||||
type OpenClawPluginToolContext,
|
||||
type OpenClawPluginToolFactory,
|
||||
} from "./runtime-api.js";
|
||||
} from "openclaw/plugin-sdk/plugin-entry";
|
||||
|
||||
export default definePluginEntry({
|
||||
id: "browser",
|
||||
name: "Browser",
|
||||
description: "Default browser tool plugin",
|
||||
register(api) {
|
||||
async register(api) {
|
||||
const {
|
||||
createBrowserPluginService,
|
||||
createBrowserTool,
|
||||
handleBrowserGatewayRequest,
|
||||
registerBrowserCli,
|
||||
} = await import("./register.runtime.js");
|
||||
api.registerTool(((ctx: OpenClawPluginToolContext) =>
|
||||
createBrowserTool({
|
||||
sandboxBridgeUrl: ctx.browser?.sandboxBridgeUrl,
|
||||
|
||||
4
extensions/browser/register.runtime.ts
Normal file
4
extensions/browser/register.runtime.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export { createBrowserTool } from "./src/browser-tool.js";
|
||||
export { registerBrowserCli } from "./src/cli/browser-cli.js";
|
||||
export { handleBrowserGatewayRequest } from "./src/gateway/browser-request.js";
|
||||
export { createBrowserPluginService } from "./src/plugin-service.js";
|
||||
Reference in New Issue
Block a user