mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-14 11:30:41 +00:00
26 lines
633 B
TypeScript
26 lines
633 B
TypeScript
import type { PluginRegistry } from "./registry.js";
|
|
|
|
export function createMockPluginRegistry(
|
|
hooks: Array<{ hookName: string; handler: (...args: unknown[]) => unknown }>,
|
|
): PluginRegistry {
|
|
return {
|
|
hooks: hooks as never[],
|
|
typedHooks: hooks.map((h) => ({
|
|
pluginId: "test-plugin",
|
|
hookName: h.hookName,
|
|
handler: h.handler,
|
|
priority: 0,
|
|
source: "test",
|
|
})),
|
|
tools: [],
|
|
httpHandlers: [],
|
|
httpRoutes: [],
|
|
channelRegistrations: [],
|
|
gatewayHandlers: {},
|
|
cliRegistrars: [],
|
|
services: [],
|
|
providers: [],
|
|
commands: [],
|
|
} as unknown as PluginRegistry;
|
|
}
|