UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.12 kB
import{a as getRemoteControlUiIngressContext,o as hasCurrentRemoteControlUiIngress,u as readGatewayIngressTransport}from"./ingress-attribution-Ct_hJMPU.mjs"; //!src/gateway/desktop/observe-requester.ts function resolveDesktopObserveRequester(e){const{client:t,hasCurrentClientAuthority:n}=e;if(!t)return;return{connId:t.connId,operatorName:t.authenticatedUserProfile?.displayName?.trim()||t.authenticatedUserId?.trim()||void 0,signal:t.connectionSignal,remoteIngressPrincipal:t.internal?.remoteIngressPrincipal,openclawIdPeerKey:t.internal?.openclawIdPeerKey,isCurrent:()=>t.invalidated!==true&&!t.connectionSignal?.aborted&&n?.()!==false}}function hasCurrentDesktopObserveRequester(e,t){if(e?.isCurrent()===false)return false;if(!t)return true;const n=readGatewayIngressTransport(t);const r=n?.kind===`openclaw-id-tunnel`?n.peerKey:void 0;const i=getRemoteControlUiIngressContext(t);return e?.openclawIdPeerKey===r&&hasCurrentRemoteControlUiIngress(i)&&(!i||e?.remoteIngressPrincipal?.assertCurrent===i.resolvePrincipal().assertCurrent)}export{resolveDesktopObserveRequester as n,hasCurrentDesktopObserveRequester as t};