refactor(plugins): share empty registry factory

This commit is contained in:
Peter Steinberger
2026-02-15 16:43:33 +00:00
parent 9adcccadb1
commit 3783cd3850
2 changed files with 8 additions and 19 deletions

View File

@@ -143,8 +143,8 @@ export type PluginRegistryParams = {
runtime: PluginRuntime;
};
export function createPluginRegistry(registryParams: PluginRegistryParams) {
const registry: PluginRegistry = {
export function createEmptyPluginRegistry(): PluginRegistry {
return {
plugins: [],
tools: [],
hooks: [],
@@ -159,6 +159,10 @@ export function createPluginRegistry(registryParams: PluginRegistryParams) {
commands: [],
diagnostics: [],
};
}
export function createPluginRegistry(registryParams: PluginRegistryParams) {
const registry = createEmptyPluginRegistry();
const coreGatewayMethods = new Set(Object.keys(registryParams.coreGatewayHandlers ?? {}));
const pushDiagnostic = (diag: PluginDiagnostic) => {