mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-16 20:40:45 +00:00
28 lines
781 B
TypeScript
28 lines
781 B
TypeScript
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
|
|
|
|
type TestPluginApiInput = Partial<OpenClawPluginApi> &
|
|
Pick<OpenClawPluginApi, "id" | "name" | "source" | "config" | "runtime">;
|
|
|
|
export function createTestPluginApi(api: TestPluginApiInput): OpenClawPluginApi {
|
|
return {
|
|
registrationMode: "full",
|
|
logger: { info() {}, warn() {}, error() {}, debug() {} },
|
|
registerTool() {},
|
|
registerHook() {},
|
|
registerHttpRoute() {},
|
|
registerChannel() {},
|
|
registerGatewayMethod() {},
|
|
registerCli() {},
|
|
registerService() {},
|
|
registerProvider() {},
|
|
registerInteractiveHandler() {},
|
|
registerCommand() {},
|
|
registerContextEngine() {},
|
|
resolvePath(input: string) {
|
|
return input;
|
|
},
|
|
on() {},
|
|
...api,
|
|
};
|
|
}
|