mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-22 02:15:26 -06:00
ccee629359
* 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
22 lines
731 B
TypeScript
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];
|
|
}
|