mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-27 00:17:29 +00:00
refactor: harden plugin metadata and browser sdk seams
This commit is contained in:
@@ -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() {},
|
||||
|
||||
Reference in New Issue
Block a user