Files
openclaw/src/plugins/registry-runtime-binding.ts
T
Peter Steinberger ccee629359 refactor(plugins): delete registry compat scaffolding (#117749)
* refactor(plugins): delete registry compat scaffolding

* test(plugins): update CLI registry handle mock

* fix(plugins): preserve explicitly initialized hook registries

* test(plugins): update registry ownership fixtures

* fix(channels): restore registry snapshot memo
2026-08-01 21:18:47 -07:00

22 lines
731 B
TypeScript

import type { PluginRegistry } from "./registry-types.js";
import type { PluginRuntime } from "./runtime/types.js";
const PLUGIN_REGISTRY_RUNTIME = Symbol.for("openclaw.pluginRegistryRuntime");
type RuntimeBoundPluginRegistry = PluginRegistry & {
[PLUGIN_REGISTRY_RUNTIME]?: PluginRuntime;
};
export function bindPluginRegistryRuntime(registry: PluginRegistry, runtime: PluginRuntime): void {
Object.defineProperty(registry, PLUGIN_REGISTRY_RUNTIME, {
configurable: false,
enumerable: false,
value: runtime,
writable: false,
});
}
export function getPluginRegistryRuntime(registry: PluginRegistry): PluginRuntime | undefined {
return (registry as RuntimeBoundPluginRegistry)[PLUGIN_REGISTRY_RUNTIME];
}