UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 3.34 kB
import{$ as e,Cn as t,Q as n,et as r}from"./openclaw-state-read-subsystem-Dwoo5bcz.mjs";import"./openclaw-state-read-openclaw-root-CbFTRFFl.mjs";import"node:util";new n(Symbol(`agentDatabasePreparation`)),Object.getOwnPropertyDescriptor(Promise.prototype,`then`),Object.getOwnPropertyDescriptor(Promise,Symbol.species);const i=t(Symbol.for(`openclaw.pluginRuntimeExecutionFrame`),()=>class RuntimeFrame extends e{constructor(e,t,n,r=e.invocation){super(e,r),this.gatewayScope=t,this.generationRegistry=n}get runtimePluginId(){return this.gatewayScope?.pluginId}withScopes(e){return new RuntimeFrame(e,this.gatewayScope,this.generationRegistry)}});function getPluginRuntimeExecutionFrame(e=r()){return e instanceof i?e:void 0}const{getGatewayContextBindingSlot:a,prepareGatewayContextBindingOwner:o}=t(Symbol.for(`openclaw.gatewayContextBindingOwner`),()=>{let e=Symbol(`gatewayContextBindingOwner`);class GatewayContextBindingOwner{#e;constructor(e){this.#e=e,Object.setPrototypeOf(this,null)}static read(e,t){return typeof e==`object`&&e&&#e in e&&e.#e===t?e:void 0}}function readSlot(t){let n=Object.getOwnPropertyDescriptor(t,e)?.value;return GatewayContextBindingOwner.read(n,t)}function prepareOwner(t){return readSlot(t)||Object.defineProperty(t,e,{value:new GatewayContextBindingOwner(t)}),t}return{getGatewayContextBindingSlot:readSlot,prepareGatewayContextBindingOwner:prepareOwner}}),{bindGatewayContextResolver:s,getGatewayContextLifetime:c,getGatewayContextResolver:l,clearGatewayContextResolver:u}=t(Symbol.for(`openclaw.gatewayContextBindings`),()=>{let e=Symbol(`gatewayContextBinding`),t=Symbol(`gatewayContextLifetime`);class GatewayContextBinding{#e;#t;constructor(e){this.#e=e,Object.setPrototypeOf(this,null)}static read(e,t){return typeof e==`object`&&e&&#e in e&&e.#e===t?e:void 0}static get(e){return e.#t}static set(e,t){e.#t=t}}class GatewayContextLifetime{#e;#t=new AbortController;constructor(e){this.#e=e,Object.setPrototypeOf(this,null)}static read(e,t){return typeof e==`object`&&e&&#e in e&&e.#e===t?e.#t:void 0}}function getGatewayContextBinding(t){let n=a(t),r=n&&Object.getOwnPropertyDescriptor(n,e)?.value;return GatewayContextBinding.read(r,t)}function getLifetime(e){let n=Object.getOwnPropertyDescriptor(e,t)?.value,r=GatewayContextLifetime.read(n,e);if(r)return r;let i=new GatewayContextLifetime(e);return Object.defineProperty(e,t,{value:i}),GatewayContextLifetime.read(i,e)}function bindResolver(t,n){if(n){o(t);let r=getGatewayContextBinding(t);if(!r){let n=a(t);r=new GatewayContextBinding(t),Object.defineProperty(n,e,{value:r})}GatewayContextBinding.set(r,n)}}function readResolver(e){let t=getGatewayContextBinding(e);return t?GatewayContextBinding.get(t):void 0}function clearResolver(e){let t=getGatewayContextBinding(e),n=t!==void 0&&GatewayContextBinding.get(t)!==void 0;return t&&GatewayContextBinding.set(t,void 0),n}return{bindGatewayContextResolver:bindResolver,getGatewayContextLifetime:getLifetime,getGatewayContextResolver:readResolver,clearGatewayContextResolver:clearResolver}});t(Symbol.for(`openclaw.expiredPluginRegistryScopeError`),()=>class extends Error{constructor(){super(`Plugin registry scope is no longer available`)}});function getPluginRuntimeGatewayRequestScope(){return getPluginRuntimeExecutionFrame()?.gatewayScope}export{getPluginRuntimeGatewayRequestScope as t};