UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 2.38 kB
import{r as createLazyRuntimeModule}from"./lazy-runtime-Ds6M7vp4.mjs";import{t as warnPluginSdkDeprecation}from"./sdk-deprecation-BDUCyBrU.mjs"; //!src/infra/approval-handler-adapter-runtime.ts const CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY=`approval.native`;function createLazyChannelApprovalNativeRuntimeAdapter(e){warnPluginSdkDeprecation({family:`approval-session-routing`,method:`createLazyChannelApprovalNativeRuntimeAdapter`,replacement:`createLazyChannelApprovalNativeRuntimeAdapterAsync`});return{...createLazyChannelApprovalNativeRuntimeAdapterAsync(e),availability:{isConfigured:e.isConfigured,shouldHandle:e.shouldHandle}}}function createLazyChannelApprovalNativeRuntimeAdapterAsync(e){const t=createLazyRuntimeModule(e.load);let n=null;const loadResolvedRuntime=async()=>{const e=await t();n=e;return e};const loadHook=async e=>e(await loadResolvedRuntime());return{...e.eventKinds?{eventKinds:e.eventKinds}:{},...e.resolveApprovalKind?{resolveApprovalKind:e.resolveApprovalKind}:{},availability:{isConfigured:e.isConfigured,shouldHandle:e.shouldHandle},presentation:{buildPendingPayload:async e=>(await loadHook(e=>e.presentation.buildPendingPayload))(e),buildResolvedResult:async e=>(await loadHook(e=>e.presentation.buildResolvedResult))(e),buildExpiredResult:async e=>(await loadHook(e=>e.presentation.buildExpiredResult))(e)},transport:{prepareTarget:async e=>(await loadHook(e=>e.transport.prepareTarget))(e),deliverPending:async e=>(await loadHook(e=>e.transport.deliverPending))(e),updateEntry:async e=>(await loadHook(e=>e.transport.updateEntry))?.(e),deleteEntry:async e=>(await loadHook(e=>e.transport.deleteEntry))?.(e)},interactions:{bindPending:async e=>(await loadHook(e=>e.interactions?.bindPending))?.(e)??null,unbindPending:async e=>(await loadHook(e=>e.interactions?.unbindPending))?.(e),clearPendingActions:async e=>(await loadHook(e=>e.interactions?.clearPendingActions))?.(e),cancelDelivered:async e=>(await loadHook(e=>e.interactions?.cancelDelivered))?.(e)},observe:{onDeliveryError:e=>n?.observe?.onDeliveryError?.(e),onDuplicateSkipped:e=>n?.observe?.onDuplicateSkipped?.(e),onDelivered:e=>n?.observe?.onDelivered?.(e),onFinalized:e=>n?.observe?.onFinalized?.(e)}}}export{createLazyChannelApprovalNativeRuntimeAdapter as n,createLazyChannelApprovalNativeRuntimeAdapterAsync as r,CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY as t};