refactor: harden plugin metadata and browser sdk seams

This commit is contained in:
Peter Steinberger
2026-04-05 23:33:33 +01:00
parent c1b1d14218
commit 3584d28141
43 changed files with 378 additions and 249 deletions

View File

@@ -1,14 +1,15 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-runtime";
type TestPluginApiInput = Omit<
Partial<OpenClawPluginApi>,
"id" | "name" | "source" | "config" | "runtime"
> &
Pick<OpenClawPluginApi, "id" | "name" | "source" | "config" | "runtime">;
type TestPluginApiInput = Partial<OpenClawPluginApi>;
export function createTestPluginApi(api: TestPluginApiInput): OpenClawPluginApi {
export function createTestPluginApi(api: TestPluginApiInput = {}): OpenClawPluginApi {
return {
id: "test-plugin",
name: "test-plugin",
source: "test",
registrationMode: "full",
config: {},
runtime: {} as OpenClawPluginApi["runtime"],
logger: { info() {}, warn() {}, error() {}, debug() {} },
registerTool() {},
registerHook() {},