mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 00:31:22 +00:00
refactor: switch browser ownership to bundled plugin
This commit is contained in:
@@ -298,6 +298,29 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
dirName: "browser",
|
||||
idHint: "browser-plugin",
|
||||
source: {
|
||||
source: "./index.ts",
|
||||
built: "index.js",
|
||||
},
|
||||
packageName: "@openclaw/browser-plugin",
|
||||
packageVersion: "2026.3.25",
|
||||
packageDescription: "OpenClaw browser tool plugin",
|
||||
packageManifest: {
|
||||
extensions: ["./index.ts"],
|
||||
},
|
||||
manifest: {
|
||||
id: "browser",
|
||||
configSchema: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {},
|
||||
},
|
||||
enabledByDefault: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
dirName: "byteplus",
|
||||
idHint: "byteplus",
|
||||
|
||||
50
src/plugins/cli.browser-plugin.integration.test.ts
Normal file
50
src/plugins/cli.browser-plugin.integration.test.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { Command } from "commander";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { registerPluginCliCommands } from "./cli.js";
|
||||
import { clearPluginLoaderCache } from "./loader.js";
|
||||
import { clearPluginManifestRegistryCache } from "./manifest-registry.js";
|
||||
import { resetPluginRuntimeStateForTest } from "./runtime.js";
|
||||
|
||||
function resetPluginState() {
|
||||
clearPluginLoaderCache();
|
||||
clearPluginManifestRegistryCache();
|
||||
resetPluginRuntimeStateForTest();
|
||||
}
|
||||
|
||||
describe("registerPluginCliCommands browser plugin integration", () => {
|
||||
beforeEach(() => {
|
||||
resetPluginState();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
resetPluginState();
|
||||
});
|
||||
|
||||
it("registers the browser command from the bundled browser plugin", () => {
|
||||
const program = new Command();
|
||||
registerPluginCliCommands(program, {
|
||||
plugins: {
|
||||
allow: ["browser"],
|
||||
},
|
||||
} as OpenClawConfig);
|
||||
|
||||
expect(program.commands.map((command) => command.name())).toContain("browser");
|
||||
});
|
||||
|
||||
it("omits the browser command when the bundled browser plugin is disabled", () => {
|
||||
const program = new Command();
|
||||
registerPluginCliCommands(program, {
|
||||
plugins: {
|
||||
allow: ["browser"],
|
||||
entries: {
|
||||
browser: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig);
|
||||
|
||||
expect(program.commands.map((command) => command.name())).not.toContain("browser");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user