openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
21 lines (20 loc) • 811 B
JavaScript
//#region src/plugins/runtime/load-context-state.ts
const pluginRuntimeLoadContext = Symbol.for("openclaw.pluginRuntimeLoadContext");
function bindPluginRuntimeLoadContextState(e, t) {
Object.defineProperty(e, pluginRuntimeLoadContext, {
value: () => t,
configurable: true,
writable: true,
enumerable: true
});
}
function getPluginRuntimeLoadContextState(e) {
return e?.[pluginRuntimeLoadContext]?.();
}
/** Reads the canonical owner captured before plugin registration, without rediscovery. */
function getSelectedContextEngineOwner(e, t) {
const n = getPluginRuntimeLoadContextState(e)?.selectedContextEngine;
return n?.engineId === t ? n.owner : void 0;
}
//#endregion
export { getPluginRuntimeLoadContextState as n, getSelectedContextEngineOwner as r, bindPluginRuntimeLoadContextState as t };