UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 606 B
import{n as e}from"./rolldown-runtime-8BhlS34s.js";function t(e){let t=window,r={};n=r;let i=i=>{if(n!==r)return;let a=e.connection.gatewayUrl,o=t.__OPENCLAW_NATIVE_GATEWAY_HEALTH__;(o?.gatewayUrl!==a||o.health!==i)&&(t.__OPENCLAW_NATIVE_GATEWAY_HEALTH__={gatewayUrl:a,health:i},window.dispatchEvent(new Event(`openclaw:native-gateway-health-changed`)))},a=()=>{let{phase:t,lastError:n}=e.snapshot;i(t===`connected`?`ok`:n?`error`:`unknown`)},o=e.subscribe(a);return a(),()=>{o(),n===r&&(i(`unknown`),n=void 0)}}var n;function r(){return(r=e((()=>{})))()}r();export{t as startNativeGatewayHealthReporting};