mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:18:28 +00:00
refactor(plugins): share empty registry factory
This commit is contained in:
@@ -1,22 +1,7 @@
|
||||
import type { PluginRegistry } from "../../../plugins/registry.js";
|
||||
import { createEmptyPluginRegistry, type PluginRegistry } from "../../../plugins/registry.js";
|
||||
|
||||
export const createTestRegistry = (overrides: Partial<PluginRegistry> = {}): PluginRegistry => {
|
||||
const base: PluginRegistry = {
|
||||
plugins: [],
|
||||
tools: [],
|
||||
hooks: [],
|
||||
typedHooks: [],
|
||||
channels: [],
|
||||
providers: [],
|
||||
gatewayHandlers: {},
|
||||
httpHandlers: [],
|
||||
httpRoutes: [],
|
||||
cliRegistrars: [],
|
||||
services: [],
|
||||
commands: [],
|
||||
diagnostics: [],
|
||||
};
|
||||
const merged = { ...base, ...overrides };
|
||||
const merged = { ...createEmptyPluginRegistry(), ...overrides };
|
||||
return {
|
||||
...merged,
|
||||
gatewayHandlers: merged.gatewayHandlers ?? {},
|
||||
|
||||
Reference in New Issue
Block a user